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
10440522494
from django.db import models from utils.helpers import upload_image, optimize_image # Create your models here. class Beneficiary(models.Model): REQUIRED_IMAGE_RATIO = (350, 200) image = models.ImageField(upload_to=upload_image) image_date = models.DateField(help_text="Image clicked date") created ...
iprashant14/sahyog
apps/beneficiary/models.py
models.py
py
726
python
en
code
0
github-code
18
[ { "api_name": "django.db.models.Model", "line_number": 9, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 9, "usage_type": "name" }, { "api_name": "django.db.models.ImageField", "line_number": 12, "usage_type": "call" }, { "api_name":...
14112313411
import numpy as np import zmq class ObsSpace(): def __init__(self): self.shape = [96, 1] class ActionSpace(): def __init__(self): self.shape = [12, 1] def sample(self): return np.clip(((np.random.rand(12)*(40.0-7.5))+7.5), 7.5, 40.0) class TensegrityEnv: def __init__(self): ...
rvy11/ddpg_tensegrity
ddpg_impl/TensegrityEnv.py
TensegrityEnv.py
py
2,225
python
en
code
1
github-code
18
[ { "api_name": "numpy.clip", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.random.rand", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 13, "usage_type": "attribute" }, { "api_name": "zmq.Context", "lin...
73975540520
import numpy as np import matplotlib.pyplot as plt import matplotlib.animation as animation # Setting up the values for the grid ALIVE = 255 DEAD = 0 values = [ALIVE, DEAD] def random_grid(n): """ Returns a grid of NxN random values. :param n: Size of the grid. :return: A grid of NxN random values. ...
dzimiks/ParallelGameOfLife
basic_game_of_life.py
basic_game_of_life.py
py
2,835
python
en
code
1
github-code
18
[ { "api_name": "numpy.random.choice", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 18, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot.subplots", "line_number": 94, "usage_type": "call" }, { "api_name": "matp...
33376177960
# Third-party import astropy.units as u import astropy.coordinates as coord from astropy.tests.helper import quantity_allclose import numpy as np import pytest # Project from ..reference_plane import ReferencePlaneFrame def test_sanity(): rep1 = coord.CartesianRepresentation(x=[0, 1.], ...
adrn/TwoBody
twobody/tests/test_reference_plane.py
test_reference_plane.py
py
1,913
python
en
code
2
github-code
18
[ { "api_name": "astropy.coordinates.CartesianRepresentation", "line_number": 14, "usage_type": "call" }, { "api_name": "astropy.coordinates", "line_number": 14, "usage_type": "name" }, { "api_name": "astropy.units.pc", "line_number": 16, "usage_type": "attribute" }, { ...
10294218876
# Author: Ana Luisa Mata Sanchez # Course: CS2302 # Assignment: Lab #6 # Instructor: Olac Fuentes # Description: Program to draw mazes using dsf # T.A.: Anindita Nath, Maliheh Zargaran # Last modified: 04/11/2019 # Purpose: To compare time differences between compressed and non-compressed disjoi...
ana-mata/Lab-6
Lab6.py
Lab6.py
py
5,651
python
en
code
0
github-code
18
[ { "api_name": "numpy.zeros", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.int", "line_number": 17, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot.subplots", "line_number": 70, "usage_type": "call" }, { "api_name": "matplotlib.pypl...
5832501385
from typing import List, Optional import time import enum from pathlib import Path import json import shutil from doit.tools import create_folder, config_changed from requests import Session from elm_doc.elm_project import ElmPackage, ModuleName, fetch_releases from elm_doc.run_config import Build from elm_doc.tasks ...
ento/elm-doc
src/elm_doc/tasks/package.py
package.py
py
6,957
python
en
code
29
github-code
18
[ { "api_name": "elm_doc.utils.Namespace", "line_number": 17, "usage_type": "name" }, { "api_name": "pathlib.Path", "line_number": 18, "usage_type": "name" }, { "api_name": "json.dump", "line_number": 21, "usage_type": "call" }, { "api_name": "pathlib.Path", "li...
44559234338
# Test for Riot Games API # Anton Chen import math import os import requests import json import pandas as pd import tkinter as tk from PIL import Image, ImageTk API_URL = "api.riotgames.com" DDRAGON_URL = "https://ddragon.leagueoflegends.com" API_KEY = "" # Test variables SUMMONER = "Aegis" DF = None # Tkinter def...
aegisanton/championMatchup
main.py
main.py
py
6,924
python
en
code
0
github-code
18
[ { "api_name": "os.path.exists", "line_number": 37, "usage_type": "call" }, { "api_name": "os.path", "line_number": 37, "usage_type": "attribute" }, { "api_name": "json.dump", "line_number": 49, "usage_type": "call" }, { "api_name": "pandas.read_json", "line_nu...
29268932634
import json import shutil import os import cv2 import numpy as np from pathlib import Path from random import shuffle def save_cmu_split_indices(train_per=0.95, save_dir=(Root_Dir / "src/HandEst/data/Public_HandData/CMU_Panoptic/split_indices")): cmu_labels_path = (Root_Dir / "src/HandEst/data/Public_HandData/CMU...
messmor/yolov7_Hand
data_conversion/convert_2_yolo_format.py
convert_2_yolo_format.py
py
5,029
python
en
code
null
github-code
18
[ { "api_name": "json.load", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.arange", "line_number": 15, "usage_type": "call" }, { "api_name": "random.shuffle", "line_number": 16, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number...
2770770287
#!/usr/bin/env python from __future__ import print_function import os import argparse import textwrap import numpy as np import dictlearn as dl class ImageOpen(argparse.Action): def __init__(self, option_strings, dest, nargs=None, **kwargs): super(ImageOpen, self).__init__(option_strings, dest, **kwargs) ...
permfl/dictlearn
scripts/create_mask.py
create_mask.py
py
7,015
python
en
code
28
github-code
18
[ { "api_name": "argparse.Action", "line_number": 10, "usage_type": "attribute" }, { "api_name": "os.path.isfile", "line_number": 18, "usage_type": "call" }, { "api_name": "os.path", "line_number": 18, "usage_type": "attribute" }, { "api_name": "os.path.splitext", ...
4538891068
#!/usr/bin/env python3 import asyncio import struct import random import time from bleak import BleakClient, BleakScanner prepare_delay_ms = 4000 use_sync = False # Enables synchronization protocol DDD_SERVICE_UUID = "32e61089-2b22-4db5-a914-43ce41986c70" DDD_REQ_CHAR_UUID = "32e6108b-2b22-4db5-a914-43ce41986...
noloerino/DDD
ble_server/ble_server.py
ble_server.py
py
9,815
python
en
code
0
github-code
18
[ { "api_name": "time.time", "line_number": 48, "usage_type": "call" }, { "api_name": "time.time", "line_number": 52, "usage_type": "call" }, { "api_name": "struct.pack", "line_number": 67, "usage_type": "call" }, { "api_name": "struct.pack", "line_number": 87, ...
18298117334
import visa import numpy import time import decimal import matplotlib.pyplot as plt import csv from datetime import datetime import os import argparse import itertools import sys import threading # run if this file is the main program if __name__ == '__main__': print(""" """) p...
KaylxJang/wavesweeper_thorlabs_santec
wave_sweeper_thorlabs_santec.py
wave_sweeper_thorlabs_santec.py
py
14,298
python
en
code
0
github-code
18
[ { "api_name": "argparse.ArgumentParser", "line_number": 22, "usage_type": "call" }, { "api_name": "visa.ResourceManager", "line_number": 31, "usage_type": "call" }, { "api_name": "decimal.Decimal", "line_number": 171, "usage_type": "call" }, { "api_name": "itertoo...
9766351932
import Seq1 import jinja2 import pathlib import json import http.client DICT_GENES = {"FRAT1": "ENSG00000165879", "ADA": "ENSG00000196839", "FXN": "ENSG00000165060", "RNU6_269P": "ENSG00000212379", "MIR633": "ENSG00000207552", "TTTY4C": "ENSG00000228296", "RBMY2YP"...
mnevado02/practices-2021
Final-Project/utils.py
utils.py
py
2,994
python
en
code
0
github-code
18
[ { "api_name": "jinja2.Template", "line_number": 22, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 22, "usage_type": "call" }, { "api_name": "colorama.init", "line_number": 29, "usage_type": "call" }, { "api_name": "termcolor.colored", "l...
33592932785
from collections import deque materials = [int(x) for x in input().split()] magic_level = deque([int(x) for x in input().split()]) boxes = { 150: "Doll", 250: "Wooden train", 300: "Teddy bear", 400: "Bicycle" } crafted_toys = {} while materials and magic_level: material = materials.pop() ma...
jradovanov/python-advance
exams_python_advance/santa's_present_factory.py
santa's_present_factory.py
py
1,418
python
en
code
0
github-code
18
[ { "api_name": "collections.deque", "line_number": 4, "usage_type": "call" } ]
74793274278
from zerver.models import Backlog, BacklogAccessory, UpdateBacklog, Statement, StatementBacklog, StatementAccessory, \ StatementState, UserProfile, Stream, ZgStatementComment, ZgReplyComment,UserProfile from django.http import JsonResponse import datetime, time, json, calendar from zerver.lib import avatar from da...
ty-xy/zg13
zerver/views/zg_backlog.py
zg_backlog.py
py
46,992
python
en
code
0
github-code
18
[ { "api_name": "datetime.datetime.utcnow", "line_number": 17, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 17, "usage_type": "attribute" }, { "api_name": "datetime.timezone.utc", "line_number": 18, "usage_type": "attribute" }, { "api_na...
10054044916
import socket import sys import time import math import pygame MSGLEN = 128 PRINT_STUFF = True SERV_IP = "10.0.0.12" WIN_SIZE_X = 600 WIN_SIZE_Y = 600 WHITE = [255,255,255] class XO_ClientGUI: def __init__(self, id:str): self.my_turn = False self.s = socket.socket(socket.AF_I...
Tomi-1997/CS-2ndYear
XO/XO_ClientGUI.py
XO_ClientGUI.py
py
7,780
python
en
code
0
github-code
18
[ { "api_name": "socket.socket", "line_number": 20, "usage_type": "call" }, { "api_name": "socket.AF_INET", "line_number": 20, "usage_type": "attribute" }, { "api_name": "socket.SOCK_STREAM", "line_number": 20, "usage_type": "attribute" }, { "api_name": "socket.geth...
25625669336
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('server', '0100_driver_ssn'), ] operations = [ migrations.RemoveField( model_name='driver', name='def...
JeremyParker/idlecars-backend
server/migrations/0101_remove_driver_defensive_cert_image.py
0101_remove_driver_defensive_cert_image.py
py
357
python
en
code
2
github-code
18
[ { "api_name": "django.db.migrations.Migration", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 7, "usage_type": "name" }, { "api_name": "django.db.migrations.RemoveField", "line_number": 14, "usage_type": "call" }, ...
22379525378
from django.conf.urls import url, include from . import views from rest_framework.routers import DefaultRouter router = DefaultRouter() router.register(r'pages', views.PageViewSet) urlpatterns = [ url(r'^insert-nbsp', views.insert_nbsp), url(r'^search-documents/de', views.search_documents_de), url(r'^sea...
campusmedius/campusmedius
backend/campusmedius/campusmedius/main/urls.py
urls.py
py
546
python
en
code
1
github-code
18
[ { "api_name": "rest_framework.routers.DefaultRouter", "line_number": 6, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 10, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 11, "usage_type": "call" }, { "api...
32274372796
# -*- coding: utf-8 -*- """ Created on Wed Jun 14 22:57:20 2023 @author: Zeo """ import numpy as np import matplotlib.pyplot as plt def classical_walk(samples): posN = np.zeros(P); posN[N]= 1; for i in range (N): posN = (np.roll(posN, 1)+ np.roll(posN, -1)) /2; return posN; N = 100; P = 2 * ...
rico-patrick/QuantumWalks
classical_walk_time.py
classical_walk_time.py
py
620
python
en
code
0
github-code
18
[ { "api_name": "numpy.zeros", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.roll", "line_number": 16, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.bar", "line_number": 23, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", ...
75293631399
""" EXPERIMENTAL ============ Lightweight connection pooling for peewee. In a single-threaded application, only one connection will be created. It will be continually recycled until either it exceeds the stale timeout or is closed explicitly (using `.manual_close()`). In a multi-threaded application, up to `max_conn...
Zachary-Jackson/Tacocat
virtual_env/Lib/site-packages/playhouse/pool.py
pool.py
py
4,526
python
en
code
1
github-code
18
[ { "api_name": "logging.getLogger", "line_number": 21, "usage_type": "call" }, { "api_name": "heapq.heappop", "line_number": 38, "usage_type": "call" }, { "api_name": "time.time", "line_number": 61, "usage_type": "call" }, { "api_name": "time.time", "line_numbe...
6380139584
import nltk import random #to shuffle up data so that no bias from nltk.corpus import movie_reviews #contains 2000 +ve and -ve reviews import pickle from nltk.classify.scikitlearn import SklearnClassifier from nltk.tokenize import word_tokenize from nltk.corpus import stopwords #list out all words document-wise and ad...
ChinmoyJyotiKathar/Virtual_Interview
sentimentanalysisProg.py
sentimentanalysisProg.py
py
2,676
python
en
code
0
github-code
18
[ { "api_name": "random.shuffle", "line_number": 30, "usage_type": "call" }, { "api_name": "nltk.tokenize.word_tokenize", "line_number": 36, "usage_type": "call" }, { "api_name": "nltk.tokenize.word_tokenize", "line_number": 37, "usage_type": "call" }, { "api_name":...
891721818
import requests from bs4 import BeautifulSoup import csv import time MAX_RETRIES = 3 RETRY_DELAY = 5 # Seconds between retries # ... (rest of the functions remain unchanged) ... def retry_request(url): retries = 0 while retries < MAX_RETRIES: try: response = requests.get(ur...
kartiksarwan2017/Leadzem.Ai_Assignment
amazon_scraping.py
amazon_scraping.py
py
5,071
python
en
code
0
github-code
18
[ { "api_name": "requests.get", "line_number": 15, "usage_type": "call" }, { "api_name": "requests.exceptions", "line_number": 18, "usage_type": "attribute" }, { "api_name": "time.sleep", "line_number": 21, "usage_type": "call" }, { "api_name": "requests.get", "...
36965232624
import numpy as np import matplotlib.pyplot as plt from Utils.Bcolor import Bcolors from math import fabs from Utils.Debug_Levels import Debug_Levels as verbos import time from Libraries.Enums import NNLibs from Libraries.Torch import Torch from Libraries.Simplynet import SimplyNet from Libraries.Sklearn import Sklearn...
frknayk/WeightVis
Visualizer/Brain.py
Brain.py
py
16,085
python
en
code
12
github-code
18
[ { "api_name": "Utils.Debug_Levels.Debug_Levels.NO", "line_number": 44, "usage_type": "attribute" }, { "api_name": "Utils.Debug_Levels.Debug_Levels", "line_number": 44, "usage_type": "name" }, { "api_name": "Utils.Bcolor.Bcolors", "line_number": 82, "usage_type": "call" ...
8840505117
#!/usr/bin/env python import pickle import config import socket from user_token import User_token # http://grokbase.com/t/python/python-list/0369kdpe56/scanning-for-local-servers-getting-a-broadcast-address # http://www.tutorialspoint.com/python/python_networking.htm # we will send list of tokens def run_token_client(i...
shubhamshuklaer/load_balancer
token_client.py
token_client.py
py
944
python
en
code
0
github-code
18
[ { "api_name": "config.token_serv_port", "line_number": 9, "usage_type": "attribute" }, { "api_name": "socket.socket", "line_number": 10, "usage_type": "call" }, { "api_name": "socket.AF_INET", "line_number": 10, "usage_type": "attribute" }, { "api_name": "socket.S...
3391194581
import cv2 import numpy as np fn = ['12345.png', 'cir.png'] for ii, n in enumerate(fn): planets = cv2.imread(n) planets = cv2.resize(planets, (650, 400)) gray_img = cv2.cvtColor(planets, cv2.COLOR_BGR2GRAY) img = cv2.medianBlur(gray_img, 5) cimg = cv2.cvtColor(img, cv2.COLOR_GRAY2BGR) circle...
rattasakAong/Object-Tracking-by-Colour
findcircle.py
findcircle.py
py
907
python
en
code
0
github-code
18
[ { "api_name": "cv2.imread", "line_number": 7, "usage_type": "call" }, { "api_name": "cv2.resize", "line_number": 8, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 10, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2GRAY", "line_numbe...
33064458243
# -*- coding: utf-8 -*- """ Created on Mon Mar 30 13:50:15 2020 @author: DELL """ import numpy as np from PIL import Image w = 5 h = 5 array= np.zeros([w,h,3] , dtype = np.uint8) img = Image.fromarray(array) img.save('AREA_img1.png') array1= np.zeros([100,200,3] , dtype = np.uint8) array1[: ,:100 ] = [255,128,0] #or...
kushagra67414/python
Area_calculation1.py
Area_calculation1.py
py
418
python
en
code
0
github-code
18
[ { "api_name": "numpy.zeros", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.uint8", "line_number": 11, "usage_type": "attribute" }, { "api_name": "PIL.Image.fromarray", "line_number": 12, "usage_type": "call" }, { "api_name": "PIL.Image", "lin...
20720021176
# Databricks notebook source # MAGIC %md # MAGIC ##### Welcome to Azurelib Academy By Deepak Goyal # MAGIC ##### You can master the Databricks here: <a href='https://adeus.azurelib.com' target='_blank'>www.adeus.azurelib.com</a> # MAGIC ##### Author of this blog: Arud Seka Berne S <a href="https://www.linkedin.com/in/...
azurelib-academy/azure-databricks-pyspark-examples
34. Pyspark Concat_Ws() Function/Pyspark Concat_Ws() Function - Notebook.py
Pyspark Concat_Ws() Function - Notebook.py
py
3,093
python
en
code
0
github-code
18
[ { "api_name": "pyspark.sql.session.SparkSession.builder.master", "line_number": 26, "usage_type": "call" }, { "api_name": "pyspark.sql.session.SparkSession.builder", "line_number": 26, "usage_type": "attribute" }, { "api_name": "pyspark.sql.session.SparkSession", "line_number...
20302869420
from datetime import date, datetime, timedelta from unittest.mock import Mock, call, patch from django.contrib.auth.models import Group from django.core import mail from django.core.cache import caches from django.core.exceptions import ValidationError from django.test import TestCase, override_settings from django_we...
e-valuation/EvaP
evap/evaluation/tests/test_models.py
test_models.py
py
49,435
python
en
code
93
github-code
18
[ { "api_name": "django_webtest.WebTest", "line_number": 38, "usage_type": "name" }, { "api_name": "model_bakery.baker.make", "line_number": 40, "usage_type": "call" }, { "api_name": "evap.evaluation.models.Semester", "line_number": 40, "usage_type": "argument" }, { ...
6232558187
import json import logging from abc import abstractmethod import attr import gevent from metadata.backend.interface import RawBackendType from metadata.event_system.register import EventType from metadata.middleware.rabbitmq import ExchangeType, RabbitMQProducer from metadata.runtime import rt_context from metadata.t...
Tencent/bk-base
src/datamgr/metadata/metadata/event_system/listener.py
listener.py
py
9,467
python
en
code
85
github-code
18
[ { "api_name": "logging.getLogger", "line_number": 16, "usage_type": "call" }, { "api_name": "metadata.util.common.camel_to_snake", "line_number": 30, "usage_type": "call" }, { "api_name": "gevent.Timeout", "line_number": 46, "usage_type": "call" }, { "api_name": "...
6477275479
#!/usr/bin/env python # coding: utf-8 # In[6]: from sklearn.metrics import r2_score,mean_absolute_error,mean_squared_error from sklearn import datasets iris = datasets.load_iris() # print(iris.DESCR) # In[9]: targ = iris.target # print(targ) # print(iris.target_names) # In[20]: data = iris.data # print(dat...
Prasanna1112/Linear-Rgeression-with-IRIS-dataset
BK Assignment Q2 (New).py
BK Assignment Q2 (New).py
py
1,475
python
en
code
0
github-code
18
[ { "api_name": "sklearn.datasets.load_iris", "line_number": 11, "usage_type": "call" }, { "api_name": "sklearn.datasets", "line_number": 11, "usage_type": "name" }, { "api_name": "sklearn.model_selection.train_test_split", "line_number": 35, "usage_type": "call" }, { ...
22238453711
from typing import Optional, Dict import pandas as pd from kbc_pul.popularity.entity_counting.total_ent_count import EntityTripleCountController EntityStr = str class EntityCountInOtherRelationsBothPositions: def __init__(self, target_relation: str, entity_triple_count_contro...
ML-KULeuven/KBC-as-PU-Learning
kbc_pul/popularity/entity_counting/ent_count_in_other_rels_both_positions.py
ent_count_in_other_rels_both_positions.py
py
2,057
python
en
code
7
github-code
18
[ { "api_name": "kbc_pul.popularity.entity_counting.total_ent_count.EntityTripleCountController", "line_number": 14, "usage_type": "name" }, { "api_name": "kbc_pul.popularity.entity_counting.total_ent_count.EntityTripleCountController", "line_number": 19, "usage_type": "name" }, { ...
29424124186
import numpy as np import matplotlib.pyplot as plt gridWorld = np.zeros((6, 6)) tmp = np.zeros((6, 6)) theta = 0.01 if_convergence = False while not if_convergence: delta = 0 for i in range(6): for j in range(6): if (i == 0 and j == 1) or (i == 5 and j == 5): continue ...
shy829/reinforcement-learning
A1.py
A1.py
py
1,846
python
en
code
0
github-code
18
[ { "api_name": "numpy.zeros", "line_number": 4, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 5, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.matshow", "line_number": 31, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", ...
32931765825
from random import shuffle import pygame as pg from lib.config import * def shuffler (r): shuff = [i for i in range(r)] shuffleagain = 1 while shuffleagain: # re-shuffle until no two sequential cards are neighbors shuffle(shuff) idx = 0 for j in range(r - 1): ...
opmorgan/py-seqtest
lib/utils.py
utils.py
py
782
python
en
code
0
github-code
18
[ { "api_name": "random.shuffle", "line_number": 15, "usage_type": "call" }, { "api_name": "pygame.image.load", "line_number": 28, "usage_type": "call" }, { "api_name": "pygame.image", "line_number": 28, "usage_type": "attribute" }, { "api_name": "pygame.transform.s...
25919559835
from numpy import * def loadDataSet(fileName): dataMat = [] fr = open(fileName) for line in fr.readlines(): curLine = line.strip().split('\t') fltLine = list(map(float,curLine))###map()返回值已经不再是list,而是iterators;所以需要将iterator 转换成list,即list(map()) dataMat...
sevenry/python_learning_note
machine_learning/ss10/kMeans.py
kMeans.py
py
6,672
python
en
code
2
github-code
18
[ { "api_name": "urllib.request.parse.urlencode", "line_number": 105, "usage_type": "call" }, { "api_name": "urllib.request.parse", "line_number": 105, "usage_type": "attribute" }, { "api_name": "urllib.request", "line_number": 105, "usage_type": "name" }, { "api_na...
23179028262
from dataclasses import dataclass import warnings from cropharvest.countries import BBox from cropharvest.datasets import Task, CropHarvestLabels, CropHarvest from cropharvest.config import TEST_REGIONS, TEST_DATASETS from cropharvest import countries from .config import TEST_CROP_TO_CLASSIFICATION from typing impor...
nasaharvest/timl
crop_classification/dl/datasets.py
datasets.py
py
4,239
python
en
code
14
github-code
18
[ { "api_name": "cropharvest.datasets.Task", "line_number": 15, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 16, "usage_type": "name" }, { "api_name": "warnings.warn", "line_number": 24, "usage_type": "call" }, { "api_name": "cropharvest.c...
32481446474
import copy import imp import numpy as np from ...utils import common_utils from .nuscenes_dataset import NuScenesDataset from collections import defaultdict import torch from ...ops.roiaware_pool3d import roiaware_pool3d_utils from pathlib import Path class NuScenesDatasetMT(NuScenesDataset): def __init__(self,...
WoodwindHu/DTS
pcdet/datasets/nuscenes/nuscenes_dataset_mt.py
nuscenes_dataset_mt.py
py
13,274
python
en
code
25
github-code
18
[ { "api_name": "nuscenes_dataset.NuScenesDataset", "line_number": 13, "usage_type": "name" }, { "api_name": "copy.deepcopy", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 26, "usage_type": "call" }, { "api_name": "numpy.floa...
38090217423
__author__ = 'Xavier Basty <xbasty@gmail.com>' __version__ = '0.1a3' # The base package metadata to be used by both distutils and setuptools METADATA = dict( name = "grapefruit", version = __version__, py_modules = ['grapefruit'], author = 'Xavier Basty', author_email = 'xbasty@gmail.com', description = '...
google-code-export/grapefruit
setup.py
setup.py
py
1,639
python
en
code
1
github-code
18
[ { "api_name": "setuptools.setup", "line_number": 49, "usage_type": "call" }, { "api_name": "distutils.core.core.setup", "line_number": 52, "usage_type": "call" }, { "api_name": "distutils.core.core", "line_number": 52, "usage_type": "attribute" }, { "api_name": "d...
28445574742
from neuron import h h.load_file('stdrun.hoc') soma = h.Section(name='soma') seg = soma(0.5) soma.insert('hh') ic = h.IClamp(seg) ic.amp = 40 # since by default a very large section ic.delay = 1 ic.dur = 1 h.xpanel("neuron") h.xlabel("voltage graph") g = h.Graph() g.addvar("v", "v(0.5)") #hoc string example g.a...
mcdougallab/neurongui2
examples/graph_test0.py
graph_test0.py
py
482
python
en
code
0
github-code
18
[ { "api_name": "neuron.h.load_file", "line_number": 3, "usage_type": "call" }, { "api_name": "neuron.h", "line_number": 3, "usage_type": "name" }, { "api_name": "neuron.h.Section", "line_number": 5, "usage_type": "call" }, { "api_name": "neuron.h", "line_number...
38907603445
import numpy as np import networkx as nx import scrubber import model import os.path def neglog(c): return -np.log((c + 1)/2) def heavyneglog(c): return (- np.log((c + 1)/2)) ** 5 def invfun(c): return (1 - c)/(1 + c) def cov(c): return c def cotan(c): return 1/np.tan(np.pi * (c + 1)/ 2) def r...
lolfail9001/hse-sna-un-vc-2022
votinggraph.py
votinggraph.py
py
6,288
python
en
code
0
github-code
18
[ { "api_name": "numpy.log", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.log", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.tan", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.pi", "line_number": 20, "u...
220507717
#!/usr/bin/env python from setuptools import setup, find_packages import os def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() setup(name='franca2ros', version='0.0.1', description='Franca IDL to ROS2 translator', author='Mikhail Tsukerman', packages=find_...
miketsukerman/vsomeip-ros-bridge
src/franca2ros/setup.py
setup.py
py
740
python
en
code
14
github-code
18
[ { "api_name": "os.path.join", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path", "line_number": 7, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 7, "usage_type": "call" }, { "api_name": "setuptools.setup", "line_n...
3588643265
import logging from django.core.exceptions import ObjectDoesNotExist, MultipleObjectsReturned from dotenv import load_dotenv load_dotenv() import os import django import requests from math import ceil django.setup() from prices.models import * shop = Shop.objects.get(name='DAJAR') user_agent = os.environ.get('User...
Ryszard-S/Price-tracker
scripts/product_dajar.py
product_dajar.py
py
4,872
python
en
code
0
github-code
18
[ { "api_name": "dotenv.load_dotenv", "line_number": 5, "usage_type": "call" }, { "api_name": "django.setup", "line_number": 12, "usage_type": "call" }, { "api_name": "os.environ.get", "line_number": 17, "usage_type": "call" }, { "api_name": "os.environ", "line_...
21100987214
import logging from typing import List, Tuple import torch logger = logging.getLogger(__name__) class PastKeyValuesHelper: """Helper functions to process past key values for encoder-decoder model""" @staticmethod def get_past_names(num_layers, present: bool = False): past_self_names = [] ...
microsoft/onnxruntime
onnxruntime/python/tools/transformers/models/t5/past_helper.py
past_helper.py
py
6,524
python
en
code
9,700
github-code
18
[ { "api_name": "logging.getLogger", "line_number": 6, "usage_type": "call" }, { "api_name": "typing.Tuple", "line_number": 68, "usage_type": "name" }, { "api_name": "torch.Tensor", "line_number": 68, "usage_type": "attribute" }, { "api_name": "typing.Tuple", "l...
14950173001
# A part of NonVisual Desktop Access (NVDA) # This file is covered by the GNU General Public License. # See the file COPYING for more details. # Copyright (C) 2010-2023 Gianluca Casalino, NV Access Limited, Babbage B.V., Leonard de Ruijter, # Bram Duvigneau from typing import List import serial from io impor...
nvaccess/nvda
source/brailleDisplayDrivers/hims.py
hims.py
py
20,932
python
en
code
1,802
github-code
18
[ { "api_name": "serial.PARITY_NONE", "line_number": 22, "usage_type": "attribute" }, { "api_name": "baseObject.AutoPropertyObject", "line_number": 24, "usage_type": "name" }, { "api_name": "collections.OrderedDict", "line_number": 55, "usage_type": "call" }, { "api...
7057059326
import os import cv2 import numpy as np import keras from keras.preprocessing import image from keras.preprocessing.image import load_img,img_to_array from keras.models import load_model import matplotlib.pyplot as plt import warnings warnings.filterwarnings("ignore") def main(): model=load_model("model....
Ketan3102/Emotion_Detection
Emotion_Detection_Keras_MobileNet/emotion_detection.py
emotion_detection.py
py
1,659
python
en
code
0
github-code
18
[ { "api_name": "warnings.filterwarnings", "line_number": 10, "usage_type": "call" }, { "api_name": "keras.models.load_model", "line_number": 12, "usage_type": "call" }, { "api_name": "cv2.CascadeClassifier", "line_number": 13, "usage_type": "call" }, { "api_name": ...
13360286162
def calculate_mcd_msd(alpha, fftlen, pool, validation_dir, gt_dir, sr=16000, num_mcep=36, frame_period=5.0): converted_dirs = os.listdir(validation_dir) total_mcd_list = list() f2f_mcd_list = list() f2m_mcd_list = list() m2f_mcd_list = list() m2m_mcd_list = list() total_msd_list = list() ...
yyurim/Exp_Disentanglement
calculate/calculate.py
calculate.py
py
8,043
python
en
code
2
github-code
18
[ { "api_name": "argparse.ArgumentParser", "line_number": 221, "usage_type": "call" } ]
4363756100
# https://www.youtube.com/watch?v=afITiFR6vfw&index=19&list=PLQVvvaa0QuDfefDfXb9Yf0la1fPDKluPF import random import matplotlib.pyplot as plt from matplotlib import style style.use('fivethirtyeight') fig = plt.figure() def create_plots(): xs = [] ys = [] for i in range(10): x = i y = random.randrange(10) x...
rrosatti/python
data visualization/subplots.py
subplots.py
py
1,083
python
en
code
0
github-code
18
[ { "api_name": "matplotlib.style.use", "line_number": 6, "usage_type": "call" }, { "api_name": "matplotlib.style", "line_number": 6, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 8, "usage_type": "call" }, { "api_name": "matplotli...
30688588201
from django import template register = template.Library() @register.filter def ru_pluralize(value: int, variants: str) -> str: """Фильтр окончаний кириллицы.""" default = "" if not variants: return default variants = variants.split(",") value = abs(int(value)) if value % 10 == 1 and...
nmikolaychuk/django-blog
config/blog/templatetags/comments_extras.py
comments_extras.py
py
598
python
en
code
0
github-code
18
[ { "api_name": "django.template.Library", "line_number": 4, "usage_type": "call" }, { "api_name": "django.template", "line_number": 4, "usage_type": "name" } ]
10644502599
from collections import defaultdict class Solution: def findSubstring(self, s: str, words: List[str]) -> List[int]: res = [] if len(words) == 0: return res n = len(s) m = len(words) w = len(words[0]) tot = defaultdict(int) for word in words: tot[word] += 1 ...
ShawnDong98/Algorithm-Book
leetcode/python/30.py
30.py
py
809
python
en
code
0
github-code
18
[ { "api_name": "collections.defaultdict", "line_number": 9, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 12, "usage_type": "call" } ]
23353945512
# ALGORITMO DE BUSQUEDA DE ARCHIVOS EN UN SISTEMA DE DIRECOTRIOS, IMPLEMENTNADO NODOS from operator import le import pathlib import os # from tkinter import Tk, Tcl # from tkinter.filedialog import askdirectory # Para archivos from os.path import isfile, join, isdir # La dirección completa del archivo .py camino = pat...
SolorzanoBryan/busquedaArchivos
nuevaCarpeta/busquedaArchivo.py
busquedaArchivo.py
py
4,987
python
es
code
0
github-code
18
[ { "api_name": "pathlib.Path", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path.split", "line_number": 18, "usage_type": "call" }, { "api_name": "os.path", "line_number": 18, "usage_type": "attribute" }, { "api_name": "os.listdir", "line_number...
31339557612
import sys from flask import (abort, flash, Flask, g, redirect, render_template, request, send_from_directory, session, url_for) from flask_bootstrap import Bootstrap from flask_ckeditor import CKEditor from tinymongo import TinyMongoClient, Query, where import admin from gcollections import...
jefmud/biograd
app.py
app.py
py
7,278
python
en
code
0
github-code
18
[ { "api_name": "flask.Flask", "line_number": 11, "usage_type": "call" }, { "api_name": "tinymongo.TinyMongoClient", "line_number": 13, "usage_type": "call" }, { "api_name": "flask_bootstrap.Bootstrap", "line_number": 15, "usage_type": "call" }, { "api_name": "flask...
20720015796
# Databricks notebook source # MAGIC %md # MAGIC ##### Welcome to Azurelib Academy By Deepak Goyal # MAGIC ##### You can master the Databricks here: <a href='https://adeus.azurelib.com' target='_blank'>www.adeus.azurelib.com</a> # MAGIC ##### Author of this blog: Arud Seka Berne S <a href="https://www.linkedin.com/in/...
azurelib-academy/azure-databricks-pyspark-examples
33. Pyspark Split Column Values/Pyspark Split Column Values - Notebook.py
Pyspark Split Column Values - Notebook.py
py
3,453
python
en
code
0
github-code
18
[ { "api_name": "pyspark.sql.session.SparkSession.builder.master", "line_number": 26, "usage_type": "call" }, { "api_name": "pyspark.sql.session.SparkSession.builder", "line_number": 26, "usage_type": "attribute" }, { "api_name": "pyspark.sql.session.SparkSession", "line_number...
7475313977
from datetime import timedelta from airflow import DAG from airflow.providers.docker.operators.docker import DockerOperator from airflow.sensors.filesystem import FileSensor from airflow.utils.dates import days_ago default_args = { "owner": "airflow", "email": ["airflow@example.com"], "retries": 1, "...
made-ml-in-prod-2021/korowood
airflow_ml_dags/dags/predict_model.py
predict_model.py
py
1,338
python
en
code
0
github-code
18
[ { "api_name": "datetime.timedelta", "line_number": 13, "usage_type": "call" }, { "api_name": "airflow.DAG", "line_number": 16, "usage_type": "call" }, { "api_name": "airflow.utils.dates.days_ago", "line_number": 20, "usage_type": "call" }, { "api_name": "airflow.s...
28799121514
######################################################################################################################################### ############################################################ functions ################################################################## # ...
joaotaraujo/leia-midia
osc_server/functions.py
functions.py
py
8,284
python
en
code
1
github-code
18
[ { "api_name": "keras.models.model_from_json", "line_number": 61, "usage_type": "call" }, { "api_name": "pandas.read_pickle", "line_number": 68, "usage_type": "call" }, { "api_name": "pythonosc.dispatcher.Dispatcher", "line_number": 70, "usage_type": "call" }, { "a...
41389389450
''' Basic Face Detection and Eye Detection project''' import cv2 face_cascade = cv2.CascadeClassifier('haarcascade_frontalface_default.xml') #for detecting the face eye_cascade = cv2.CascadeClassifier('haarcascade_eye_tree_eyeglasses.xml') #for detecting the eyes first_read = True cap = cv2.VideoCapture(0) #captur...
tanmoyee04/OpenCV
Stare Game (A basic Face Detection and Eye Detection Project)/stare_game.py
stare_game.py
py
2,749
python
en
code
0
github-code
18
[ { "api_name": "cv2.CascadeClassifier", "line_number": 5, "usage_type": "call" }, { "api_name": "cv2.CascadeClassifier", "line_number": 6, "usage_type": "call" }, { "api_name": "cv2.VideoCapture", "line_number": 10, "usage_type": "call" }, { "api_name": "cv2.cvtCol...
70820087721
import numpy as np import matplotlib.pyplot as plt import rondo import rondo.functions as F x = rondo.Variable(np.linspace(-7, 7, 200)) y = F.sin(x) y.backward(create_graph=True) logs = [y.data.flatten()] n = 3 for i in range(n): logs.append(x.grad.data.flatten()) gx = x.grad x.cleargrad() gx.backwa...
kensuke-kamata/rondo
examples/graph/sin.py
sin.py
py
518
python
en
code
0
github-code
18
[ { "api_name": "rondo.Variable", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.linspace", "line_number": 7, "usage_type": "call" }, { "api_name": "rondo.functions.sin", "line_number": 8, "usage_type": "call" }, { "api_name": "rondo.functions", ...
2721973781
import numpy as np import pandas as pd from flask import Flask, request, jsonify, render_template import pickle # import Food_Recommendation_System_Baseline.ipynb from food_recommendation_system_baseline import foodrecommendation app = Flask(__name__) model = pickle.load(open('modelpickel1.pkl', 'rb')) @a...
ayushraj42448/content-based-recommender
app.py
app.py
py
1,416
python
en
code
0
github-code
18
[ { "api_name": "flask.Flask", "line_number": 9, "usage_type": "call" }, { "api_name": "pickle.load", "line_number": 10, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 14, "usage_type": "call" }, { "api_name": "flask.request.form", ...
40332929604
# --- Import the required variables: import tweepy import os def post_tweet(download_getting: float, download_should_be: float, upload_getting:float, upload_should_be:float): """This function will create a tweet to complain about your bad internet speed.""" # --- Get the required Twitter API keys from O/...
York13Pud/python-100-days-of-code
days-050-to-059/day-051-twitter-bot/post_to_twitter.py
post_to_twitter.py
py
1,253
python
en
code
2
github-code
18
[ { "api_name": "os.environ.get", "line_number": 10, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 10, "usage_type": "attribute" }, { "api_name": "os.environ.get", "line_number": 11, "usage_type": "call" }, { "api_name": "os.environ", "line_...
12583492171
import cv2 import numpy as np # Define the circle equation and the error function def circle_eqn(x_c, y_c, x, y): return np.sqrt((x-x_c)**2 + (y-y_c)**2) # Define the error function def error_fct(params, x, y): x_c, y_c, r = params return np.sum((circle_eqn(x_c, y_c, x, y) - r)**2) # Get average of coori...
Emanuele-n/surgical-copilot
1dof_micro_catheter/length15cm/motion_capture/1mm_disp/utils.py
utils.py
py
1,311
python
en
code
0
github-code
18
[ { "api_name": "numpy.sqrt", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.sum", "line_number": 11, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 15, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2GRAY", "line_numbe...
72686352041
#! /usr/bin/env python3 import json import sys import requests def main(): r = requests.get('https://raw.githubusercontent.com/microsoft/mstic/master/PublicFeeds/ThreatActorNaming/MicrosoftMapping.json') r.raise_for_status() d = json.loads(r.text) search_term = sys.argv[1].lower() for item in d: ...
jayswan/rose
rose.py
rose.py
py
633
python
en
code
0
github-code
18
[ { "api_name": "requests.get", "line_number": 7, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 9, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 10, "usage_type": "attribute" }, { "api_name": "json.dumps", "line_number": 1...
10710482831
#from hubs.hinting import hint, prefixed as _ from hubs.widgets.base import argument from hubs.widgets.chrome import panel from hubs import validators import hubs.models from fedmsg.meta.base import BaseConglomerator as BC import jinja2 chrome = panel('Hubs', key='associations') template = jinja2.Template(""" {% i...
ralphbean/fedora-hubs-prototype
hubs/widgets/subscriptions.py
subscriptions.py
py
1,396
python
en
code
7
github-code
18
[ { "api_name": "hubs.widgets.chrome.panel", "line_number": 13, "usage_type": "call" }, { "api_name": "jinja2.Template", "line_number": 14, "usage_type": "call" }, { "api_name": "hubs.widgets.base.models.User.by_username", "line_number": 32, "usage_type": "call" }, { ...
73518807719
from typing import List class Solution: def addSpaces(self, s: str, spaces: List[int]) -> str: x = s for i in range(len(spaces)): x = x[:spaces[i]+i]+' '+x[spaces[i]+i:] return x #Exercise: https://leetcode.com/problems/adding-spaces-to-a-string/ #You are given a 0-indexed str...
MatjazM2020/codingWorkouts
addingSpacesToAString.py
addingSpacesToAString.py
py
516
python
en
code
1
github-code
18
[ { "api_name": "typing.List", "line_number": 4, "usage_type": "name" } ]
9404377538
""" The source code is adapted from https://github.com/aliaksandr960/segment-anything-eo. Credit to the author Aliaksandr Hancharenka. """ import os import tempfile import cv2 import numpy as np import rasterio from tqdm import tqdm import shapely import geopandas as gpd import rasterio from rasterio import features ...
mhdella/segment-geospatial
samgeo/common.py
common.py
py
22,636
python
en
code
null
github-code
18
[ { "api_name": "os.path.expanduser", "line_number": 34, "usage_type": "call" }, { "api_name": "os.path", "line_number": 34, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 36, "usage_type": "call" }, { "api_name": "os.path", "line_n...
23460913453
from decimal import Decimal import django.core.validators from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [] operations = [ migrations.CreateModel( name='AdvertisementMetric', fields=[ ('id', m...
Pavel-Egorov/metrics_storage_service
metrics_storage_service/src/api_impl/migrations/0001_initial.py
0001_initial.py
py
2,037
python
en
code
0
github-code
18
[ { "api_name": "django.db.migrations.Migration", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 7, "usage_type": "name" }, { "api_name": "django.db.migrations.CreateModel", "line_number": 13, "usage_type": "call" }, ...
30975041001
import math import cv2 as cv import mediapipe as mp class PoseDetector: def __init__(self, mode=False, upBody=False, smooth=True, detectionCon=0.5, trackCon=0.5): self.mode = mode self.upBody = upBody self.smooth = smooth self.detectionCon = detectionCon self.trackCon = t...
bobaejeon/AITrainer
PoseModule.py
PoseModule.py
py
2,287
python
en
code
3
github-code
18
[ { "api_name": "mediapipe.solutions", "line_number": 15, "usage_type": "attribute" }, { "api_name": "mediapipe.solutions", "line_number": 16, "usage_type": "attribute" }, { "api_name": "cv2.circle", "line_number": 41, "usage_type": "call" }, { "api_name": "math.deg...
35871037365
import time import config from SPI.modules.base_spi import EVENT_SI_PI_UPDATED from models import Schedule, ServiceProvider, Station from tests.conftest import create_mocks_manually def test_schedule_create(setup_db, actor_setup, create_mocks): session = setup_db on_si_changed, on_pi_changed = create_mocks ...
ebu/radiodns-manager
RadioDns-PlugIt/tests/SPI_generator/test_11_schedule.py
test_11_schedule.py
py
2,289
python
en
code
14
github-code
18
[ { "api_name": "models.ServiceProvider.query.filter_by", "line_number": 12, "usage_type": "call" }, { "api_name": "models.ServiceProvider.query", "line_number": 12, "usage_type": "attribute" }, { "api_name": "models.ServiceProvider", "line_number": 12, "usage_type": "name"...
30999697538
""" System Module """ from django.test import TestCase from decimal import Decimal from django.contrib.auth.models import User from products.models import Box from .models import Order, OrderBox, Address, Payment class SetupModelTestCase(TestCase): """ Base test case to be used in all models tests """ ...
nandabritto/Regional_Taste
order/test_models.py
test_models.py
py
3,918
python
en
code
0
github-code
18
[ { "api_name": "django.test.TestCase", "line_number": 9, "usage_type": "name" }, { "api_name": "django.contrib.auth.models.User.objects.create_user", "line_number": 17, "usage_type": "call" }, { "api_name": "django.contrib.auth.models.User.objects", "line_number": 17, "usa...
24573483828
import stripe from django.shortcuts import render from django.views.generic.base import TemplateView from django.contrib.auth.models import Permission from django.conf import settings # Create your views here. stripe.api_key = settings.STRIPE_TEST_SECRET_KEY class OrdersPageView(TemplateView): template_name ...
sharhan-alhassan/django-bookstore
orders/views.py
views.py
py
1,189
python
en
code
0
github-code
18
[ { "api_name": "stripe.api_key", "line_number": 11, "usage_type": "attribute" }, { "api_name": "django.conf.settings.STRIPE_TEST_SECRET_KEY", "line_number": 11, "usage_type": "attribute" }, { "api_name": "django.conf.settings", "line_number": 11, "usage_type": "name" }, ...
13327137385
#### SHOULD PROBABLY MAKE AN AR45 FUNCS FILE TO STORE SOME OF THESE DEETS from AR45_funcs import * figdir #### Load all bin_list=sort(glob.glob('/home/isabela/Documents/cruises/OSNAP2020_oxygen_AR45/data/ctd/ar45_*')) def getdist(lon0,lat0,lonex,latex): distout=zeros(len(lonex)) for ii in range(len(lonex)):...
ilebras/OSNAP
OSNAP2020cruise/LoadCTD_2020_O2comp.py
LoadCTD_2020_O2comp.py
py
9,179
python
en
code
0
github-code
18
[ { "api_name": "matplotlib.colors.Normalize", "line_number": 248, "usage_type": "call" }, { "api_name": "matplotlib.colors", "line_number": 248, "usage_type": "attribute" }, { "api_name": "matplotlib.colorbar.ColorbarBase", "line_number": 250, "usage_type": "call" }, {...
27738925188
from flask import Flask, render_template, request, flash, session, url_for, redirect, g, abort, send_from_directory from forms import ContactForm, SignupForm, SigninForm, PostForm, WalletForm from flask.ext.mail import Message, Mail from models import * from werkzeug.security import generate_password_hash, check_passwo...
Transformt/peppe
routes.py
routes.py
py
11,061
python
en
code
0
github-code
18
[ { "api_name": "flask.ext.mail.Mail", "line_number": 23, "usage_type": "call" }, { "api_name": "flask.Flask", "line_number": 25, "usage_type": "call" }, { "api_name": "os.path.realpath", "line_number": 34, "usage_type": "call" }, { "api_name": "os.path", "line_...
15335464315
import tensorflow.keras import pygad.kerasga import pygad import pandas as pd import matplotlib.pyplot as plt def fitness_func(solution, sol_idx): global X, Y, keras_ga, model predictions = pygad.kerasga.predict(model=model, solution=solution, ...
MFaizanTariq/NeuralProjectFinal
ann_ga.py
ann_ga.py
py
3,029
python
en
code
0
github-code
18
[ { "api_name": "pygad.kerasga.predict", "line_number": 11, "usage_type": "call" }, { "api_name": "pygad.kerasga", "line_number": 11, "usage_type": "attribute" }, { "api_name": "tensorflow.keras.keras.losses.BinaryCrossentropy", "line_number": 15, "usage_type": "call" }, ...
73647226599
# -*- coding: utf-8 -*- """ Created on Mon Apr 1 14:28:49 2019 @author: bazzz """ import numpy as np from imageio import imread, imsave import matplotlib.pyplot as plt from scipy.ndimage.filters import gaussian_filter np.random.seed(3929) #IMAGE PROCESSING/DISPLAY FUNCTIONS def dispImage(img,surf,t,a,b, paus = .5): ...
bhurat/Projects
Level Set Segmentation - Spring 2019/LSUpwindGrad.py
LSUpwindGrad.py
py
4,377
python
en
code
0
github-code
18
[ { "api_name": "numpy.random.seed", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 11, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot.clf", "line_number": 15, "usage_type": "call" }, { "api_name": "matplotlib....
30133173310
# coding:utf-8 import numpy as np import scipy as sp from sklearn.linear_model import orthogonal_mp_gram import spectral import cv2 class ApproximateKSVD(object): def __init__(self, n_components, max_iter=10, tol=1e-6, transform_n_nonzero_coefs=None): """ Parameters ------...
geodesit/spectral_ella
ksvd.py
ksvd.py
py
4,831
python
en
code
0
github-code
18
[ { "api_name": "numpy.sum", "line_number": 33, "usage_type": "call" }, { "api_name": "numpy.linalg.norm", "line_number": 40, "usage_type": "call" }, { "api_name": "numpy.linalg", "line_number": 40, "usage_type": "attribute" }, { "api_name": "numpy.random.randn", ...
29195148699
from django.urls import path from . import views urlpatterns = [ path('', views.MainView.as_view(), name='main'), path('witcher', views.WitcherView.as_view(), name='witcher'), path('wizard', views.WizardView.as_view(), name='wizard'), path('witcher_school', views.WitcherSchoolView.as_view(), name='witc...
Frostdir/KursachBD
main/urls.py
urls.py
py
1,349
python
en
code
0
github-code
18
[ { "api_name": "django.urls.path", "line_number": 5, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 6, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "django.urls.path", ...
25827551076
from flask import Flask, render_template, request from interference import MaskModel from werkzeug import secure_filename app = Flask(__name__) app.config['UPLOAD_FOLDER'] = 'uploaded' img_path= 'C:\\Users\\Admin\\Desktop\\mask_rcnn-v2\\images\\12283150_12d37e6389_z.jpg' # @app.route("/prediction", methods=['GET']) d...
lenanh0803/mask_rcnn-v2
app.py
app.py
py
772
python
en
code
0
github-code
18
[ { "api_name": "flask.Flask", "line_number": 5, "usage_type": "call" }, { "api_name": "interference.MaskModel", "line_number": 11, "usage_type": "call" }, { "api_name": "flask.request.method", "line_number": 21, "usage_type": "attribute" }, { "api_name": "flask.req...
8161266589
import streamlit as st import numpy as np st.header("""App to pick the largest number from three inputs""") #Get Input st.header('User Input Parameters') def user_input_features(): No1 = st.number_input("Enter First Number",min_value=0,step=1) No2 = st.number_input("Enter Second Number",min_value=0,step=1) ...
sander-cohen/example
main.py
main.py
py
561
python
en
code
0
github-code
18
[ { "api_name": "streamlit.header", "line_number": 5, "usage_type": "call" }, { "api_name": "streamlit.header", "line_number": 8, "usage_type": "call" }, { "api_name": "streamlit.number_input", "line_number": 11, "usage_type": "call" }, { "api_name": "streamlit.numb...
26630976058
#!/usr/bin/env python """ """ import dpkt import datetime import socket import json def read_config(): with open("pod.cfg") as f: return json.load(f) def ip_to_str(address): """Print out an IP address given a string Args: address: the string representation of a MAC address Returns: ...
Mattlk13/pod
pcap/pod_pcap.py
pod_pcap.py
py
1,886
python
en
code
1
github-code
18
[ { "api_name": "json.load", "line_number": 12, "usage_type": "call" }, { "api_name": "socket.inet_ntop", "line_number": 22, "usage_type": "call" }, { "api_name": "socket.AF_INET", "line_number": 22, "usage_type": "attribute" }, { "api_name": "dpkt.ethernet.Ethernet...
43392688938
import os import logging import subprocess import math import time from string import Template from parsl.execution_provider.execution_provider_base import ExecutionProvider from parsl.execution_provider.slurm.template import template_string import parsl.execution_provider.error as ep_error logger = logging.getLogger(...
benhg/job-classification
data-generation/scripts/benisstupid.py
benisstupid.py
py
10,346
python
en
code
1
github-code
18
[ { "api_name": "logging.getLogger", "line_number": 11, "usage_type": "call" }, { "api_name": "subprocess.Popen", "line_number": 31, "usage_type": "call" }, { "api_name": "subprocess.PIPE", "line_number": 33, "usage_type": "attribute" }, { "api_name": "subprocess.PI...
24426884212
import cv2 import numpy as np import os from pdf2image import convert_from_path class Pdf2Jpg: def __init__(self, base_output_path=None) -> None: self.base_output_path = base_output_path def get_file_paths(self, input_path): file_paths = os.listdir(input_path) file_paths = [f for f in...
ldidone/parisur_eci_uba
pdf2jpg.py
pdf2jpg.py
py
1,468
python
en
code
0
github-code
18
[ { "api_name": "os.listdir", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path.isfile", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path", "line_number": 13, "usage_type": "attribute" }, { "api_name": "pdf2image.convert_from_path", ...
33595531400
import os import pandas as pd import datetime as dt import subprocess as sp from TData_lib import to_zorro_t6_compatible_csv, rename_files, make_new_name, extended_in all_years = [2019, 2020, 2021] coin_subset = [] take_all_source_files = True convert_Source_to_zoroCSV = False convert_zoroCSV_to_t6 = convert_Sou...
qtests/tardis_data
get_bin_spot.py
get_bin_spot.py
py
2,381
python
en
code
0
github-code
18
[ { "api_name": "os.path.exists", "line_number": 29, "usage_type": "call" }, { "api_name": "os.path", "line_number": 29, "usage_type": "attribute" }, { "api_name": "os.makedirs", "line_number": 30, "usage_type": "call" }, { "api_name": "os.path.exists", "line_nu...
72157235560
import torch import torch.nn as nn from torch.utils.data import Dataset, DataLoader, random_split import pandas as pd from tqdm import tqdm from ast import literal_eval import matplotlib.pyplot as plt class PlaneDataset(Dataset): def __init__(self, filename): self.data = pd.read_csv(filename) def __le...
ikmartin/ising-clustering
oneshot/plane_ml.py
plane_ml.py
py
3,577
python
en
code
0
github-code
18
[ { "api_name": "torch.utils.data.Dataset", "line_number": 9, "usage_type": "name" }, { "api_name": "pandas.read_csv", "line_number": 11, "usage_type": "call" }, { "api_name": "torch.tensor", "line_number": 18, "usage_type": "call" }, { "api_name": "ast.literal_eval...
7667549546
from django.shortcuts import render from rest_framework.views import APIView from rest_framework.response import Response from core.models import ( Category, Brand, Seller, Warranty, Discount, Product ) from core.api.serializers import ( CategorySerializer, BrandSerializer, Seller...
tasnimferdous/Qtec
core/api/views.py
views.py
py
631
python
en
code
0
github-code
18
[ { "api_name": "rest_framework.views.APIView", "line_number": 25, "usage_type": "name" }, { "api_name": "core.models.Product.objects.all", "line_number": 27, "usage_type": "call" }, { "api_name": "core.models.Product.objects", "line_number": 27, "usage_type": "attribute" ...
39025554735
from __future__ import print_function import argparse import os, sys import random import torch import torch.nn as nn import torch.nn.parallel import torch.backends.cudnn as cudnn import torch.optim as optim import torch.utils.data from torch.autograd import Variable import torch.nn.functional as F import skimage impor...
HKBU-HPML/FADNet
kitti_submission.py
kitti_submission.py
py
5,496
python
en
code
127
github-code
18
[ { "api_name": "argparse.ArgumentParser", "line_number": 26, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", "line_number": 45, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 45, "usage_type": "attribute" }, { "api_name": "os.pa...
34768747926
import zmq import time print('''#### pyzmq stats sink ####''') ## parameters N_MSG_PLOT = 1000 # print one line after a certain amount of msgs received context = zmq.Context() SUB_socket = context.socket(zmq.SUB) SUB_socket.connect("tcp://127.0.0.1:1235") SUB_socket.setsockopt_string(zmq.SUBSCRIBE, "") # subscr...
flecksi/zmqstuff
python/pyzmq_stats_sink.py
pyzmq_stats_sink.py
py
853
python
en
code
0
github-code
18
[ { "api_name": "zmq.Context", "line_number": 9, "usage_type": "call" }, { "api_name": "zmq.SUB", "line_number": 11, "usage_type": "attribute" }, { "api_name": "zmq.SUBSCRIBE", "line_number": 13, "usage_type": "attribute" }, { "api_name": "time.time", "line_numb...
14408560327
from ETL.transform import TransformaClientes,TransformaFornecedores,TransformaFTImpontualidade,TransformaFTVendas,TransformaProdutos,TransformaTempo,TransformaTiposVendas from ETL.limpar import LimparBase import timeit from connection.connect import engine, metadata import sqlalchemy as sa dm_clientes = sa.Table('DM_C...
brennoliveira/ETL
Vendas/ETL/load.py
load.py
py
5,340
python
pt
code
0
github-code
18
[ { "api_name": "sqlalchemy.Table", "line_number": 7, "usage_type": "call" }, { "api_name": "connection.connect.metadata", "line_number": 7, "usage_type": "argument" }, { "api_name": "connection.connect.engine", "line_number": 7, "usage_type": "name" }, { "api_name"...
17841783209
from generators.prand import LCG_CLS from scipy import stats import matplotlib.pyplot as plt import numpy as np from collections import Counter # class Game: # """ # Deprecated class don't use/read # """ # def __init__(self) -> None: # results = {} # sum_enabled = True # def playe...
11jolek11/simulation
first/dice.py
dice.py
py
3,407
python
en
code
1
github-code
18
[ { "api_name": "generators.prand.LCG_CLS", "line_number": 55, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.subplots", "line_number": 71, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 71, "usage_type": "name" }, { "api_name": ...
39793751309
import json import os import SimpleITK as sitk from pipeline.constants import DirectoryStructure as ds, FileNames as fn from pipeline.logger import log from pipeline.util import sitk_bbox def slice_location(organ: str, segmentation_file: str = None) -> None: if organ == 'multiecho_liver': if ds.nifti.ex...
recoh/pipeline
pipeline/sanity.py
sanity.py
py
5,510
python
en
code
13
github-code
18
[ { "api_name": "pipeline.constants.DirectoryStructure.nifti.exists", "line_number": 13, "usage_type": "call" }, { "api_name": "pipeline.constants.DirectoryStructure.nifti", "line_number": 13, "usage_type": "attribute" }, { "api_name": "pipeline.constants.DirectoryStructure", "...
74515539240
from discord.ext import commands import discord import time import psutil class Ping (commands.Cog): def __init__(self, bot): self.bot = bot @commands.command() async def ping(self,ctx): start_time = time.monotonic() msg = await ctx.send("📡 Pinging...") latency = (time.mo...
Crypt06545/Discord-bot-Nexus-
commands/ping.py
ping.py
py
1,367
python
en
code
0
github-code
18
[ { "api_name": "discord.ext.commands.Cog", "line_number": 6, "usage_type": "attribute" }, { "api_name": "discord.ext.commands", "line_number": 6, "usage_type": "name" }, { "api_name": "time.monotonic", "line_number": 13, "usage_type": "call" }, { "api_name": "time....
26121509060
from emailfinder.extractor import * import csv,openpyxl import pandas as pd #Excel creation excel=openpyxl.Workbook() sheet=excel.active sheet.title='Email List' sheet.append(['Domain Name','Email']) domain_list=[] #read data from csv with open('email.csv',encoding='utf-8-sig') as csvfile: reader...
mrnithish/Prospectss-Core
Bulk Domain Email/BulkDomainEmail.py
BulkDomainEmail.py
py
948
python
en
code
0
github-code
18
[ { "api_name": "openpyxl.Workbook", "line_number": 6, "usage_type": "call" }, { "api_name": "csv.DictReader", "line_number": 16, "usage_type": "call" } ]
11894338382
from flask import Flask, render_template, request import sqlite3 as sql app = Flask(__name__) @app.route('/') def new_present(): return render_template('present.html') @app.route('/present',methods = ['POST', 'GET']) def present(): if request.method == 'POST': try: gift = request.form['gift'...
dipenich2019/scholarshp
env/populate_present.py
populate_present.py
py
995
python
en
code
0
github-code
18
[ { "api_name": "flask.Flask", "line_number": 4, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 10, "usage_type": "call" }, { "api_name": "flask.request.method", "line_number": 14, "usage_type": "attribute" }, { "api_name": "flask.requ...
28136983495
import os from nuitka.importing.Importing import getPackageSearchPath, isPackageDir from nuitka.plugins.Plugins import Plugins from nuitka.utils.AppDirs import getCacheDir from nuitka.utils.FileOperations import listDir, makePath from nuitka.utils.Hashing import Hash, getStringHash from nuitka.utils.Importing import g...
shahadcho/Advanced-Keylogger-using-nuitka-pyinstaller
forpyinstaller/env/Lib/site-packages/nuitka/Caching.py
Caching.py
py
3,462
python
en
code
0
github-code
18
[ { "api_name": "os.path.join", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path", "line_number": 15, "usage_type": "attribute" }, { "api_name": "nuitka.utils.AppDirs.getCacheDir", "line_number": 15, "usage_type": "call" }, { "api_name": "nuitka.uti...
11201359404
import psycopg2 from io import StringIO import pandas as pd class Connection(): def __init__(self): # Подключение к БД отеля self.conn = psycopg2.connect( host="host", database="database", user="username", password="password" ) def collec...
katnotkat/university_projects
thesis/implementation/db_connection.py
db_connection.py
py
4,678
python
ru
code
0
github-code
18
[ { "api_name": "psycopg2.connect", "line_number": 8, "usage_type": "call" }, { "api_name": "psycopg2.DatabaseError", "line_number": 33, "usage_type": "attribute" }, { "api_name": "psycopg2.DatabaseError", "line_number": 60, "usage_type": "attribute" }, { "api_name"...
1986654115
import pandas as pd import numpy as np import matplotlib.pyplot as plt from collections import Counter import scipy.stats as stats import random # The get_arr function returns an aggregated array binned to the specified number of bins. def get_arr(data_list, bin_size_num, rounding=0): min_val = min(data...
Brendan6475/STAT463FinalProject
STAT463 Final Project/Final Project Bootstrap.py
Final Project Bootstrap.py
py
6,097
python
en
code
0
github-code
18
[ { "api_name": "pandas.read_csv", "line_number": 45, "usage_type": "call" }, { "api_name": "numpy.asarray", "line_number": 47, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.hist", "line_number": 50, "usage_type": "call" }, { "api_name": "matplotlib.pyplo...
8569164817
from flask import Flask, render_template, request, redirect import plotly import plotly.graph_objs as go from faceit_stats import player_stat import json import asyncio app = Flask(__name__) @app.route("/", methods=("GET", "POST")) def post_form(): if request.method == "POST": nickname = request.form['n...
vdilchenko/faceit_project
app.py
app.py
py
1,442
python
en
code
0
github-code
18
[ { "api_name": "flask.Flask", "line_number": 9, "usage_type": "call" }, { "api_name": "flask.request.method", "line_number": 13, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 13, "usage_type": "name" }, { "api_name": "flask.request.form...
24117023284
from robobrowser import RoboBrowser def is_id_form(form): return "id" in form.attrs and form.attrs['id'] == "fm1" class NetmagisClient(object): url = None # Netmagis's URL casurl = None # CAS's URL br = None # the browser reference c = None s = None def __init__(self, url, ca...
moobyfr/netmagis-tools
scripts/netmagisclient/netmagisclient.py
netmagisclient.py
py
4,673
python
en
code
2
github-code
18
[ { "api_name": "robobrowser.RoboBrowser", "line_number": 19, "usage_type": "call" } ]
29741245526
from pykingas import MieKinGas, bcolors, suppress_stdout from scipy.constants import Boltzmann import numpy as np import sys # Exit codes 2*** # Second digit identifies test function, third and fourth digit identifies specific test kin = MieKinGas.MieKinGas('AR,C1') sigma = kin.sigma_ij[0, 0] T, g, b = 300, 2, 7.5 *...
thermotools/KineticGas
pykingas/tests/mie_unittests.py
mie_unittests.py
py
6,968
python
en
code
3
github-code
18
[ { "api_name": "pykingas.MieKinGas.MieKinGas", "line_number": 9, "usage_type": "call" }, { "api_name": "pykingas.MieKinGas", "line_number": 9, "usage_type": "name" }, { "api_name": "numpy.linspace", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.em...
33300968425
from pathlib import Path import shutil import numpy as np from scipy.signal import argrelmin import angle_test as AT import create_inputs as CI import rec_io from rec_io import PATH_BASE import rec_utils as utils def all_angles(): clig, cprot, etot, edef, echem, einit, seq = AT.load_results(PATH_BASE.joinpath("...
jomimc/RecProt
Src/python/setup_mech.py
setup_mech.py
py
2,098
python
en
code
0
github-code
18
[ { "api_name": "angle_test.load_results", "line_number": 15, "usage_type": "call" }, { "api_name": "rec_io.PATH_BASE.joinpath", "line_number": 15, "usage_type": "call" }, { "api_name": "rec_io.PATH_BASE", "line_number": 15, "usage_type": "name" }, { "api_name": "nu...
4402586159
"""empty message Revision ID: 3f43e3d39346 Revises: b22e5138a938 Create Date: 2021-03-17 22:59:29.105121 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '3f43e3d39346' down_revision = 'b22e5138a938' branch_labels = None depends_on = None def upgrade(): # ...
app-sre/dashdotdb
migrations/versions/3f43e3d39346_.py
3f43e3d39346_.py
py
1,919
python
en
code
8
github-code
18
[ { "api_name": "alembic.op.create_table", "line_number": 21, "usage_type": "call" }, { "api_name": "alembic.op", "line_number": 21, "usage_type": "name" }, { "api_name": "sqlalchemy.Column", "line_number": 22, "usage_type": "call" }, { "api_name": "sqlalchemy.Integ...
16905585105
# Create your views here. import json from django.contrib.auth import login, authenticate from django.contrib.auth.models import User from django.http import JsonResponse from django.views.generic.base import View from rest_framework.authtoken.models import Token from .auth import ExpiringTokenAuthentication from .mo...
sincerely1/visio-system
后端代码/user/views.py
views.py
py
7,777
python
en
code
0
github-code
18
[ { "api_name": "django.views.generic.base.View", "line_number": 14, "usage_type": "name" }, { "api_name": "json.loads", "line_number": 17, "usage_type": "call" }, { "api_name": "django.contrib.auth.authenticate", "line_number": 20, "usage_type": "call" }, { "api_na...
21819959486
''' implemnetation of edge and normal losses ''' import numpy as np import tensorflow as tf from .utils import sparse2tfsparse, TriNormalsScaled, TriNormals def edge_loss_calc(pred, gt, vpe): ''' Calculate edge loss measured by difference in the length args: pred: prediction, [batch size, num_vert...
qianlim/CAPE
lib/losses.py
losses.py
py
4,252
python
en
code
289
github-code
18
[ { "api_name": "tensorflow.gather", "line_number": 21, "usage_type": "call" }, { "api_name": "tensorflow.norm", "line_number": 23, "usage_type": "call" }, { "api_name": "tensorflow.reduce_mean", "line_number": 25, "usage_type": "call" }, { "api_name": "tensorflow.c...
17940527642
from PyQt5 import QtWidgets as QTW,\ QtGui as QTG, \ QtCore as QTC import os, sys import pickle as pk import nosel, part0, part1, part2, success DOW_TO_INT = {"mon": 0, # Day of the week to integer index "tue": 1, "wed": 2, "thu": 3, ...
mqt0312/metit-scheduler
scheduler.py
scheduler.py
py
7,251
python
en
code
0
github-code
18
[ { "api_name": "PyQt5.QtWidgets.QDialog", "line_number": 43, "usage_type": "attribute" }, { "api_name": "PyQt5.QtWidgets", "line_number": 43, "usage_type": "name" }, { "api_name": "nosel.Ui_Dialog", "line_number": 43, "usage_type": "attribute" }, { "api_name": "PyQ...
3346150454
from flask import jsonify, session from api.dao.user import User from api.util.utilities import Utilities class UserHandler: @staticmethod def getAllUsers(): try: users = User.getAllUsers() result_list = [] for user in users: result_list.append(Uti...
uprm-inso-4116-2020-2021-S1/semester-project-team-f
covid-tracking-app-backend/api/handler/user.py
user.py
py
4,748
python
en
code
0
github-code
18
[ { "api_name": "api.dao.user.User.getAllUsers", "line_number": 12, "usage_type": "call" }, { "api_name": "api.dao.user.User", "line_number": 12, "usage_type": "name" }, { "api_name": "api.util.utilities.Utilities.to_dict", "line_number": 15, "usage_type": "call" }, { ...