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
71465713
from django.contrib import admin from django.db.models import QuerySet from django.http import HttpRequest from .models import Filmwork from .models import Genre from .models import GenreFilmwork from .models import Person from .models import PersonFilmwork class GenreFilmworkInline(admin.TabularInline): model =...
leks20/new_admin_panel_sprint_3
app/movies/admin.py
admin.py
py
1,577
python
en
code
0
github-code
21
[ { "api_name": "django.contrib.admin.TabularInline", "line_number": 12, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 12, "usage_type": "name" }, { "api_name": "models.GenreFilmwork", "line_number": 13, "usage_type": "name" }, { ...
5577567444
import os import numpy as np from toolz.sandbox import unzip from src.data.data_three import pad_tensors, pad_tensors_pos from src.data.data_three import get_ids_three, get_size_rank from src.data.utils import pad_sequence # Image feature, Text token, Audio feature class T2IDetectFeatTxtTokTwoDataset(): """ Detect...
mindspore-ai/zidongtaichu
src/data/t2i_ft.py
t2i_ft.py
py
5,055
python
en
code
9
github-code
21
[ { "api_name": "numpy.random.randn", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 20, "usage_type": "attribute" }, { "api_name": "numpy.float32", "line_number": 20, "usage_type": "attribute" }, { "api_name": "numpy.random....
19065227448
import os from fastapi.testclient import TestClient from main import app client = TestClient(app) os.environ["CHAT_PROVIDER"] = "OpenAIAssistantAPIChatProvider" os.environ["OPENAI_API_KEY"] = "{your_OPENAI_API_KEY}" def test_query_endpoint(): response = client.post("/query", json={"message": "What is Boyko's ...
boyko11/resume-chat
test/routes/test_chat.py
test_chat.py
py
716
python
en
code
0
github-code
21
[ { "api_name": "fastapi.testclient.TestClient", "line_number": 7, "usage_type": "call" }, { "api_name": "main.app", "line_number": 7, "usage_type": "argument" }, { "api_name": "os.environ", "line_number": 9, "usage_type": "attribute" }, { "api_name": "os.environ", ...
31358734666
from constructs import Construct from aws_cdk import NestedStack, aws_lambda as lambda_ from awsStack.networkStack import NetworkStack class LambdaStack(NestedStack): def __init__( self, scope: Construct, id: str, network_stack: NetworkStack, **kwargs ) -> None: super().__init__(scope, id, **...
parisnakitakejser/video-tutorial-python-code
aws/AWS-CDK/VPC/create-vpc-endpoint-interface-aws-privatelink/awsStack/lambdaStack.py
lambdaStack.py
py
631
python
en
code
29
github-code
21
[ { "api_name": "aws_cdk.NestedStack", "line_number": 7, "usage_type": "name" }, { "api_name": "constructs.Construct", "line_number": 9, "usage_type": "name" }, { "api_name": "awsStack.networkStack.NetworkStack", "line_number": 9, "usage_type": "name" }, { "api_name...
72804343732
import tkinter from tkinter import filedialog delete='' import os import shutil import hashlib def hashfile(path,blocksize=1024): afile=open(path,'rb') hasher=hashlib.md5() buf=afile.read(blocksize) while len(buf)>0: hasher.update(buf) buf=afile.read(blocksize) afile.close() r...
MahadevGopanpalli/Python-Scripts
Project/Dup.py
Dup.py
py
2,741
python
en
code
0
github-code
21
[ { "api_name": "hashlib.md5", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path.abspath", "line_number": 21, "usage_type": "call" }, { "api_name": "os.path", "line_number": 21, "usage_type": "attribute" }, { "api_name": "os.walk", "line_number":...
37812972715
#!/usr/bin/env python # vim: fileencoding=utf8:et:sw=4:ts=8:sts=4 import os from setuptools import setup VERSION = (0, 0, 2, "") install_deps = ['psycopg2', 'mummy'] test_deps = install_deps + ['greenhouse', 'fuzzy', 'nose'] setup( name="datahog", description="a shardable postgresql-backed data store", ...
teepark/datahog
setup.py
setup.py
py
543
python
en
code
3
github-code
21
[ { "api_name": "setuptools.setup", "line_number": 13, "usage_type": "call" } ]
31224923305
import gatt, json, sys, os #import struct class AnyDevice(gatt.Device): def services_resolved(self): super().services_resolved() self.posture_service = next( s for s in self.services if s.uuid == '64a15170-33f2-c6b6-f740-9985e07962c7') self.back_characteristic = next( c for c in self.posture_servic...
MHML2018/studious-octo-goggles
gatt_read_char.py
gatt_read_char.py
py
1,870
python
en
code
0
github-code
21
[ { "api_name": "gatt.Device", "line_number": 6, "usage_type": "attribute" }, { "api_name": "os.execl", "line_number": 31, "usage_type": "call" }, { "api_name": "sys.executable", "line_number": 31, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_num...
16935339164
import numpy as np import cv2 as cv # img = cv.imread('test_images/shapes.jpg') img = cv.imread('test_images/smarites.jpg') output = img.copy() gray = cv.cvtColor(img, cv.COLOR_BGR2GRAY) gray = cv.medianBlur(gray, 5) # circles = cv.HoughCircles(gray, cv.HOUGH_GRADIENT, 1, 20, param1=50, param2=30, minRadius=0, maxRad...
manthan89-py/OpenCV-Python-Tutorials
circle_detection_using_hough_transform.py
circle_detection_using_hough_transform.py
py
688
python
en
code
4
github-code
21
[ { "api_name": "cv2.imread", "line_number": 5, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 8, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2GRAY", "line_number": 8, "usage_type": "attribute" }, { "api_name": "cv2.medianBlur", "li...
74319085491
import json import multiprocessing import matplotlib.pyplot as plt import pymongo from pymongo import MongoClient import argparse import datetime as dt import pandas as pd import itertools from scipy import stats import numpy as np import tqdm from migration.migrate_helper import fetch_rand_users_from_file, fetc...
Caizoo/Reddit
migration/macro_migrate.py
macro_migrate.py
py
4,310
python
en
code
0
github-code
21
[ { "api_name": "migration.migrate_helper.fetch_top_users_from_file", "line_number": 33, "usage_type": "call" }, { "api_name": "migration.migrate_helper.fetch_rand_users_from_file", "line_number": 35, "usage_type": "call" }, { "api_name": "json.load", "line_number": 37, "us...
9779019357
# -*- coding:utf-8 -*- from __future__ import absolute_import, division, print_function, unicode_literals, \ with_statement import logging import copy import json from solrdataimport.lib.jsonEncoder import JSONEncoder from solrdataimport.dataload.cassdata import CassandraData from solrdataimport.dataload.cassdatab...
pisceanfoot/solrdataimport
solrdataimport/dataload/fetch.py
fetch.py
py
4,415
python
en
code
1
github-code
21
[ { "api_name": "logging.getLogger", "line_number": 12, "usage_type": "call" }, { "api_name": "solrdataimport.dataload.cassdata.CassandraData.initCass", "line_number": 20, "usage_type": "call" }, { "api_name": "solrdataimport.dataload.cassdata.CassandraData", "line_number": 20,...
26623481840
import itertools import numpy as np import scipy.linalg from common import * class predictIMU: def __init__(self, prior_pose_conv, sensor_noise_conv): if prior_pose_conv is None: prior_pose_conv=1e-3 *np.eye(6) self.T=np.eye(4) self.sensor_noise_conv=sensor_nois...
jameswoods0815/kalmanSLAM
predict.py
predict.py
py
675
python
en
code
0
github-code
21
[ { "api_name": "numpy.eye", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.eye", "line_number": 13, "usage_type": "call" }, { "api_name": "scipy.linalg.linalg.expm", "line_number": 18, "usage_type": "call" }, { "api_name": "scipy.linalg.linalg", ...
73888391092
from typing import List class Solution: def asteroidCollision(self, asteroids: List[int]) -> List[int]: # stack # when it will collide: asteroids[i] > 0 > asteroids[i+1] res = [] for new in asteroids: while res and res[-1] > 0 > new: if res[-1] == -new: #...
xiaofanc/leetcode
0735-Asteroid-Collision.py
0735-Asteroid-Collision.py
py
1,455
python
en
code
0
github-code
21
[ { "api_name": "typing.List", "line_number": 4, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 25, "usage_type": "name" } ]
40168116047
import rawpy as rp import numpy as np import cv2 import matplotlib.pyplot as plt import Camera2XYZ as cam2xyz import Reflectance2XYZ as ref2xyz #import exiftool import glob import shutil import os import json import colour def test_color(path_im, color_name, ppg_data, wb_roi, patch_roi, path_jpeg = None): #Full DN...
tuanbi97/Color
DNGvsJPG.py
DNGvsJPG.py
py
6,542
python
en
code
0
github-code
21
[ { "api_name": "rawpy.imread", "line_number": 21, "usage_type": "call" }, { "api_name": "numpy.shape", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 27, "usage_type": "call" }, { "api_name": "numpy.array", "line_number":...
28676995477
from collections import defaultdict from rest_framework.views import APIView from core.models import Country from apis.serializers import CountrySerializer from rest_framework.response import Response from operator import itemgetter class CountryScoreYearByApiView(APIView): serializer_class = CountrySerializer ...
NazimBudaqov/searchart
app/apis/views/CountryScoreYearByApiView.py
CountryScoreYearByApiView.py
py
2,749
python
en
code
0
github-code
21
[ { "api_name": "rest_framework.views.APIView", "line_number": 9, "usage_type": "name" }, { "api_name": "apis.serializers.CountrySerializer", "line_number": 10, "usage_type": "name" }, { "api_name": "core.models.Country.objects.filter", "line_number": 16, "usage_type": "cal...
38559783962
from datetime import datetime from time import strftime from statistics import mean import numpy as np import pandas as pd import csv import os.path #loading global variables question_number = 1 appname = "MH Tracker" now = datetime.now() date = now.strftime("%Y-%m-%d") time = now.strftime("%H:%M:%S") star...
takashidoyama/PHQ-9-donchan91-project
phq9_original.py
phq9_original.py
py
8,015
python
en
code
0
github-code
21
[ { "api_name": "datetime.datetime.now", "line_number": 11, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 11, "usage_type": "name" }, { "api_name": "os.path.path.isfile", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path.p...
40049914843
import os import sys import re import logging from odoo import api, SUPERUSER_ID from odoo.exceptions import UserError _logger = logging.getLogger(__name__) def check_4_depending(cr): """check_4_depending v2.0.11 This function check for valid modules which current module depends on. Usually Odoo checks ...
zeroincombenze/tools
z0bug_odoo/testenv/_check4deps_.py
_check4deps_.py
py
9,919
python
en
code
3
github-code
21
[ { "api_name": "logging.getLogger", "line_number": 9, "usage_type": "call" }, { "api_name": "re.search", "line_number": 75, "usage_type": "call" }, { "api_name": "re.search", "line_number": 76, "usage_type": "call" }, { "api_name": "sys.version_info", "line_num...
10673333972
import numpy as np from bokeh.plotting import figure, show, output_file from sklearn import datasets from sklearn.cluster import KMeans np.random.seed(3) # get the dataset iris = datasets.load_iris() X = iris.data Y = iris.target # fit K-means clustering est = KMeans(n_clusters=3).fit(X) # create scatterplot with ...
vincentclaes/datascience
projects/k_means_clustering/k_means_clustering.py
k_means_clustering.py
py
724
python
en
code
0
github-code
21
[ { "api_name": "numpy.random.seed", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 6, "usage_type": "attribute" }, { "api_name": "sklearn.datasets.load_iris", "line_number": 9, "usage_type": "call" }, { "api_name": "sklearn.d...
6349629636
""" System commands These are the default commands called by the system commandhandler when various exceptions occur. If one of these commands are not implemented and part of the current cmdset, the engine falls back to a default solution instead. Some system commands are shown in this module as a REFERENCE only (the...
whitehorse-io/encarnia
evennia/evennia/commands/default/syscommands.py
syscommands.py
py
5,531
python
en
code
9
github-code
21
[ { "api_name": "evennia.utils.utils.class_from_module", "line_number": 33, "usage_type": "call" }, { "api_name": "evennia.utils.utils", "line_number": 33, "usage_type": "name" }, { "api_name": "django.conf.settings.COMMAND_DEFAULT_CLASS", "line_number": 33, "usage_type": "...
31900796393
from datetime import datetime import pytz import re from flask import Flask, request """ Timezones: AEST - Australia Eastern Standard Time ACST - Australia Central Standard Time AKST - Alaska Standard Time AST - Atlantic Standard Time AWST - Australia Western Standard Time CET - Central European Time CST - Central Sta...
nottak1/TwitchTimeZoneAPI
timezone.py
timezone.py
py
4,452
python
en
code
0
github-code
21
[ { "api_name": "pytz.timezone", "line_number": 45, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 46, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 46, "usage_type": "name" }, { "api_name": "re.findall", ...
24093808532
from googlesearch import search from urllib.parse import urlparse import requests from bs4 import BeautifulSoup from transformers import GPT2Tokenizer import logging def google_search(query): url_list = [] for url in search(str(query), stop=3): print("Google search: " + str(url)) url_list.appe...
zack-seiler/MEMPHIS_AI_DISCORD_CHAT
websearch.py
websearch.py
py
5,378
python
en
code
0
github-code
21
[ { "api_name": "googlesearch.search", "line_number": 11, "usage_type": "call" }, { "api_name": "urllib.parse.urlparse", "line_number": 37, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 60, "usage_type": "call" }, { "api_name": "bs4.BeautifulS...
11763816931
#!/usr/bin/env python import tkinter root = tkinter.Tk() dpi = root.winfo_fpixels('1i') root.destroy() from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, FigureCanvasAgg from matplotlib.figure import Figure import numpy as np from numpy.fft import fftshift, fftfreq import PySimpleGUI as sg from rtlsdr ...
aaronzlim/rtlsdr-speca
rtlsdr_speca/__main__.py
__main__.py
py
2,010
python
en
code
4
github-code
21
[ { "api_name": "tkinter.Tk", "line_number": 4, "usage_type": "call" }, { "api_name": "matplotlib.figure.Figure", "line_number": 22, "usage_type": "call" }, { "api_name": "rtlsdr_speca.layout.canvas_size", "line_number": 23, "usage_type": "attribute" }, { "api_name"...
20601058731
#!/usr/bin/env python # -*- coding: utf-8 -*- import json CONFIG_FILENAME = './../config.json' COMMITS_JSON_FILENAME = 'commits.json' CONFIG_DATA = json.load(open(CONFIG_FILENAME)) ERROR_LOG_FILENAME = 'log/error_log' LOG_FILENAME = 'log/log' TRACEBACK_LIMIT = 10 API_TOKEN = CONFIG_DATA['API_TOKEN'] Channel = CONFIG...
yassu/github-viewer.slack
github_viewer_slack/slackbot_settings.py
slackbot_settings.py
py
418
python
en
code
3
github-code
21
[ { "api_name": "json.load", "line_number": 8, "usage_type": "call" } ]
5600744484
#!/usr/bin/env python3 import logging from time import sleep from ev3dev2.motor import LargeMotor, OUTPUT_B, OUTPUT_C, MoveDifferential from ev3dev2.wheel import EV3EducationSetTire WHEEL_DISTANCE_MM = 118 MOTOR_SPEED_PERCENT = 25 MOTOR_SPEED_PERCENT_WHEN_TURNING = 15 move_differential = MoveDifferential( left_...
Alejandro-M-Cruz/robot-sra
square/main.py
main.py
py
1,956
python
en
code
0
github-code
21
[ { "api_name": "ev3dev2.motor.MoveDifferential", "line_number": 13, "usage_type": "call" }, { "api_name": "ev3dev2.motor.OUTPUT_B", "line_number": 14, "usage_type": "name" }, { "api_name": "ev3dev2.motor.OUTPUT_C", "line_number": 15, "usage_type": "name" }, { "api_...
860566361
from fastapi import FastAPI, Depends, Request, Form, status from pydantic import BaseModel from starlette.responses import RedirectResponse from starlette.templating import Jinja2Templates from joblib import load from pydantic import BaseModel from sqlalchemy.orm import Session import models import pandas as pd from da...
jacespedes2019/Proyecto1Etapa2BI
app.py
app.py
py
4,529
python
en
code
0
github-code
21
[ { "api_name": "models.Base.metadata.create_all", "line_number": 14, "usage_type": "call" }, { "api_name": "models.Base", "line_number": 14, "usage_type": "attribute" }, { "api_name": "database.engine", "line_number": 14, "usage_type": "name" }, { "api_name": "star...
18928053583
import json import smtplib from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText import yaml import pandas as pd import requests from tabulate import tabulate import os.path from os import path vendor_col_name = "vendor" state_col_name = "state" appts_available_col_name = "appointment_ava...
dsinghvi/covid-vaccine-appts
main.py
main.py
py
6,844
python
en
code
0
github-code
21
[ { "api_name": "requests.get", "line_number": 35, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 36, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 40, "usage_type": "call" }, { "api_name": "json.loads", "line_number": ...
34957214738
import cv2 img1 = cv2.imread('model.jpg') e1 = cv2.getTickCount() for i in range(5, 49, 2): img2 = cv2.medianBlur(img1, i) e2 = cv2.getTickCount() t = (e2 - e1) / cv2.getTickFrequency() cv2.imshow('Original', img1) cv2.imshow('Blur', img2) cv2.waitKey(0) cv2.destroyAllWindows() print(t) # 결과: 2.55644031015614...
jacegem/OpenCV-Python-Tutorials
09. 성능 측정 및 개선 기법/01 OpenCV로 성능 측정.py
01 OpenCV로 성능 측정.py
py
326
python
en
code
3
github-code
21
[ { "api_name": "cv2.imread", "line_number": 3, "usage_type": "call" }, { "api_name": "cv2.getTickCount", "line_number": 5, "usage_type": "call" }, { "api_name": "cv2.medianBlur", "line_number": 7, "usage_type": "call" }, { "api_name": "cv2.getTickCount", "line_...
30595616635
import pygame from checkers.constants import Width, Height, cell_size , black , grey from checkers.gamealgo import Game FPS = 60 screen = pygame.display.set_mode((Width, Height)) pygame.display.set_caption("Checkers Tutorial") def get_row_col_frommouse(pos): x , y = pos row = y // cell_size col = x // ce...
haidermahin/projects
checkers/checkers/main.py
main.py
py
860
python
en
code
0
github-code
21
[ { "api_name": "pygame.display.set_mode", "line_number": 6, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 6, "usage_type": "attribute" }, { "api_name": "checkers.constants.Width", "line_number": 6, "usage_type": "name" }, { "api_name": "che...
1118921954
from bs4 import BeautifulSoup soup = BeautifulSoup(open('result.html'),"html.parser") titleArr = soup.select('.u') #标题 headerTitle = titleArr[0].get_text() formatText = headerTitle + '\n' #新闻 newsStr = "" newsElement = soup.select('.news-wrap > .line') for div in newsElement: news = div.get_text() + '\n' newsStr +=...
WangGuibin/weather-action
getInfo.py
getInfo.py
py
989
python
en
code
18
github-code
21
[ { "api_name": "bs4.BeautifulSoup", "line_number": 3, "usage_type": "call" } ]
38358528832
from random import randint import properties import pytest from six import string_types from lfview.resources import scene from .test_scene import random_scene, random_float_generator def test_base_types(): assert scene.Slide.BASE_TYPE == 'slides' assert scene.Feedback.BASE_TYPE == 'feedback' def test_sc...
seequent/lfview-resources-scene
tests/test_slide.py
test_slide.py
py
2,898
python
en
code
0
github-code
21
[ { "api_name": "lfview.resources.scene.Slide", "line_number": 13, "usage_type": "attribute" }, { "api_name": "lfview.resources.scene", "line_number": 13, "usage_type": "name" }, { "api_name": "lfview.resources.scene.Feedback", "line_number": 14, "usage_type": "attribute" ...
32684339676
######################################################################## # File name: types.py # This file is part of: aioxmpp # # LICENSE # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as # published by the Free Software Foundation...
horazont/aioxmpp
aioxmpp/xso/types.py
types.py
py
39,497
python
en
code
215
github-code
21
[ { "api_name": "abc.ABCMeta", "line_number": 89, "usage_type": "attribute" }, { "api_name": "abc.abstractmethod", "line_number": 136, "usage_type": "attribute" }, { "api_name": "abc.ABCMeta", "line_number": 158, "usage_type": "attribute" }, { "api_name": "abc.abstr...
24519500953
from BCCommunicator import BCCommunicator from FSCommunicator import FSCommunicator from Model import Model import torch import os from Requester import Requester from Worker import Worker from dotenv import load_dotenv from FSCommunicator import FSCommunicator import ipfshttpclient # Main class to simulate the distr...
bayesianinstitute/FLBLC_2
client/Application.py
Application.py
py
4,448
python
en
code
0
github-code
21
[ { "api_name": "ipfshttpclient.connect", "line_number": 17, "usage_type": "call" }, { "api_name": "torch.device", "line_number": 21, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", "line_number": 22, "usage_type": "call" }, { "api_name": "torch.cud...
1311423726
from __future__ import print_function import argparse import cv2 from depth_models import DepthNet import numpy as np import torch from torch.autograd import Variable from torch import nn from torch.utils.data import DataLoader from slam_data import SlamDataset parser = argparse.ArgumentParser() parser.add_argument(...
tgale96/deepslam
depth_infer.py
depth_infer.py
py
1,838
python
en
code
0
github-code
21
[ { "api_name": "argparse.ArgumentParser", "line_number": 13, "usage_type": "call" }, { "api_name": "torch.utils.data.DataLoader", "line_number": 24, "usage_type": "call" }, { "api_name": "slam_data.SlamDataset", "line_number": 24, "usage_type": "call" }, { "api_nam...
10682453072
""" This module defines data-transfer objects used by providers. """ from dataclasses import dataclass from datetime import datetime import enum import io import json import re from typing import Any, Mapping, Optional, Sequence, Tuple import yaml import requests @dataclass(frozen = True) class Capabilities: ""...
cedadev/jasmin-azimuth
azimuth/provider/dto.py
dto.py
py
11,042
python
en
code
0
github-code
21
[ { "api_name": "dataclasses.dataclass", "line_number": 17, "usage_type": "call" }, { "api_name": "dataclasses.dataclass", "line_number": 28, "usage_type": "call" }, { "api_name": "typing.Optional", "line_number": 47, "usage_type": "name" }, { "api_name": "dataclass...
45226150031
# -*- coding: utf-8 -*- """ Created on Tue Mar 29 15:33:58 2016 @author: Shen """ import urllib2 #import cookielib import re import json #url = 'http://i.sso.sina.com.cn/js/ssologin.js' #def get_loginjs(url): # cookie = cookielib.CookieJar() # opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cookie)) ...
Syhen/Weibo
PythonFiles/GetLogInInfo.py
GetLogInInfo.py
py
1,363
python
en
code
0
github-code
21
[ { "api_name": "urllib2.urlopen", "line_number": 38, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 39, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 41, "usage_type": "call" } ]
33159549780
# adarsha sachan # i have build my own algorithm that will tell me flower name # and its with dataset set analysis import pandas as pd import matplotlib.pyplot as graph # Write a true condition while True: try: # input condition for sepallength sepallength=float( input ("Please Enter the sepallength ")) ...
G00364769/Project-2018
myproject.py
myproject.py
py
9,020
python
en
code
0
github-code
21
[ { "api_name": "pandas.read_table", "line_number": 86, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.show", "line_number": 100, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 100, "usage_type": "name" }, { "api_name": "matplotl...
74029035891
from flask import redirect, url_for, flash from flask_admin import BaseView, expose, AdminIndexView from flask_login import current_user from flask_admin.contrib.sqla import ModelView from flask_admin.contrib.fileadmin import FileAdmin from .forms import check_letters, check_digits, check_symbols, check_spaces from wtf...
dima-yurchuk/blog_technological_innovations
app/user/custom_admin.py
custom_admin.py
py
11,724
python
uk
code
0
github-code
21
[ { "api_name": "flask_admin.AdminIndexView", "line_number": 14, "usage_type": "name" }, { "api_name": "flask_login.current_user.is_authenticated", "line_number": 17, "usage_type": "attribute" }, { "api_name": "flask_login.current_user", "line_number": 17, "usage_type": "na...
73233044531
from datetime import date, datetime from datetime import timedelta import logging import requests # Many thanks to https://github.com/bachya/aiorecollect for the key info needed # to decipher the Recollect API. # API_URL_SCAFFOLD = "https://api.recollect.net/api/places/{0}/services/{1}/events" def get_schedule(plac...
tay-bird/nest-display
lib/garbage_fetcher.py
garbage_fetcher.py
py
1,731
python
en
code
0
github-code
21
[ { "api_name": "datetime.date.today", "line_number": 14, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 14, "usage_type": "name" }, { "api_name": "datetime.timedelta", "line_number": 15, "usage_type": "call" }, { "api_name": "requests.get", ...
6761068000
"""This module contains implementation of scheduler. """ import gevent import gevent.coros import config.collector as config import time from gevent.pool import Pool from gevent.queue import PriorityQueue, Queue def _get_int_time(t_stamp=None): """Helper function. Return an integer value of `t_stamp`. In ca...
alexsv/Pyxis
collector/Scheduler.py
Scheduler.py
py
4,128
python
en
code
null
github-code
21
[ { "api_name": "time.time", "line_number": 18, "usage_type": "call" }, { "api_name": "gevent.queue.PriorityQueue", "line_number": 41, "usage_type": "call" }, { "api_name": "gevent.queue.Queue", "line_number": 42, "usage_type": "call" }, { "api_name": "gevent.pool.P...
33863608773
import logging import pandas as pd from temporal_granularity.src.metrics.multi_metrics import MultiMetrics from temporal_granularity.src.metrics.single_metrics import SingleMetrics logger = logging.getLogger(__name__) class Metrics: def __init__(self, original_solar, representative_solar, original_wind, repre...
alexanderkell/temporal_granularity
src/metrics/metrics.py
metrics.py
py
5,331
python
en
code
0
github-code
21
[ { "api_name": "logging.getLogger", "line_number": 8, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 74, "usage_type": "call" }, { "api_name": "temporal_granularity.src.metrics.single_metrics.SingleMetrics", "line_number": 84, "usage_type": "call"...
35707579560
from absl import app, flags, logging FLAGS = flags.FLAGS def looksay(input: str, repeat: int = 1) -> str: output = [] previous_c = None previous_count = 0 for c in input: if previous_c is None: previous_c = c previous_count = 1 continue if previous_...
steventhurgood/adventofcode
2015/10/looksay.py
looksay.py
py
831
python
en
code
0
github-code
21
[ { "api_name": "absl.flags.FLAGS", "line_number": 3, "usage_type": "attribute" }, { "api_name": "absl.flags", "line_number": 3, "usage_type": "name" }, { "api_name": "absl.app.run", "line_number": 37, "usage_type": "call" }, { "api_name": "absl.app", "line_numb...
30352472743
import usaddress from scourgify import normalize_address_record from uszipcode import SearchEngine, SimpleZipcode search: SearchEngine = SearchEngine() def get_zip(city: str, state: str) -> str: zipcodes: [SimpleZipcode] = search.by_city_and_state(city, state) if len(zipcodes) >= 1: return zipcodes[0]...
roshangiyanani/pt_location_scraper
ptls/address.py
address.py
py
2,304
python
en
code
0
github-code
21
[ { "api_name": "uszipcode.SearchEngine", "line_number": 5, "usage_type": "name" }, { "api_name": "uszipcode.SimpleZipcode", "line_number": 8, "usage_type": "name" }, { "api_name": "scourgify.normalize_address_record", "line_number": 49, "usage_type": "call" }, { "a...
33286509717
import execjs import requests from lxml import etree session = requests.session() url = 'https://www.python-spider.com/challenge/34' headers = { 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9', 'Accept-Language...
17346607460/DyItemSpider
web/web34/web34.py
web34.py
py
1,906
python
en
code
3
github-code
21
[ { "api_name": "requests.session", "line_number": 5, "usage_type": "call" }, { "api_name": "execjs.compile", "line_number": 33, "usage_type": "call" }, { "api_name": "lxml.etree.HTML", "line_number": 37, "usage_type": "call" }, { "api_name": "lxml.etree", "line...
12413279862
import pdfminer import cv2 import os import numpy as np from pdfminer.pdfparser import PDFParser from pdfminer.pdfdocument import PDFDocument from pdfminer.pdfpage import PDFPage from pdfminer.pdfpage import PDFTextExtractionNotAllowed from pdfminer.pdfinterp import PDFResourceManager from pdfminer.pdfinterp import PDF...
sonnhfit/pdfextract
pdfex.py
pdfex.py
py
3,841
python
en
code
0
github-code
21
[ { "api_name": "pdf2image.convert_from_path", "line_number": 23, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 25, "usage_type": "attribute" }, { "api_name": "pdfminer.layout", "line_number": 35, "usage_type": "attribute" }, { "api_name": "pdf...
23495122137
#!/usr/bin/env python # ================== EDIT Cofflinks/gffread GFF3 file for EVM compatibility ================= # Script to make the GFF3 output of Cofflinks + gffread compatible with # EVidenceModeler by appending the missing ID to the exons. The header can be # turn off. It's largely based on the script SNAPgff2...
johannessonlab/SpokBlockPaper
Annotation/scripts/gffread2EVM.py
gffread2EVM.py
py
4,577
python
en
code
2
github-code
21
[ { "api_name": "argparse.ArgumentParser", "line_number": 31, "usage_type": "call" }, { "api_name": "re.split", "line_number": 72, "usage_type": "call" }, { "api_name": "datetime.date.today", "line_number": 78, "usage_type": "call" }, { "api_name": "datetime.date", ...
73025920053
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import os from gi.repository import GLib from gi.repository import Gtk from gi.repository import Vte from guake.dbus_manager import createDbusRemote from guake.dconf_ha...
LiuFang816/SALSTM_py_data
python/Guake_guake/guake-master/src-gtk3/guake/gtk3test.py
gtk3test.py
py
1,395
python
en
code
9
github-code
21
[ { "api_name": "gi.repository.Gtk.Window", "line_number": 17, "usage_type": "attribute" }, { "api_name": "gi.repository.Gtk", "line_number": 17, "usage_type": "name" }, { "api_name": "gi.repository.Gtk.Window.__init__", "line_number": 20, "usage_type": "call" }, { ...
70096735093
from utils import create_dir from matplotlib import pyplot as plt import numpy as np from os import path as op import logging def extract_cbl(func_file, confound_file, masker, rdo_dir): """ :param func_file: :param confound_file: :param masker: :return: """ logging.debug("Extracting cereb...
spolex/pyrestfmri
fmriapi.py
fmriapi.py
py
1,051
python
en
code
0
github-code
21
[ { "api_name": "logging.debug", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path", "line_number": 19, "usage_type": "name" }, { "api_name": "utils.create_dir", "line_num...
2670161732
import cv2 import numpy as np import os dir = os.path.dirname(__file__) foldername = os.path.join(dir, 'Images') os.chdir(foldername) img = cv2.imread('basic mask.jpg') gray = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY) edges = cv2.Canny(gray,15,150,apertureSize = 3) print (edges) lines = cv2.HoughLines(edges,1,np.pi/180,20...
aditiawas/Defencing-Inpainting
Extra trials/houghline.py
houghline.py
py
644
python
en
code
1
github-code
21
[ { "api_name": "os.path.dirname", "line_number": 5, "usage_type": "call" }, { "api_name": "os.path", "line_number": 5, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 6, "usage_type": "call" }, { "api_name": "os.path", "line_number": 6...
39903411974
import os import random from typing import Any, Dict from . import tilemap_nx as tmnx MATRIX_CACHE = "_temp_matrix.pickle" LOOKUP_CACHE = "_temp_lookup.pickle" def delete_cached(csv_path): paths = get_cache_paths(csv_path) for path in paths: if os.path.exists(path): os.remove(path) ...
fladdimir/casymda
src/casymda/blocks/tilemap/coordinates_holder.py
coordinates_holder.py
py
2,640
python
en
code
39
github-code
21
[ { "api_name": "os.path.exists", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path", "line_number": 14, "usage_type": "attribute" }, { "api_name": "os.remove", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_num...
27564301189
import logging import argparse import requests from rich.tree import Tree from datetime import datetime from rich import print as xprint class RedditPostScraper: def __init__(self, args): self.session = requests.session() self.session.headers = {'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS ...
MaggieWong27/reddit-post-scraping-tool-2022
reddit-post-scraping-tool.py
reddit-post-scraping-tool.py
py
4,100
python
en
code
null
github-code
21
[ { "api_name": "requests.session", "line_number": 11, "usage_type": "call" }, { "api_name": "logging.info", "line_number": 22, "usage_type": "call" }, { "api_name": "rich.tree.Tree", "line_number": 49, "usage_type": "call" }, { "api_name": "rich.print", "line_n...
12859233272
import os from pathlib import Path import torch from torch.distributed import init_process_group from dp.model.model import load_checkpoint, ModelType, \ create_model from dp.preprocessing.text import Preprocessor from dp.training.trainer import Trainer from dp.utils.io import read_config from dp.utils.logging im...
as-ideas/DeepPhonemizer
dp/train.py
train.py
py
2,966
python
en
code
290
github-code
21
[ { "api_name": "dp.utils.logging.get_logger", "line_number": 14, "usage_type": "call" }, { "api_name": "dp.utils.io.read_config", "line_number": 35, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 38, "usage_type": "attribute" }, { "api_name": "o...
42644148153
from django.shortcuts import redirect, render from album.forms import AlbumForm __all__ = ( 'album_add', ) def album_add(request): if request.method == 'POST': form = AlbumForm(request.POST, request.FILES) print('검문소1') if form.is_valid(): form.save() print('검...
smallbee3/Melon
django/album/views/album/add.py
add.py
py
535
python
en
code
0
github-code
21
[ { "api_name": "album.forms.AlbumForm", "line_number": 12, "usage_type": "call" }, { "api_name": "django.shortcuts.redirect", "line_number": 17, "usage_type": "call" }, { "api_name": "album.forms.AlbumForm", "line_number": 19, "usage_type": "call" }, { "api_name": ...
18830142968
import time import json from datetime import datetime, timezone from pathlib import Path from typing import Callable, Union from watchdog.observers import Observer from watchdog.events import FileSystemEventHandler from structures.events import EliteEvent, ScanEvent from structures.exploration.bodies import System, Pl...
CaptainD1/PyDangerous
src/PyDangerous/pydangerous.py
pydangerous.py
py
4,672
python
en
code
1
github-code
21
[ { "api_name": "structures.events.ScanEvent", "line_number": 12, "usage_type": "name" }, { "api_name": "structures.exploration.bodies.Planet", "line_number": 13, "usage_type": "name" }, { "api_name": "structures.exploration.bodies.Planet", "line_number": 14, "usage_type": ...
21335495985
import time, os from PIL import Image, ImageEnhance class blog(object): def __init__(self, imgsrc, ocr): self.imgsrc = imgsrc self.ocr = ocr self.date = time.strftime("%Y%m%d", time.localtime()) # 图片剪裁 def cutImg(self, coordinate, imagPath): """ 根据坐标位置剪切图片 ...
Danielpan9075/paddleOCR
blog.py
blog.py
py
4,241
python
en
code
2
github-code
21
[ { "api_name": "time.strftime", "line_number": 9, "usage_type": "call" }, { "api_name": "time.localtime", "line_number": 9, "usage_type": "call" }, { "api_name": "PIL.Image.open", "line_number": 20, "usage_type": "call" }, { "api_name": "PIL.Image", "line_numbe...
4118847699
#!/usr/bin/env python from mpi4py import MPI import numpy as np import h5py import time from icecube_tools.point_source_likelihood.energy_likelihood import ( MarginalisedEnergyLikelihoodFromSim, MarginalisedEnergyLikelihoodFixed, ) from icecube_tools.detector.angular_resolution import AngularResolution from i...
cescalara/nu_pop
1_detection_probability/scripts/TS_dist_bg.py
TS_dist_bg.py
py
5,732
python
en
code
3
github-code
21
[ { "api_name": "warnings.filterwarnings", "line_number": 26, "usage_type": "call" }, { "api_name": "mpi4py.MPI.COMM_WORLD", "line_number": 37, "usage_type": "attribute" }, { "api_name": "mpi4py.MPI", "line_number": 37, "usage_type": "name" }, { "api_name": "time.ti...
1683292017
import argparse from pathlib import Path from . import etag import sys import humanfriendly import csv def pathlib_exists(str_path: str) -> Path: """ Argparse "type" for a file that must exist """ path = Path(str_path) if not path.exists(): raise argparse.ArgumentTypeError(f'Path {str_path...
multimeric/S3Etag
s3etag/main.py
main.py
py
3,441
python
en
code
0
github-code
21
[ { "api_name": "pathlib.Path", "line_number": 13, "usage_type": "call" }, { "api_name": "argparse.ArgumentTypeError", "line_number": 15, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 9, "usage_type": "name" }, { "api_name": "humanfriendly.par...
30352475433
import argparse from pathlib import Path from typing import Set from ptls.scrapers import SCRAPERS, Athletico, ATI, CORA, Pivot, Professional, Select, URPT, USPh parser = argparse.ArgumentParser() parser.add_argument('-l', '--location', action='store', help='directory to store the files in (defaults to ./data/)') pars...
roshangiyanani/pt_location_scraper
ptls/args.py
args.py
py
2,152
python
en
code
0
github-code
21
[ { "api_name": "argparse.ArgumentParser", "line_number": 6, "usage_type": "call" }, { "api_name": "ptls.scrapers.SCRAPERS", "line_number": 12, "usage_type": "name" }, { "api_name": "pathlib.Path", "line_number": 22, "usage_type": "name" }, { "api_name": "ptls.scrap...
40099682362
#! /usr/bin/env python from scapy.all import * import copy import random from netaddr.ip import IPNetwork, IPAddress ip_a = IPAddress('2001::cafe:0') + random.getrandbits(16) a = rdpcap("mp.pcap") t = a[16][TCPOption_Timestamp].timestamp_value b = [] for i in range(0, 10000): b.append(copy.deepcopy(a[16])) ...
bbaugnies/DPI-MPTCP
Captures/flood.py
flood.py
py
513
python
en
code
1
github-code
21
[ { "api_name": "netaddr.ip.IPAddress", "line_number": 11, "usage_type": "call" }, { "api_name": "random.getrandbits", "line_number": 11, "usage_type": "call" }, { "api_name": "copy.deepcopy", "line_number": 22, "usage_type": "call" }, { "api_name": "netaddr.ip.IPAd...
18627814616
from django.shortcuts import render from .models import Kurumsal # Create your views here. def institutionalPage(request): kurumsal = Kurumsal.objects.all().last() data = { 'kurumsal' : kurumsal } return render(request ,'kurumsal.html' , data)
muratyl2k4/temmuzfederasyon
kurumsal/views.py
views.py
py
269
python
en
code
0
github-code
21
[ { "api_name": "models.Kurumsal.objects.all", "line_number": 6, "usage_type": "call" }, { "api_name": "models.Kurumsal.objects", "line_number": 6, "usage_type": "attribute" }, { "api_name": "models.Kurumsal", "line_number": 6, "usage_type": "name" }, { "api_name": ...
36047278061
import matplotlib import numpy as np from matplotlib import pyplot as plt import pickle as pk def plot(): with open(f'evaluation_selfplay', 'rb') as file: eval = pk.load(file) eval = np.array(eval) eval = eval[:100] matplotlib.rcParams['figure.dpi'] = 300 plt.plot(np.arange(1, 101), eval[:...
zia-badar/Connect4GameAgent
plots/plot.py
plot.py
py
1,469
python
en
code
1
github-code
21
[ { "api_name": "pickle.load", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 10, "usage_type": "call" }, { "api_name": "matplotlib.rcParams", "line_number": 12, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot.plo...
36612600565
from turtle import width import cv2 import matplotlib.pyplot as plt import torch import torch.nn as nn import torch.nn.functional as F import numpy as np import imutils from torchvision import transforms from os import makedirs from xlwt import Workbook from torch.utils.data import DataLoader from PIL import Image from...
Orwell-Yu/ProcessingTimer
ProcessingTimer.py
ProcessingTimer.py
py
22,586
python
en
code
0
github-code
21
[ { "api_name": "torchvision.transforms.Compose", "line_number": 19, "usage_type": "call" }, { "api_name": "torchvision.transforms", "line_number": 19, "usage_type": "name" }, { "api_name": "torchvision.transforms.ToTensor", "line_number": 20, "usage_type": "call" }, { ...
15855298865
from enum import Flag from bs4 import BeautifulSoup from requests_html import HTMLSession from urllib.parse import urlparse class Crawler: def __init__(self, url, auth_url, user, password): self.url = url self.auth_url = auth_url self.user = user self.password = password se...
mckilllermonster/DevoirPython
crawler.py
crawler.py
py
7,383
python
fr
code
0
github-code
21
[ { "api_name": "urllib.parse.urlparse", "line_number": 13, "usage_type": "call" }, { "api_name": "urllib.parse.urlparse", "line_number": 25, "usage_type": "call" }, { "api_name": "requests_html.HTMLSession", "line_number": 27, "usage_type": "call" }, { "api_name": ...
31472341258
import time from functools import wraps from flask import request, jsonify from conf.default import DefaultConfig from general.response import Response from conf.code import THROTTLE_ERROR def throttle(times, seconds=None): """ 限流器,作为装饰器使用 此限流器 多个方法不共享 :param times: 限流单位 秒 配置内的秒内的访问次数 :param seconds:...
pipihhh/fitness
utils/throttle.py
throttle.py
py
2,255
python
en
code
2
github-code
21
[ { "api_name": "conf.default.DefaultConfig.THROTTLE_SECONDS", "line_number": 20, "usage_type": "attribute" }, { "api_name": "conf.default.DefaultConfig", "line_number": 20, "usage_type": "name" }, { "api_name": "general.response.Response", "line_number": 25, "usage_type": ...
8999597237
from collections import deque def dfs(v): value[v] = True print(v, end=' ') for i in range(1, n+1): if arr[v][i] == 1 and value[i]== False: dfs(i) def bfs(v): q = deque([v]) value[v] = True while q: now = q.popleft() print(now, end=' ') ...
msj9965/Baekjoon-Algorithm-Java-group-study
백준/Silver/1260. DFS와 BFS/DFS와 BFS.py
DFS와 BFS.py
py
721
python
en
code
1
github-code
21
[ { "api_name": "collections.deque", "line_number": 12, "usage_type": "call" } ]
39056255656
#!/usr/bin/env python # coding: utf-8 # In[20]: import pandas as pd from glob import glob import matplotlib.pyplot as plt from matplotlib.patches import Ellipse from sklearn.mixture import GaussianMixture import numpy as np import json # In[21]: class NpEncoder(json.JSONEncoder): def default(self, obj): ...
aminHZDEV/Final_project
Cluster/cluster.py
cluster.py
py
12,248
python
en
code
0
github-code
21
[ { "api_name": "json.JSONEncoder", "line_number": 19, "usage_type": "attribute" }, { "api_name": "numpy.integer", "line_number": 21, "usage_type": "attribute" }, { "api_name": "numpy.floating", "line_number": 23, "usage_type": "attribute" }, { "api_name": "numpy.nd...
14909403407
import json def load_data(): try: with open("data.json", "r", encoding="utf-8") as file: data = json.load(file) return data except FileNotFoundError: print("Не найден файл!") return {} except json.JSONDecodeError: print("Что-то не правильно в файле!") ...
dly25/data-different-py
main.py
main.py
py
3,840
python
ru
code
0
github-code
21
[ { "api_name": "json.load", "line_number": 5, "usage_type": "call" }, { "api_name": "json.JSONDecodeError", "line_number": 10, "usage_type": "attribute" }, { "api_name": "json.dumps", "line_number": 16, "usage_type": "call" } ]
27957555062
import pytest import numpy as np import pennylane as qml from pennylane_lightning_gpu import LightningGPU try: from pennylane_lightning_gpu.lightning_gpu import CPP_BINARY_AVAILABLE if not CPP_BINARY_AVAILABLE: raise ImportError("PennyLane-Lightning-GPU is unsupported on this platform") except (Impo...
PennyLaneAI/pennylane-lightning-gpu
tests/test_hamiltonian_sparse.py
test_hamiltonian_sparse.py
py
3,745
python
en
code
45
github-code
21
[ { "api_name": "pennylane_lightning_gpu.lightning_gpu.CPP_BINARY_AVAILABLE", "line_number": 11, "usage_type": "name" }, { "api_name": "pytest.skip", "line_number": 14, "usage_type": "call" }, { "api_name": "pennylane.Identity", "line_number": 23, "usage_type": "call" }, ...
32314881536
import pybullet as p from abc import ABC, abstractmethod import gym import numpy as np from urdfpy import URDF from obstacled_environments.common.sensors.sensor import Sensor from enum import Enum from typing import List class ControlMode(Enum): torque = 'tor' acceleration = 'acc' velocity = 'v...
runyuma/Planning_project
obstacled_environments/common/generic_robot.py
generic_robot.py
py
8,404
python
en
code
2
github-code
21
[ { "api_name": "enum.Enum", "line_number": 10, "usage_type": "name" }, { "api_name": "abc.ABC", "line_number": 15, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 28, "usage_type": "name" }, { "api_name": "obstacled_environments.common.sensors.s...
36240344823
import yaml import argparse import os import sys import time from pathlib import Path import numpy as np import pandas as pd os.environ["CUDA_VISIBLE_DEVICES"]='2' from LMs.LM_model import * OVERWRITE=True def main_run(config_file): start_time = time.time() dataframes_path = config_file["input_dir_folder"]...
Buguemar/GRTC_GNNs
train_language.py
train_language.py
py
2,309
python
en
code
1
github-code
21
[ { "api_name": "os.environ", "line_number": 10, "usage_type": "attribute" }, { "api_name": "time.time", "line_number": 18, "usage_type": "call" }, { "api_name": "time.time", "line_number": 50, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "li...
1757468770
import os import imageio import logging logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(name)s - %(levelname)s - %(message)s') logger = logging.getLogger(__name__) CWD_DIR = os.path.dirname(__file__) def CreateGif(image_list, gif_name, duration=0.2): ''' :param i...
xiaodaxia-2008/PathPlanning
src/GenerateGif.py
GenerateGif.py
py
956
python
en
code
2
github-code
21
[ { "api_name": "logging.basicConfig", "line_number": 4, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 4, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 6, "usage_type": "call" }, { "api_name": "os.path.dirname"...
70873866613
import pandas as pd import numpy as np from scipy.spatial import distance import rpy2.robjects as robjects from rpy2.robjects import pandas2ri import rpy2 import rpy2.robjects.packages as rpackages import rpy2.robjects as ro pandas2ri.activate() import rpy2.robjects.numpy2ri rpy2.robjects.numpy2ri.activate() from rpy2....
YasmineHamdar/UBR-Dockerized
notebooks/extract_rare_per_site.py
extract_rare_per_site.py
py
22,670
python
en
code
1
github-code
21
[ { "api_name": "rpy2.robjects.pandas2ri.activate", "line_number": 9, "usage_type": "call" }, { "api_name": "rpy2.robjects.pandas2ri", "line_number": 9, "usage_type": "name" }, { "api_name": "rpy2.robjects.numpy2ri.activate", "line_number": 11, "usage_type": "call" }, {...
72673961653
import torch.nn as nn import torch import os import numpy as np import torchvision.utils as vutils import math import torch.nn.functional as Funct class down_block(nn.Module): #using the input channels I specify the channels at for repeated use of this block def __init__(self, channels, num_of_convs = 2): ...
crohan009/SweepTheFloor
segnet_model.py
segnet_model.py
py
14,115
python
en
code
0
github-code
21
[ { "api_name": "torch.nn.Module", "line_number": 9, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 9, "usage_type": "name" }, { "api_name": "torch.nn.Conv2d", "line_number": 17, "usage_type": "call" }, { "api_name": "torch.nn", "line_numb...
20582567590
import gym import numpy as np import random import torch from collections import namedtuple from itertools import count # Prioritized Experience Replay # https://arxiv.org/abs/1511.05952 class SumTree: ''' Every node is the sum of its children, with the priorities as the leaf nodes ''' write = 0 def __init__...
shinobu-x/reinforcement-learning
replay_buffer/prioritized_replay_buffer.py
prioritized_replay_buffer.py
py
3,832
python
en
code
0
github-code
21
[ { "api_name": "numpy.zeros", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 18, "usage_type": "call" }, { "api_name": "torch.device", "line_number": 64, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", "l...
74034610294
#!/usr/bin/env python3 import numpy as np import pandas as pd import matplotlib.pyplot as plt from seaborn import violinplot def despine(ax): """ Remove upper and right spines of matplotlib axis object. Input --- ax: Matplotlib axis object Returns --- Despined copy of ax ""...
athms/many-item-choice
src/utils/plotting.py
plotting.py
py
5,026
python
en
code
6
github-code
21
[ { "api_name": "numpy.round", "line_number": 61, "usage_type": "call" }, { "api_name": "numpy.round", "line_number": 86, "usage_type": "call" }, { "api_name": "numpy.round", "line_number": 90, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.gca", "line...
10063411442
import requests from datetime import datetime from lxml import etree import re def get_metar_info(icao): api_url = f"https://www.aviationweather.gov/adds/dataserver_current/httpparam?dataSource=metars&requestType=retrieve&format=xml&stationString={icao}&hoursBeforeNow=2" response = requests.get(api_url) ...
rkzwei/CS50
final-project/prototype.py
prototype.py
py
5,541
python
en
code
0
github-code
21
[ { "api_name": "requests.get", "line_number": 9, "usage_type": "call" }, { "api_name": "lxml.etree.fromstring", "line_number": 15, "usage_type": "call" }, { "api_name": "lxml.etree", "line_number": 15, "usage_type": "name" }, { "api_name": "re.compile", "line_n...
27885498037
from discord.ext import commands from discord.ext.commands import MissingRequiredArgument, CommandNotFound class Manager(commands.Cog): def __init__(self, bot): self.bot = bot @commands.Cog.listener() async def on_ready(self): print('Bot is ready') @commands.Cog.listener() async...
matheusrod21/Duda-Discord-Bot
src/manager.py
manager.py
py
811
python
en
code
0
github-code
21
[ { "api_name": "discord.ext.commands.Cog", "line_number": 5, "usage_type": "attribute" }, { "api_name": "discord.ext.commands", "line_number": 5, "usage_type": "name" }, { "api_name": "discord.ext.commands.Cog.listener", "line_number": 10, "usage_type": "call" }, { ...
9785297811
import seaborn as sns import matplotlib.pyplot as plt import pandas as pd pd.set_option("display.max_columns", None) pd.set_option("display.width", 500) pd.set_option("display.float.format", lambda x: "%.2f" % x) df = sns.load_dataset("taxis") df_copy = df #countploty bool değerleri işlemediği için veri setindeki boo...
busranurok/VeriBilimiUygulamalar
kesifci_deneme.py
kesifci_deneme.py
py
5,372
python
tr
code
1
github-code
21
[ { "api_name": "pandas.set_option", "line_number": 4, "usage_type": "call" }, { "api_name": "pandas.set_option", "line_number": 5, "usage_type": "call" }, { "api_name": "pandas.set_option", "line_number": 6, "usage_type": "call" }, { "api_name": "seaborn.load_datas...
27738992479
from collections import Counter class Solution: def firstUniqChar(self, s: str) -> int: z = Counter(s) index = -1 for i in s: index +=1 if z[i] == 1: return index return -1 s = Solution() assert 0 == s.firstUniqChar("...
chetna-ravat/LeetCode
Level-1/387-First-Unique-Character-in-String.py
387-First-Unique-Character-in-String.py
py
412
python
en
code
0
github-code
21
[ { "api_name": "collections.Counter", "line_number": 5, "usage_type": "call" } ]
33897279423
from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar import attr if TYPE_CHECKING: from ..models.money_type import MoneyType T = TypeVar("T", bound="Item") @attr.s(auto_attribs=True) class Item: r"""An item to be sold. Attributes: asin (str): The Amazon Standard Identification Num...
milyord/sp-api
sp/fba_smalland_light/models/item.py
item.py
py
1,754
python
en
code
1
github-code
21
[ { "api_name": "typing.TYPE_CHECKING", "line_number": 5, "usage_type": "name" }, { "api_name": "typing.TypeVar", "line_number": 9, "usage_type": "call" }, { "api_name": "typing.Dict", "line_number": 23, "usage_type": "name" }, { "api_name": "typing.Any", "line_...
13445080302
from flask import Flask, request, redirect, render_template, flash, session from flask_sqlalchemy import SQLAlchemy app = Flask(__name__) app.config['DEBUG'] = True app.config['SQLALCHEMY_DATABASE_URI'] = 'mysql+pymysql://build-a-blog:blog@localhost:8889/build-a-blog' app.config['SQLALCHEMY_ECHO'] = True db = SQLAlch...
gloriahigley/build-a-blog
main.py
main.py
py
1,919
python
en
code
0
github-code
21
[ { "api_name": "flask.Flask", "line_number": 5, "usage_type": "call" }, { "api_name": "flask_sqlalchemy.SQLAlchemy", "line_number": 9, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 28, "usage_type": "call" }, { "api_name": "flask.req...
15444116227
import logging import typing from uds import models from .. import test, generators, constants from ...fixtures import authenticators as authenticators_fixtures, services as service_fixtures from uds.REST.handlers import AUTH_TOKEN_HEADER NUMBER_OF_ITEMS_TO_CREATE = 4 class WEBTestCase(test.UDSTransactionTestCase...
Future998/openuds
server/src/tests/utils/web/test.py
test.py
py
2,462
python
en
code
null
github-code
21
[ { "api_name": "uds.models.Authenticator", "line_number": 16, "usage_type": "attribute" }, { "api_name": "uds.models", "line_number": 16, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 17, "usage_type": "attribute" }, { "api_name": "uds.models....
72308765813
#Program for mathematical model of a falling object using divided difference method or euler's method #Created by Aashish Loknath Panigrahi import matplotlib.pyplot as plt time_arr=[0] #Will store values of time with initial time =0 s velocity_arr=[0] #Will st...
asxyzp/experiments-in-cs
FallingObjSolarSail/falling_objects.py
falling_objects.py
py
1,008
python
en
code
0
github-code
21
[ { "api_name": "matplotlib.pyplot.plot", "line_number": 17, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 17, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.suptitle", "line_number": 18, "usage_type": "call" }, { "api_name": "m...
6005559807
from pathlib import Path from PySide6.QtCore import QSignalBlocker, Qt, Signal, Slot from PySide6.QtGui import QDoubleValidator from PySide6.QtWidgets import QDialog, QMessageBox from pyminflux.state import State from ..analysis import prepare_histogram from ..utils import intersect_2d_ranges from .ui_wizard import ...
bsse-scf/pyMINFLUX
pyminflux/ui/wizard.py
wizard.py
py
20,412
python
en
code
4
github-code
21
[ { "api_name": "PySide6.QtWidgets.QDialog", "line_number": 14, "usage_type": "name" }, { "api_name": "ui_wizard.Ui_WizardDialog", "line_number": 14, "usage_type": "name" }, { "api_name": "PySide6.QtCore.Signal", "line_number": 15, "usage_type": "call" }, { "api_nam...
9870401257
from datetime import datetime from logging import Logger, getLogger from requests import Session from ..lib import IN, web, zonekey ZONE_KEY = "IN-CT" URL = "http://117.239.199.203/csptcl/GEN.aspx" SOURCE = "cspc.co.in" TIME_FORMAT = "hh:m DD-MM-YY" def fetch_consumption( zone_key: str = ZONE_KEY, session:...
electricitymaps/electricitymaps-contrib
parsers/archived/IN_CT.py
IN_CT.py
py
2,259
python
en
code
3,126
github-code
21
[ { "api_name": "requests.Session", "line_number": 16, "usage_type": "name" }, { "api_name": "datetime.datetime", "line_number": 17, "usage_type": "name" }, { "api_name": "logging.Logger", "line_number": 18, "usage_type": "name" }, { "api_name": "logging.getLogger",...
72515371893
import os from typing import TYPE_CHECKING from PyQt6.QtWidgets import QMainWindow, QFileDialog from PyQt6 import uic from dsa.model import Model from dsa.scenario import Scenario from ui_py.ui_scenario import UIScenario from ui_py.ui_message import UIMessage from utils.logger import logger if TYPE_CHECKING: fro...
DenisTrputec/DynamicStabilityAssessment
ui_py/ui_model.py
ui_model.py
py
3,711
python
en
code
0
github-code
21
[ { "api_name": "typing.TYPE_CHECKING", "line_number": 13, "usage_type": "name" }, { "api_name": "PyQt6.QtWidgets.QMainWindow", "line_number": 17, "usage_type": "name" }, { "api_name": "dsa.model.Model", "line_number": 18, "usage_type": "name" }, { "api_name": "util...
27877234355
""" Implementation of the Body class of the Agent """ import logging from zmqRemoteApi import RemoteAPIClient from typing import Any, List import time import redis import json import random MY_PERC_CH = "PERCEPTIONS" # from the physical body to the virtual body and controller MY_COMM_CH = "COMMANDS" # from ...
eoanodea/robotics-assignment-1
Body.py
Body.py
py
8,077
python
en
code
0
github-code
21
[ { "api_name": "typing.List", "line_number": 22, "usage_type": "name" }, { "api_name": "logging.info", "line_number": 27, "usage_type": "call" }, { "api_name": "logging.info", "line_number": 44, "usage_type": "call" }, { "api_name": "logging.info", "line_number...
12411950833
from typing import Optional, Tuple, Union import pygame from PPlayMaps import Tileset from PPlayMaps.types import Vector, Vec class TileBar: def calc_size( self, position: Vec, screen_size: Vec, screen_tile_size: Vec ) -> Tuple[int, int]: sw, sh = screen_size tx...
jose-nascimento/pplay-editor
modules/tile_bar.py
tile_bar.py
py
6,735
python
en
code
0
github-code
21
[ { "api_name": "PPlayMaps.types.Vec", "line_number": 10, "usage_type": "name" }, { "api_name": "PPlayMaps.types.Vec", "line_number": 11, "usage_type": "name" }, { "api_name": "PPlayMaps.types.Vec", "line_number": 12, "usage_type": "name" }, { "api_name": "PPlayMaps...
15480506632
import numpy as np import pandas as pd from bs4 import BeautifulSoup import cssutils as csu from copy import copy from argparse import ArgumentParser import re import urllib import os, sys #### # parse google doc of guidelines AND editorial policies (html download) and reformat # for OJS site with (nested?) dropdowns ...
tomadragos/seismica-ojs
parse_google_doc.py
parse_google_doc.py
py
19,377
python
en
code
null
github-code
21
[ { "api_name": "re.compile", "line_number": 50, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 60, "usage_type": "call" }, { "api_name": "copy.copy", "line_number": 97, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 113, ...
33105437654
# -*- coding: utf-8 -*- import os import re import json import base64 import hashlib import logging import signal from contextlib import contextmanager from datetime import datetime, timedelta from subprocess import run, STDOUT, PIPE, TimeoutExpired, CompletedProcess from tempfile import NamedTemporaryFile log = loggi...
nuvla/job-engine
code/src/nuvla/connector/utils.py
utils.py
py
3,636
python
en
code
4
github-code
21
[ { "api_name": "logging.getLogger", "line_number": 14, "usage_type": "call" }, { "api_name": "datetime.datetime.fromisoformat", "line_number": 30, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 30, "usage_type": "name" }, { "api_name": "d...
13587895172
import argparse import random import json import numpy as np import torch import monai from copy import deepcopy from lightning.pytorch import Trainer import sys from ..assemble_args import Parser from ...utils import safe_collate, subsample_dataset from ...utils.pl_utils import get_devices from ...monai_transforms i...
CCIG-Champalimaud/adell-mri
lib/entrypoints/classification/test.py
test.py
py
8,974
python
en
code
5
github-code
21
[ { "api_name": "assemble_args.Parser", "line_number": 24, "usage_type": "call" }, { "api_name": "utils.parser.get_params", "line_number": 62, "usage_type": "call" }, { "api_name": "utils.parser.merge_args", "line_number": 63, "usage_type": "call" }, { "api_name": "...
1876232272
#!/usr/bin/env python3 ''' Copy Sunstone gerbers output for OSH Park ''' import os import sys try: from sh import cp import sh except: print('Need sh module') print('sudo pip3 install sh') sys.exit(1) def query_yes_no(question, default="yes"): """Ask a yes/no question via input() and return their answer. "q...
lab11/eagle
scripts/sunstone_to_oshpark.py
sunstone_to_oshpark.py
py
1,801
python
en
code
61
github-code
21
[ { "api_name": "sys.exit", "line_number": 16, "usage_type": "call" }, { "api_name": "sys.stdout.write", "line_number": 40, "usage_type": "call" }, { "api_name": "sys.stdout", "line_number": 40, "usage_type": "attribute" }, { "api_name": "sys.stdout.write", "lin...
11741417397
import json import logging import datetime from company_report_vs_peers_service import CompanyReportvsPeersService from connection import create_db_engine, create_db_session from query_builder import QuerySQLBuilder from response_sql import ResponseSQL from company_anonymization import CompanyAnonymization from base_me...
kpinetwork/backend
src/handlers/company_report_vs_peers/get_company_report_vs_peers_handler.py
get_company_report_vs_peers_handler.py
py
2,366
python
en
code
0
github-code
21
[ { "api_name": "app_http_headers.AppHttpHeaders", "line_number": 20, "usage_type": "call" }, { "api_name": "connection.create_db_engine", "line_number": 21, "usage_type": "call" }, { "api_name": "connection.create_db_session", "line_number": 22, "usage_type": "call" }, ...
21039203245
import pytest from tools.base_agent import BaseAgent from tools.config_storage import ConfigStorage from tools.configs import NODE_CONFIG_FILEPATH from tools.exceptions import NodeNotFoundException from tools.helper import init_skale @pytest.fixture(scope="module") def skale(request): print("\nskale setup") ...
skalenetwork/skale-nms
tests/integration/test_base_agent.py
test_base_agent.py
py
1,015
python
en
code
13
github-code
21
[ { "api_name": "tools.helper.init_skale", "line_number": 13, "usage_type": "call" }, { "api_name": "pytest.fixture", "line_number": 10, "usage_type": "call" }, { "api_name": "tools.base_agent.BaseAgent", "line_number": 19, "usage_type": "call" }, { "api_name": "too...
18419014035
import sys import json import pprint import random pp = pprint.PrettyPrinter(indent=4) global upset_count_dict upset_count_dict = { 'total': 0, '64': 0, '32': 0, '16': 0 } global first_round_upsets first_round_upsets = {} global second_round_upsets second_round_upsets = {} global sweet_16_upsets swe...
dliu713/march-madness-predictor-2023
Experimental_approaches/weighted_sim.py
weighted_sim.py
py
32,029
python
en
code
0
github-code
21
[ { "api_name": "pprint.PrettyPrinter", "line_number": 5, "usage_type": "call" }, { "api_name": "random.choices", "line_number": 70, "usage_type": "call" }, { "api_name": "random.choices", "line_number": 129, "usage_type": "call" }, { "api_name": "random.randint", ...
15172181354
# -*- coding: utf-8 -*- import re from copy import deepcopy import scrapy class SuningSpider(scrapy.Spider): name = 'suning' allowed_domains = ['suning.com'] start_urls = ['http://book.suning.com/'] def parse(self, response): dls = response.xpath('//div[@class="menu-item"]/dl') sub_...
ChenQi960219/spider_my
build/lib/suningdushu/suningdushu/spiders/suning.py
suning.py
py
2,582
python
en
code
0
github-code
21
[ { "api_name": "scrapy.Spider", "line_number": 8, "usage_type": "attribute" }, { "api_name": "scrapy.Request", "line_number": 33, "usage_type": "call" }, { "api_name": "copy.deepcopy", "line_number": 33, "usage_type": "call" }, { "api_name": "scrapy.Request", "...
29041140778
import yfinance as yf import csv import pandas compaines = csv.reader(open('snp500.csv')) for company in compaines: symbol, name = company history_filename = 'directory/{}.csv'.format(symbol) f = open(history_filename, 'w') ticker= yf.Ticker(symbol) df = ticker.history(period='1y') f.write(df....
vrainuncensored/Growth-Investing-
snp500History.py
snp500History.py
py
342
python
en
code
0
github-code
21
[ { "api_name": "csv.reader", "line_number": 5, "usage_type": "call" }, { "api_name": "yfinance.Ticker", "line_number": 11, "usage_type": "call" } ]
32767570882
import pathlib import platform import sys import winreg from typing import Tuple def find_windows_sdk() -> Tuple[pathlib.Path, str]: vers = [ "v10.0", "v8.1A", "v8.1", "v8.0A", "v8.0", "v7.1A", "v7.1", "v7.0a", "v7.0", "v6.1a", "v6.1", "v6.0a", "v6.0" ] root = winreg.OpenKey(winreg.HKEY_LO...
wzv5/manifest_tools
findmtexe.py
findmtexe.py
py
1,206
python
en
code
1
github-code
21
[ { "api_name": "winreg.OpenKey", "line_number": 13, "usage_type": "call" }, { "api_name": "winreg.HKEY_LOCAL_MACHINE", "line_number": 13, "usage_type": "attribute" }, { "api_name": "winreg.KEY_QUERY_VALUE", "line_number": 15, "usage_type": "attribute" }, { "api_nam...
38697732369
import argparse import csv import matplotlib.pyplot as plt import sys def parse_csv(source): """ Puts csv file in memory, 4 different lists; returns headers for labelling graphs, and final values for expecteds """ datareader = csv.reader(source, delimiter=',', quotechar='|') headers = next(datarea...
tcassar/chemSim
graph.py
graph.py
py
1,554
python
en
code
0
github-code
21
[ { "api_name": "csv.reader", "line_number": 11, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 24, "usage_type": "call" }, { "api_name": "sys.stdin.read", "line_number": 34, "usage_type": "call" }, { "api_name": "sys.stdin", "li...
70348936053
from __future__ import division, print_function from future import standard_library standard_library.install_aliases() from builtins import object, range, str from subprocess import getoutput from copy import copy import matplotlib as mpl mpl.use('Agg') import matplotlib.gridspec as grd import matplotlib.pyplot as plt...
asugden/pool
scripts/replay/replay-heatmap.py
replay-heatmap.py
py
32,837
python
en
code
1
github-code
21
[ { "api_name": "future.standard_library.install_aliases", "line_number": 3, "usage_type": "call" }, { "api_name": "future.standard_library", "line_number": 3, "usage_type": "name" }, { "api_name": "matplotlib.use", "line_number": 9, "usage_type": "call" }, { "api_n...
35789127001
__author__ = 'jgentile', 'ceharvey' import sys from collections import OrderedDict import random class Scheduler: __time_series = None def __init__(self): """" Initialize a scheduler for the MABM module """ self.__time_series = OrderedDict() def add_event(self, time, ele...
ceharvs/mabm
mabm/scheduler.py
scheduler.py
py
1,660
python
en
code
8
github-code
21
[ { "api_name": "collections.OrderedDict", "line_number": 15, "usage_type": "call" }, { "api_name": "sys.maxint", "line_number": 34, "usage_type": "attribute" }, { "api_name": "random.shuffle", "line_number": 44, "usage_type": "call" } ]
24672709895
from fileinput import input import re from functools import reduce """ 498,4 -> 498,6 -> 496,6 503,4 -> 502,4 -> 502,9 -> 494,9 4 5 5 9 0 0 4 0 3 0 ......+... 1 .......... 2 .......... 3 .......... 4 ....#...## 5 ....#...#. 6 ..###...#. 7 ........#. 8 ........#. 9 #########. """ rocks = [[(int(x)...
Arxcis/adventofcode2022
day14/day14.py
day14.py
py
3,118
python
en
code
1
github-code
21
[ { "api_name": "re.findall", "line_number": 23, "usage_type": "call" }, { "api_name": "fileinput.input", "line_number": 23, "usage_type": "call" }, { "api_name": "functools.reduce", "line_number": 24, "usage_type": "call" } ]