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
9294254942
## This module from StreamAnimations import utils, sprite from StreamAnimations.sprite import hitbox from StreamAnimations.canvases import SinglePageCanvas from StreamAnimations.engine.renderers.gif import GifRenderer from StreamAnimations.engine import utils as engineutils from StreamAnimations.systems import twodimen...
AdamantLife/StreamAnimations
sample.py
sample.py
py
3,312
python
en
code
0
github-code
36
[ { "api_name": "pathlib.Path", "line_number": 13, "usage_type": "call" }, { "api_name": "StreamAnimations.utils.import_spritesheet", "line_number": 22, "usage_type": "call" }, { "api_name": "StreamAnimations.utils", "line_number": 22, "usage_type": "name" }, { "api...
16574355106
import collections import heapq from typing import List class Solution: def maxProbability(self, n: int, edges: List[List[int]], succProb: List[float], start: int, end: int) -> float: adj = collections.defaultdict(list) for i in range(len(edges)): src, dst = edges[i] adj[sr...
BLANK00ANONYMOUS/PythonProjects
Leetcode Daily Challenges/14_feb_2023.py
14_feb_2023.py
py
759
python
en
code
0
github-code
36
[ { "api_name": "typing.List", "line_number": 7, "usage_type": "name" }, { "api_name": "collections.defaultdict", "line_number": 8, "usage_type": "call" }, { "api_name": "heapq.heappop", "line_number": 18, "usage_type": "call" }, { "api_name": "heapq.heappush", ...
11394835592
''' Script to export PASCAL VOC 2012 annotation data in VIA format Author: Abhishek Dutta <adutta@robots.ox.ac.uk> 12 Apr. 2018 ''' import xmltodict import os import json base_dir = '/data/datasets/voc2012/VOCdevkit/VOC2012/' img_dir = os.path.join(base_dir, 'JPEGImages/') ann_dir = os.path.join(base_dir, 'Annotatio...
ox-vgg/via
via-2.x.y/scripts/import/pascal_voc/exp_annotations.py
exp_annotations.py
py
3,496
python
en
code
184
github-code
36
[ { "api_name": "os.path.join", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path", "line_number": 13, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path", "line_number": 1...
14992228919
from flask import Flask from flask import request from urllib.parse import urlencode import requests import json server = Flask(__name__) api_key = "AIzaSyAWtsz4ALYdHQJKRSeGv-invChqgL7tAFs" @server.route('/location') def location(): city_name = request.values.get('city-name') data_type = "json" endpoint = f"https:...
KJS89/Wuduplz
Web mining/final/locationList.py
locationList.py
py
1,190
python
en
code
2
github-code
36
[ { "api_name": "flask.Flask", "line_number": 7, "usage_type": "call" }, { "api_name": "flask.request.values.get", "line_number": 12, "usage_type": "call" }, { "api_name": "flask.request.values", "line_number": 12, "usage_type": "attribute" }, { "api_name": "flask.r...
7037221042
from flask import Flask,render_template,request import tweepy import re import pandas as pd from tweepy import OAuthHandler from nltk.corpus import stopwords from nltk.tokenize import TweetTokenizer from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.model_selection import train_test_split from skl...
saurabhc104/sentiment_analysis
analysis.py
analysis.py
py
3,670
python
en
code
0
github-code
36
[ { "api_name": "pandas.read_csv", "line_number": 17, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 18, "usage_type": "call" }, { "api_name": "nltk.corpus.stopwords.words", "line_number": 25, "usage_type": "call" }, { "api_name": "nltk.cor...
18583370851
from pygame.locals import * import figures import pygame import random import sys types = [figures.Square, figures.Line] class Game: def __init__(self, window=(500, 500), speed=5, block=20, fps=20): pygame.init() pygame.display.set_caption("Tetrissss") self.WINDOW_SIZE = ...
Clapsouille/Tetris
main.py
main.py
py
5,526
python
en
code
0
github-code
36
[ { "api_name": "figures.Square", "line_number": 7, "usage_type": "attribute" }, { "api_name": "figures.Line", "line_number": 7, "usage_type": "attribute" }, { "api_name": "pygame.init", "line_number": 13, "usage_type": "call" }, { "api_name": "pygame.display.set_ca...
418860871
import sys import json import logging import argparse import select import time import logs.server_log_config from socket import socket, AF_INET, SOCK_STREAM, SOL_SOCKET, SO_REUSEADDR from common.variables import ACTION, PRESENCE, TIME, USER, ACCOUNT_NAME, RESPONSE, \ MESSAGE, MESSAGE_TEXT, ERROR, DEFAULT_PORT, MAX...
Shorokhov-A/repo_client-server-apps_python
practical_task_7/server.py
server.py
py
5,881
python
ru
code
0
github-code
36
[ { "api_name": "logging.getLogger", "line_number": 15, "usage_type": "call" }, { "api_name": "common.variables.ACTION", "line_number": 30, "usage_type": "name" }, { "api_name": "common.variables.PRESENCE", "line_number": 30, "usage_type": "name" }, { "api_name": "c...
33406629366
""" Main Neural Network Pipeline. """ #-------------------------- set gpu using tf ---------------------------# import tensorflow as tf config = tf.ConfigProto() config.gpu_options.allow_growth = True session = tf.Session(config=config) #------------------- start importing keras module ---------------------# from ke...
ghunkins/Binaural-Source-Localization-CNN
Neural_Net/v3/neuralnet.py
neuralnet.py
py
2,940
python
en
code
9
github-code
36
[ { "api_name": "tensorflow.ConfigProto", "line_number": 6, "usage_type": "call" }, { "api_name": "tensorflow.Session", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path.abspath", "line_number": 25, "usage_type": "call" }, { "api_name": "os.path", ...
41585106305
import json # # Data to be written # dictionary = { # "hello":"lol" # } # # Serializing json # json_object = json.dumps(dictionary, indent=4) # Writing to sample.json # with open("sample.json", "a") as outfile: # outfile.write(json_object) filename="sample.json" entry={'hello','lol1'} with open(filename, ...
AugeGottes/Yet-Another-Kafka
test.py
test.py
py
484
python
en
code
0
github-code
36
[ { "api_name": "json.load", "line_number": 17, "usage_type": "call" }, { "api_name": "json.dump", "line_number": 22, "usage_type": "call" } ]
1685939480
import pandas as pd import geopandas as gpd from sqlalchemy import create_engine from shapely.geometry import box from SGIS.api import SGISRequest from credentials.database import AP CSV = '/Users/dongookson/Code/data-project/SGIS/key_locations/ad8.csv' QUERY = 'select * from key_locations' GET = False # connect to ...
donny-son/airhealth-database
SGIS/test_geocode.py
test_geocode.py
py
1,276
python
en
code
0
github-code
36
[ { "api_name": "sqlalchemy.create_engine", "line_number": 14, "usage_type": "call" }, { "api_name": "credentials.database.AP", "line_number": 14, "usage_type": "argument" }, { "api_name": "pandas.read_csv", "line_number": 18, "usage_type": "call" }, { "api_name": "...
8379980336
from sys import argv from panda3d.core import Vec3 from pandac.PandaModules import loadPrcFileData loadPrcFileData('configurate', 'window-title Loading') from direct.directbase import DirectStart from direct.task import Task from direct.actor.Actor import Actor from direct.gui.DirectGui import * from pandac.PandaModule...
ronanwow1001/Toontown-1
Landwalker Example.py
Landwalker Example.py
py
63,531
python
en
code
0
github-code
36
[ { "api_name": "pandac.PandaModules.loadPrcFileData", "line_number": 4, "usage_type": "call" }, { "api_name": "direct.actor.Actor.Actor", "line_number": 371, "usage_type": "call" }, { "api_name": "direct.controls.GravityWalker.GravityWalker", "line_number": 427, "usage_typ...
14570657497
from kivy.app import App from kivy.uix.widget import Widget from kivy.uix.button import Button from kivy.uix.relativelayout import RelativeLayout from kivy.uix.label import Label from kivy.uix.textinput import TextInput from kivy.graphics import Color, Line, Rectangle from image_to_text import get_text, train_model im...
ShantanuShinde/Character-Recognition-with-CNN
Character Recognition App/paintapp.py
paintapp.py
py
3,519
python
en
code
0
github-code
36
[ { "api_name": "kivy.uix.relativelayout.RelativeLayout", "line_number": 14, "usage_type": "name" }, { "api_name": "kivy.graphics.Color", "line_number": 21, "usage_type": "call" }, { "api_name": "kivy.graphics.Rectangle", "line_number": 23, "usage_type": "call" }, { ...
13768273606
from os import stat from flask import Flask, Response from flask_restx import Resource, Api, reqparse import random import json import os from werkzeug.exceptions import BadHost, BadRequest app = Flask(__name__) api = Api(app) #Cette route va permettre de retourner la valeur +1 @api.route('/plus_one/<int:number>') ...
eparisLR/FLASK-RESTX
api.py
api.py
py
3,444
python
en
code
0
github-code
36
[ { "api_name": "flask.Flask", "line_number": 11, "usage_type": "call" }, { "api_name": "flask_restx.Api", "line_number": 12, "usage_type": "call" }, { "api_name": "flask_restx.Resource", "line_number": 17, "usage_type": "name" }, { "api_name": "flask_restx.Resource...
22216786293
import bpy import bmesh import os #function for changing the topology of the object by triangulating it def triangulate_object(obj): me = obj.data # Get a BMesh representation bm = bmesh.new() bm.from_mesh(me) bmesh.ops.triangulate(bm, faces=bm.faces[:], quad_method=0, ngon_method=0) # Finis...
whorticulterist/RotationSimulation
blender objects/python_scripts/Initial_Individual_Processing.py
Initial_Individual_Processing.py
py
2,397
python
en
code
0
github-code
36
[ { "api_name": "bmesh.new", "line_number": 10, "usage_type": "call" }, { "api_name": "bmesh.ops.triangulate", "line_number": 13, "usage_type": "call" }, { "api_name": "bmesh.ops", "line_number": 13, "usage_type": "attribute" }, { "api_name": "bpy.path.basename", ...
41145576381
from calendar import c from pyexpat import model from re import L import numpy as np import pandas as pd compas_scores_raw= pd.read_csv("compas_score_raw.csv", lineterminator='\n') compas_scores_two_year= pd.read_csv("compas_scores_two_years.csv", lineterminator='\n') print('-----------------Compas Score...
dansmith5764/A-study-of-fairness-in-transfer-learning
Compas/Parse_1.py
Parse_1.py
py
7,675
python
en
code
0
github-code
36
[ { "api_name": "pandas.read_csv", "line_number": 9, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.shape", "line_number": 33, "usage_type": "call" }, { "api_name": "pandas.to_datetime", "...
38875746376
import torch import torch.nn as nn from torch.utils.cpp_extension import load import os import time import random import math cur_path = os.path.dirname(os.path.realpath(__file__)) cpu_unsorted_segsum = load('cpu_unsorted_segsum', [f'{cur_path}/cpu_extension.cc'], extra_cflags=['-fopenmp', '-O3', '-march=nati...
medav/meshgraphnets-torch
kernels/unsorted_segsum/kernel.py
kernel.py
py
4,483
python
en
code
6
github-code
36
[ { "api_name": "os.path.dirname", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "os.path.realpath", "line_number": 10, "usage_type": "call" }, { "api_name": "torch.utils.cpp_extensi...
36947640459
from __future__ import print_function __revision__ = "src/engine/SCons/Tool/FortranCommon.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan" import re import os.path import SCons.Action import SCons.Defaults import SCons.Scanner.Fortran import SCons.Tool import SCons.Util def isfortran(env, so...
mongodb/mongo
src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Tool/FortranCommon.py
FortranCommon.py
py
9,651
python
en
code
24,670
github-code
36
[ { "api_name": "os.path.path.splitext", "line_number": 29, "usage_type": "call" }, { "api_name": "os.path.path", "line_number": 29, "usage_type": "attribute" }, { "api_name": "os.path", "line_number": 29, "usage_type": "name" }, { "api_name": "re.compile", "lin...
30374326803
import numpy as np from scipy.special import expit def piston_action(alfa, p_linea, p_servicio): alfa %= 2 * np.pi return (p_servicio - p_linea) * expit((alfa - np.pi) * 20) def build_indep( alfa: np.float32, beta: np.float32, omega: np.float32, mb: np.float32, mp: np.float32, R: np....
hanzy1110/paper_fem_bombas
src/solve.py
solve.py
py
3,065
python
en
code
0
github-code
36
[ { "api_name": "numpy.pi", "line_number": 6, "usage_type": "attribute" }, { "api_name": "scipy.special.expit", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.pi", "line_number": 7, "usage_type": "attribute" }, { "api_name": "numpy.float32", "lin...
25048960763
from Crypto.Cipher import AES # AES (all modes) from Crypto.Util import Counter # AES CTR from os import urandom # AES CBC or CTR #from Crypto import Random # AES CBC or CTR #Random.get_random_bytes(16) # AES CBC or CTR from Crypto.Cipher import PKCS1_OAEP # RSA from Crypto.PublicKey import RSA #...
chusanapunn/RSA_AY3T2
A1/aeR.py
aeR.py
py
4,658
python
en
code
0
github-code
36
[ { "api_name": "Crypto.PublicKey.RSA.generate", "line_number": 45, "usage_type": "call" }, { "api_name": "Crypto.PublicKey.RSA", "line_number": 45, "usage_type": "name" }, { "api_name": "Crypto.PublicKey.RSA.importKey", "line_number": 52, "usage_type": "call" }, { ...
34376075705
from django.conf.urls import patterns, include, url from django.contrib import admin from django.contrib.auth.views import login, logout from django.views.generic.edit import CreateView import views admin.autodiscover() urlpatterns = patterns( '', url(r'^admin/', include(admin.site.urls)), # url('^', inc...
jonathantumulak/facebookwall
facebookwall/src/facebookwall/facebookwall/urls.py
urls.py
py
689
python
en
code
0
github-code
36
[ { "api_name": "django.contrib.admin.autodiscover", "line_number": 8, "usage_type": "call" }, { "api_name": "django.contrib.admin", "line_number": 8, "usage_type": "name" }, { "api_name": "django.conf.urls.patterns", "line_number": 10, "usage_type": "call" }, { "ap...
43346932566
import datetime from discord import client, Message import aiohttp import random import time import typing import json import humanize import discord from discord.ext import commands start_time = time.time() intents = discord.Intents.default() bot = commands.Bot(command_prefix="!", intents=discord.Intents.all()) ff...
v1ss0nd/vsndbot-Discord
bot.py
bot.py
py
9,975
python
en
code
0
github-code
36
[ { "api_name": "time.time", "line_number": 12, "usage_type": "call" }, { "api_name": "discord.Intents.default", "line_number": 13, "usage_type": "call" }, { "api_name": "discord.Intents", "line_number": 13, "usage_type": "attribute" }, { "api_name": "discord.ext.co...
32194079583
import time import os import sqlite3 import mysql.connector import json import utils.normalize_data import git import importlib def process_requests(): maria_conn = None lite_conn = None try: maria_cnf_FD = open('db_conf.json') maria_cnf = json.load(maria_cnf_FD) maria_cnf_...
mathieu-bergeron/aquiletour2021
dockers/git/depot_manager/task_processor.py
task_processor.py
py
3,103
python
en
code
0
github-code
36
[ { "api_name": "json.load", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path.isdir", "line_number": 18, "usage_type": "call" }, { "api_name": "os.path", "line_number": 18, "usage_type": "attribute" }, { "api_name": "sqlite3.connect", "line_numb...
36335146377
import json, sys, time, os import requests as rq import soundcloud as sc id = "ql3NWDyvuRgjpzwArS8lYmm2SrVGYLDz" scurl = "https://api-v2.soundcloud.com/" qcliid = "?client_id=ql3NWDyvuRgjpzwArS8lYmm2SrVGYLDz" client = sc.Client(client_id=id) class Track: def __init__(self, inp): data = json.loads(resolve(inp...
idosyncrasi/soundcloud-dl
main.py
main.py
py
4,200
python
en
code
0
github-code
36
[ { "api_name": "soundcloud.Client", "line_number": 9, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 13, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 33, "usage_type": "call" }, { "api_name": "requests.get", "line_num...
73593036584
from django.urls import path from django.contrib.auth.views import LoginView, LogoutView from .views import home_view, account_view, meal_view, order_view, report_view, sign_up_view, add_meal_view, edit_meal_view app_name = 'restaurant' urlpatterns = [ path('', home_view, name='home'), path('sign-up/', sign_u...
AmarjotSingh21/food-delivery-django
restaurant/urls.py
urls.py
py
882
python
en
code
0
github-code
36
[ { "api_name": "django.urls.path", "line_number": 8, "usage_type": "call" }, { "api_name": "views.home_view", "line_number": 8, "usage_type": "argument" }, { "api_name": "django.urls.path", "line_number": 9, "usage_type": "call" }, { "api_name": "views.sign_up_view...
70911809705
import os import sys import re import json import math import argparse import time import subprocess import numpy as np import networkx as nx import tensorflow as tf import datetime from operator import itemgetter import collections FILE_PATH = os.path.dirname(os.path.abspath(__file__)) FATHER_PATH = os.path.join(FILE...
luke28/DNE
tools/get_input.py
get_input.py
py
2,670
python
en
code
8
github-code
36
[ { "api_name": "os.path.dirname", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path", "line_number": 16, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path.join", "line...
4108004877
from collections import deque from sys import stdin, exit input = stdin.readline num, h = [int(x) for x in input().split()] grid = [[int(x) for x in input().split()] for _ in range(num)] visited = [[False] * num for _ in range(num)] visited[0][0] = True moves = [[1, 0], [0, 1], [-1, 0], [0, -1]] queue = deque() queue...
AAZZAZRON/DMOJ-Solutions
dmopc13c3p3.py
dmopc13c3p3.py
py
679
python
en
code
1
github-code
36
[ { "api_name": "sys.stdin.readline", "line_number": 3, "usage_type": "attribute" }, { "api_name": "sys.stdin", "line_number": 3, "usage_type": "name" }, { "api_name": "collections.deque", "line_number": 11, "usage_type": "call" }, { "api_name": "sys.exit", "lin...
34385049617
""" Code for computing SW distances between PDs [1]_ of point cloud summaries of activations Notes ----- Relevant section : Experiments with PH Relevant library : `Persim` [2]_ References ---------- .. [1] Carrière, M.; Cuturi, M.; and Oudot, S. 2017. Sliced Wasserstein Kernel for Persistence Diagrams. In Precup...
pnnl/DeepDataProfiler
papers_with_code/ExperimentalObservations/AAAI-code-PH/SW_distances.py
SW_distances.py
py
4,209
python
en
code
20
github-code
36
[ { "api_name": "numpy.zeros", "line_number": 50, "usage_type": "call" }, { "api_name": "persim.sliced_wasserstein", "line_number": 53, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 60, "usage_type": "call" }, { "api_name": "persim.sliced_wasse...
18760515421
import numpy as np import cv2 import screeninfo import oa_ls def init_proj(window_name, screen_id): screen = screeninfo.get_monitors()[screen_id] width, height = screen.width, screen.height cv2.moveWindow(window_name, screen.x -1, screen.y-1) cv2.setWindowProperty(window_name, cv2.WND_PROP_FULLSCREEN,...
olaals/multivision-depr
multivision/oa_realapi.py
oa_realapi.py
py
699
python
en
code
0
github-code
36
[ { "api_name": "screeninfo.get_monitors", "line_number": 7, "usage_type": "call" }, { "api_name": "cv2.moveWindow", "line_number": 10, "usage_type": "call" }, { "api_name": "cv2.setWindowProperty", "line_number": 11, "usage_type": "call" }, { "api_name": "cv2.WND_P...
31701293102
import os import importlib from collections import OrderedDict from .utils import (SettingsLoader, ProjectSettings, ThemeSettings, ShareData, PathResolver, SysPathContextManager) from .protocol import PluginRegister from .sequence_analyze import SequenceParser class SettingsProcedure: @clas...
huntzhan/GeekCMS
geekcms/loadup.py
loadup.py
py
4,407
python
en
code
5
github-code
36
[ { "api_name": "utils.ShareData.load_data", "line_number": 16, "usage_type": "call" }, { "api_name": "utils.ShareData", "line_number": 16, "usage_type": "name" }, { "api_name": "utils.SettingsLoader", "line_number": 20, "usage_type": "call" }, { "api_name": "utils....
33540908783
import logging from typing import List import funppy def sum(*args): result = 0 for arg in args: result += arg return result def sum_ints(*args: List[int]) -> int: result = 0 for arg in args: result += arg return result def sum_two_int(a: int, b: int) -> int: return a + ...
httprunner/hrp
examples/debugtalk.py
debugtalk.py
py
1,315
python
en
code
83
github-code
36
[ { "api_name": "typing.List", "line_number": 13, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 25, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 31, "usage_type": "name" }, { "api_name": "logging.warning", "line_numbe...
5600126262
import boto3 import json import logging import os from base64 import b64decode from urllib.request import Request, urlopen from urllib.error import URLError, HTTPError SLACK_CHANNEL = '#general' HOOK_URL = 'https://hooks.slack.com/services/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' logger = logging.getLogger() log...
ManuelGago/VodChallenge
vodchallenge/error_to_slack.py
error_to_slack.py
py
1,195
python
en
code
1
github-code
36
[ { "api_name": "logging.getLogger", "line_number": 12, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 13, "usage_type": "attribute" }, { "api_name": "json.loads", "line_number": 18, "usage_type": "call" }, { "api_name": "urllib.request.Request...
17237472456
#키와 몸무게로 성별 classification import numpy as np import matplotlib.pyplot as plt from sklearn import neighbors, datasets from sklearn import svm from sklearn.discriminant_analysis import LinearDiscriminantAnalysis file=open('gender_dataset.txt') gender=[] height=[] weight=[] print("▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆...
hoony6134/kaist
gender.py
gender.py
py
4,612
python
en
code
0
github-code
36
[ { "api_name": "sklearn.svm.SVC", "line_number": 80, "usage_type": "call" }, { "api_name": "sklearn.svm", "line_number": 80, "usage_type": "name" }, { "api_name": "sklearn.svm.SVC", "line_number": 82, "usage_type": "call" }, { "api_name": "sklearn.svm", "line_n...
23124927437
from django.conf.urls import patterns, include, url from rest_framework.routers import DefaultRouter from blog import views router = DefaultRouter() router.register(r'post', views.PostViewSet) router.register(r'category', views.CategoryViewSet) urlpatterns = patterns('', url(r'^', include(router.urls)), url(...
PolarIt/myblog
myblog/urls.py
urls.py
py
398
python
en
code
1
github-code
36
[ { "api_name": "rest_framework.routers.DefaultRouter", "line_number": 5, "usage_type": "call" }, { "api_name": "blog.views.PostViewSet", "line_number": 6, "usage_type": "attribute" }, { "api_name": "blog.views", "line_number": 6, "usage_type": "name" }, { "api_name...
6418206467
import logging from datetime import datetime from flask import request from flask_mail import Mail, Message from service.schemas import MessageSchema, EmailSchema from service.models import tr_messages, tm_emails from service import db, app from service.tasks.task_email import email_users def saveMessage(data): t...
robinraintama/flask_email
service/controllers/MessageController.py
MessageController.py
py
3,148
python
en
code
0
github-code
36
[ { "api_name": "datetime.datetime.now", "line_number": 17, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 17, "usage_type": "name" }, { "api_name": "service.models.tr_messages.Messages", "line_number": 22, "usage_type": "call" }, { "api_n...
7424990082
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Harmonia's Kärcher # Fixes surnäme items in ä mässive wäy. import json from SPARQLWrapper import SPARQLWrapper, JSON import requests from bs4 import BeautifulSoup def getWDcontent(item): sparql.setQuery(""" SELECT DISTINCT ?lang ?label ?description WHERE {{ ...
Ash-Crow/scrapers
harmonias-karcher.py
harmonias-karcher.py
py
4,238
python
en
code
3
github-code
36
[ { "api_name": "SPARQLWrapper.JSON", "line_number": 29, "usage_type": "argument" }, { "api_name": "json.load", "line_number": 61, "usage_type": "call" }, { "api_name": "SPARQLWrapper.SPARQLWrapper", "line_number": 78, "usage_type": "call" }, { "api_name": "requests...
15134640368
import codecs import logging import pandas as pd from ekorpkit import eKonf log = logging.getLogger(__name__) class BaseInfo: Keys = eKonf.Keys def __init__(self, **args): self.args = eKonf.to_config(args) self._initialized = False def __str__(self): classname = self.__class__....
entelecheia/ekorpkit
ekorpkit/info/column.py
column.py
py
12,331
python
en
code
4
github-code
36
[ { "api_name": "logging.getLogger", "line_number": 6, "usage_type": "call" }, { "api_name": "ekorpkit.eKonf.Keys", "line_number": 11, "usage_type": "attribute" }, { "api_name": "ekorpkit.eKonf", "line_number": 11, "usage_type": "name" }, { "api_name": "ekorpkit.eKo...
19655830809
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on 03/03/2021 @author: phongdk """ import os from datetime import datetime import icecream DATA_DIR = os.getenv('DATA_DIR', '/shared_storage/bi_mlearn_training/coccoc_shopping') DATA_FILENAME = f'{DATA_DIR}/data/shopee_sample.pkl' DOC2VEC_FILENAME = f"{DATA_D...
phongdk92/shopping_retrieval
src/config.py
config.py
py
1,703
python
en
code
0
github-code
36
[ { "api_name": "os.getenv", "line_number": 12, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 19, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 19, "usage_type": "name" }, { "api_name": "icecream.ic.configu...
43303443334
#! /usr/bin/env python import colorsys def hsv2ansi(h, s, v): # h: 0..1, s/v: 0..1 if s < 0.1: return int(v * 23) + 232 r, g, b = map(lambda x: int(x * 5), colorsys.hsv_to_rgb(h, s, v)) return 16 + (r * 36) + (g * 6) + b def ramp_idx(i, num): assert num > 0 i0 = float(i) / num h = ...
mozillazg/pypy
rpython/tool/ansiramp.py
ansiramp.py
py
742
python
en
code
430
github-code
36
[ { "api_name": "colorsys.hsv_to_rgb", "line_number": 8, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 27, "usage_type": "attribute" }, { "api_name": "py.io.ansi_print", "line_number": 29, "usage_type": "call" } ]
3685343845
import numpy as np import os import six.moves.urllib as urllib import sys import tarfile import tensorflow as tf import zipfile import json from collections import defaultdict from io import StringIO from PIL import Image import requests from lib.helpers import DatabaseConnector as dtb from lib import label_map_util f...
MatthieuBlais/tensorflow-clothing-detection
obj_detection.py
obj_detection.py
py
6,828
python
en
code
11
github-code
36
[ { "api_name": "PIL.Image.open", "line_number": 39, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 39, "usage_type": "name" }, { "api_name": "tensorflow.Graph", "line_number": 125, "usage_type": "call" }, { "api_name": "tensorflow.GraphDef", ...
30838795713
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Nov 11 18:11:32 2021 @author: mathisagathe """ from pymongo import MongoClient import matplotlib.pyplot as plt client = MongoClient("10.35.7.4", username = "mathis", password = "MathisM21", authsource = "mathisdb") db=client.mathisdb collection = d...
romanelollier/School_Project_BigData
requetes_mod.py
requetes_mod.py
py
1,536
python
fr
code
0
github-code
36
[ { "api_name": "pymongo.MongoClient", "line_number": 13, "usage_type": "call" } ]
34987281436
import torch import torch.nn as nn from methods.ein_seld.data_augmentation import spec_augment_ from methods.ein_seld.data_augmentation import spec_augment, channel_rotation from methods.utils.stft import (STFT, LogmelFilterBank, intensityvector, spectrogram_STFTInput) import numpy as np...
saraalrawi/EIN-SELD
seld/methods/feature.py
feature.py
py
8,022
python
en
code
1
github-code
36
[ { "api_name": "torch.nn.Module", "line_number": 18, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 18, "usage_type": "name" }, { "api_name": "methods.utils.stft.STFT", "line_number": 35, "usage_type": "call" }, { "api_name": "methods.utils.s...
74169633702
import logging import os import uuid from io import BytesIO from typing import Sequence from zipfile import ZIP_DEFLATED, ZipFile import anndata as ad import dramatiq from fastapi import APIRouter, Depends, File, Form, HTTPException, UploadFile from fastapi.responses import ORJSONResponse from matplotlib.colors import...
BodenmillerGroup/histocat-web
backend/histocat/api/dataset/controller.py
controller.py
py
5,914
python
en
code
5
github-code
36
[ { "api_name": "logging.getLogger", "line_number": 26, "usage_type": "call" }, { "api_name": "fastapi.APIRouter", "line_number": 27, "usage_type": "call" }, { "api_name": "sqlalchemy.orm.Session", "line_number": 34, "usage_type": "name" }, { "api_name": "histocat.c...
36121027603
import logging import sys import torch import yaml from tagging_trainer import TaggingTrainer from forte.common.configuration import Config logger = logging.getLogger(__name__) logging.basicConfig(level=logging.INFO) if __name__ == "__main__": task = sys.argv[1] assert task in ["ner", "pos"], "Not supported...
asyml/forte
examples/tagging/main_train_tagging.py
main_train_tagging.py
py
1,785
python
en
code
230
github-code
36
[ { "api_name": "logging.getLogger", "line_number": 10, "usage_type": "call" }, { "api_name": "logging.basicConfig", "line_number": 11, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 11, "usage_type": "attribute" }, { "api_name": "sys.argv", ...
23297663163
import pathlib import pandas as pd from model import dez datadir = pathlib.Path(__file__).parents[0].joinpath('data') def test_populate_solution_land_distribution(): expected = pd.read_csv(datadir.joinpath('lbt_ocean_dist.csv'), index_col=0) de = dez.DEZ('Limiting bottom trawling') # We freeze applicabl...
ProjectDrawdown/solutions
model/tests/test_dez.py
test_dez.py
py
634
python
en
code
203
github-code
36
[ { "api_name": "pathlib.Path", "line_number": 5, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 9, "usage_type": "call" }, { "api_name": "model.dez.DEZ", "line_number": 10, "usage_type": "call" }, { "api_name": "model.dez", "line_number...
75009815143
import asyncio import logging from random import randint from src.streaming import Consumer, Producer, Topic LOGGER = logging.getLogger(__name__) GROUP_ID = "WEBSITE_NER" async def amain(): """Consume website changes, produce NER results.""" consumer = await Consumer.create(Topic.CHANGE.value, group_id=G...
SebastianRemander/eda-demo
src/producers/website_ner.py
website_ner.py
py
1,060
python
en
code
1
github-code
36
[ { "api_name": "logging.getLogger", "line_number": 8, "usage_type": "call" }, { "api_name": "src.streaming.Consumer.create", "line_number": 16, "usage_type": "call" }, { "api_name": "src.streaming.Consumer", "line_number": 16, "usage_type": "name" }, { "api_name": ...
42831133132
#!/usr/bin/env python3 import struct import json import sys def write_tileset(filename, spec): with open(spec['base'], 'rb') as src: base_data = src.read() with open(spec['overlay'], 'rb') as src: overlay_data = src.read() if 'cc2' in spec: with open(spec['cc2'], 'rb') as src: ...
zrax/cctools
res/gen_tilesets.py
gen_tilesets.py
py
1,323
python
en
code
18
github-code
36
[ { "api_name": "struct.pack", "line_number": 21, "usage_type": "call" }, { "api_name": "struct.pack", "line_number": 23, "usage_type": "call" }, { "api_name": "struct.pack", "line_number": 25, "usage_type": "call" }, { "api_name": "struct.pack", "line_number": ...
40943554690
import sys import ruamel from ruamel.yaml import YAML from datetime import datetime, date, time from common import * import fileinput class NonAliasingRTRepresenter(ruamel.yaml.RoundTripRepresenter): def ignore_aliases(self, data): return True def main(): out = {'races': []} yaml = YAML(typ='sa...
pkdawson/workrobot
new_schedule.py
new_schedule.py
py
2,605
python
en
code
0
github-code
36
[ { "api_name": "ruamel.yaml", "line_number": 9, "usage_type": "attribute" }, { "api_name": "ruamel.yaml.YAML", "line_number": 17, "usage_type": "call" }, { "api_name": "datetime.date.today", "line_number": 21, "usage_type": "call" }, { "api_name": "datetime.date", ...
26672929841
#!/usr/bin/env python import argparse import itertools import pandas as pd def getCmdArgs(): p = argparse.ArgumentParser(description="Add scenes in neighboring rows of scenes in a given scene ID list.") p.add_argument("-l", "--list", dest="scn_list", required=True, default=None, metavar="CSV_OF_SCENE_LIST",...
zhanlilz/landsat-tools
landsat-albedo-pipeline/buffer_scene_list.py
buffer_scene_list.py
py
3,074
python
en
code
3
github-code
36
[ { "api_name": "argparse.ArgumentParser", "line_number": 9, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 40, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 44, "usage_type": "call" }, { "api_name": "itertools.izi...
21885184448
""" Device discovery """ import enum import re from dataclasses import asdict, dataclass from queue import Empty, Queue from socket import inet_ntoa from typing import Dict, Generator, List, Optional import click import requests import usb from zeroconf import ServiceBrowser, ServiceInfo, ServiceStateChange, Zeroconf...
BrewBlox/brewblox-ctl
brewblox_ctl/discovery.py
discovery.py
py
7,942
python
en
code
3
github-code
36
[ { "api_name": "enum.Enum", "line_number": 27, "usage_type": "attribute" }, { "api_name": "dataclasses.dataclass", "line_number": 45, "usage_type": "name" }, { "api_name": "dataclasses.dataclass", "line_number": 56, "usage_type": "name" }, { "api_name": "typing.Opt...
9817120997
import itertools import os import pandas as pd import pickle import random import torch from torchvision import datasets from tqdm import tqdm from scipy import rand import data_handler from models import AlexNet, Vgg16 def generate_model_testset_results(model, testset_path): """ Evaluate whole 'imagenetv2-m...
tlabarta/helpfulnessofxai
experiment_creator.py
experiment_creator.py
py
7,853
python
en
code
0
github-code
36
[ { "api_name": "torchvision.datasets.ImageFolder", "line_number": 23, "usage_type": "call" }, { "api_name": "torchvision.datasets", "line_number": 23, "usage_type": "name" }, { "api_name": "tqdm.tqdm", "line_number": 27, "usage_type": "call" }, { "api_name": "os.se...
42157253168
"""empty message Revision ID: c4665b8d682b Revises: 10dbb0e0a903 Create Date: 2019-12-26 14:38:11.609539 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = 'c4665b8d682b' down_revision = '10dbb0e0a903' branch_labels = None depends_on = None def upgrade(): # ...
FeelingsLw/flask_demo2
migrations/versions/c4665b8d682b_.py
c4665b8d682b_.py
py
646
python
en
code
0
github-code
36
[ { "api_name": "alembic.op.add_column", "line_number": 21, "usage_type": "call" }, { "api_name": "alembic.op", "line_number": 21, "usage_type": "name" }, { "api_name": "sqlalchemy.Column", "line_number": 21, "usage_type": "call" }, { "api_name": "sqlalchemy.Integer...
74953743465
"""Unit tests for the config module.""" import os import pytest from wmtmetadata.config import Config, ConfigFromFile, ConfigFromHost from wmtmetadata.host import HostInfo from . import data_dir tmp_dir = '/tmp' sample_config_file = os.path.join(data_dir, 'wmt-config-siwenna.yaml') host = 'siwenna.colorado.edu' name...
csdms/wmt-metadata
wmtmetadata/tests/test_config.py
test_config.py
py
1,593
python
en
code
0
github-code
36
[ { "api_name": "os.path.join", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path", "line_number": 11, "usage_type": "attribute" }, { "api_name": "wmtmetadata.config.Config", "line_number": 18, "usage_type": "call" }, { "api_name": "wmtmetadata.confi...
19483517480
''' 函数说明: Author: hongqing Date: 2021-08-04 14:23:54 LastEditTime: 2021-08-04 15:23:25 ''' import torch import torch.nn as nn import torch.nn.functional as F import numpy as np numoffinger=21 class Net(nn.Module): def __init__(self,type=1): super(Net, self).__init__() self.fc1 = nn.Linear(numoffing...
KouseiHongqing/KouseiPose
mymodel.py
mymodel.py
py
1,095
python
en
code
0
github-code
36
[ { "api_name": "torch.nn.Module", "line_number": 12, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 12, "usage_type": "name" }, { "api_name": "torch.nn.Linear", "line_number": 15, "usage_type": "call" }, { "api_name": "torch.nn", "line_nu...
17541630757
import glob import os import random import shutil import numpy as np import torch import torch.nn as nn import torchvision.transforms.v2 as T def set_seed(seed: int = 42): """Sets the seed for reproducibility.""" random.seed(seed) np.random.seed(seed) os.environ["PYTHONHASHSEED"] = str(seed) torc...
xkurozaru/fewshot-finetune-domain-adaptation
common/utils.py
utils.py
py
1,761
python
en
code
0
github-code
36
[ { "api_name": "random.seed", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.random.seed", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 15, "usage_type": "attribute" }, { "api_name": "os.environ", "lin...
16879280056
import requests import json import urllib3 from settings import settings as settings from sdwan_operations import monitor as sdwanmn import time import sys, getopt urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) def main(argv): # To run the program use the syntax: # python __main__.py -d <...
stantiku/sdwan_monitor
__main__.py
__main__.py
py
2,117
python
en
code
0
github-code
36
[ { "api_name": "urllib3.disable_warnings", "line_number": 9, "usage_type": "call" }, { "api_name": "urllib3.exceptions", "line_number": 9, "usage_type": "attribute" }, { "api_name": "getopt.getopt", "line_number": 18, "usage_type": "call" }, { "api_name": "getopt.G...
27414823832
import logging import os from copy import deepcopy from harmony.util import shortened_id from harmony.repository_state import RepositoryState logger = logging.getLogger(__name__) def commit(local_location_id, working_directory, location_states, repository_state): """ Scan the given working directory for cha...
Droggelbecher/harmony
harmony/file_state_logic.py
file_state_logic.py
py
9,182
python
en
code
0
github-code
36
[ { "api_name": "logging.getLogger", "line_number": 9, "usage_type": "call" }, { "api_name": "harmony.util.shortened_id", "line_number": 42, "usage_type": "call" }, { "api_name": "harmony.repository_state.RepositoryState", "line_number": 163, "usage_type": "call" }, { ...
5058919782
from django.db import models # Create your models here. class Meal(models.Model): menu = models.TextField(blank=True) def __str__(self): return self.menu class MealList(models.Model): date = models.DateField(blank=True) breakfast = models.ForeignKey( Meal, blank=True, ...
KaceTH/django_api-0.00.90
MealTable/models.py
models.py
py
1,139
python
en
code
0
github-code
36
[ { "api_name": "django.db.models.Model", "line_number": 6, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 6, "usage_type": "name" }, { "api_name": "django.db.models.TextField", "line_number": 7, "usage_type": "call" }, { "api_name": "...
7595057258
from os import path from subprocess import check_output, check_call from pathlib import Path def _filename(fname): import yapl yapl_root = Path(yapl.__file__).parent filename = fname + ".sh" full_filename = yapl_root / filename return str(full_filename) def func(fname, *args): shell_script = _...
padresmurfa/yapl
python_library/yapl/internal/shell_call.py
shell_call.py
py
613
python
en
code
0
github-code
36
[ { "api_name": "pathlib.Path", "line_number": 7, "usage_type": "call" }, { "api_name": "yapl.__file__", "line_number": 7, "usage_type": "attribute" }, { "api_name": "subprocess.check_output", "line_number": 15, "usage_type": "call" }, { "api_name": "subprocess.chec...
1904857127
from scipy import linalg import numpy as np import scipy.optimize as sopt import matplotlib.pyplot as plt from scipy.optimize import fsolve from scipy.optimize import LinearConstraint from matplotlib import cm import tabulate import math START_POINT = [2,2] # fun - main muction def fun(x: np.ndarray) -> np.float64: ...
BON4/FuncOptimization
constarint_optimization.py
constarint_optimization.py
py
6,464
python
en
code
0
github-code
36
[ { "api_name": "numpy.ndarray", "line_number": 14, "usage_type": "attribute" }, { "api_name": "numpy.float64", "line_number": 14, "usage_type": "attribute" }, { "api_name": "numpy.ndarray", "line_number": 18, "usage_type": "attribute" }, { "api_name": "numpy.float6...
73202366184
import os, sys from langchain.llms import OpenAI from langchain.chains.question_answering import load_qa_chain from langchain.embeddings.openai import OpenAIEmbeddings from langchain.vectorstores import FAISS prefix, query = sys.argv[1:3] api_key = os.environ.get('OPENAI_API_KEY') if api_key is None: sys.exit("O...
d2jvkpn/x-ai
pkg/langchain/langchain_query.py
langchain_query.py
py
833
python
en
code
0
github-code
36
[ { "api_name": "sys.argv", "line_number": 8, "usage_type": "attribute" }, { "api_name": "os.environ.get", "line_number": 10, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 10, "usage_type": "attribute" }, { "api_name": "sys.exit", "line_numb...
4758110469
import os, random import numpy as np import torch import argparse from train import train def init_seeds(seed=0): random.seed(seed) np.random.seed(seed) torch.manual_seed(seed) torch.cuda.manual_seed(seed) torch.cuda.manual_seed_all(seed) def parsing_args(c): parser = argparse.ArgumentParser(...
cool-xuan/msflow
main.py
main.py
py
2,580
python
en
code
15
github-code
36
[ { "api_name": "random.seed", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.random.seed", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 10, "usage_type": "attribute" }, { "api_name": "torch.manual_seed", ...
35090835676
#!/usr/bin/python ###################################################################################### ## Find disk usage under a root directory, examples: ## 1. python du_rootdir.py -d rootDir ## Find disk usage under the root directory "rootDir" ## 2. python du_rootdir.py -d rootDir -r true ## Find di...
zhichang-guo/Scripts
du_rootdir.py
du_rootdir.py
py
2,785
python
en
code
0
github-code
36
[ { "api_name": "os.listdir", "line_number": 23, "usage_type": "call" }, { "api_name": "os.path.isdir", "line_number": 25, "usage_type": "call" }, { "api_name": "os.path", "line_number": 25, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number...
38869163941
from pathlib import Path import pandas as pd from sklearn.metrics import make_scorer, accuracy_score, f1_score, roc_auc_score from imblearn.metrics import geometric_mean_score, sensitivity_score, specificity_score def get_slovak_data(business_area, year, postfix): print("Loading Slovak data...") path_bankrupt ...
kanasz/TabNet
src/base_functions.py
base_functions.py
py
1,548
python
en
code
0
github-code
36
[ { "api_name": "pathlib.Path", "line_number": 8, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 10, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 13, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_...
74731484265
import torch from torch.optim.optimizer import Optimizer class COCOB(Optimizer): r"""Implements COCOB algorithm. It has been proposed in `Training Deep Networks without Learning Rates Through Coin Betting`_. Arguments: params (iterable): iterable of parameters to optimize or dicts defining ...
bremen79/parameterfree
parameterfree/cocob.py
cocob.py
py
4,274
python
en
code
73
github-code
36
[ { "api_name": "torch.optim.optimizer.Optimizer", "line_number": 4, "usage_type": "name" }, { "api_name": "torch.enable_grad", "line_number": 44, "usage_type": "call" }, { "api_name": "torch.zeros_like", "line_number": 60, "usage_type": "call" }, { "api_name": "tor...
11624227934
import re import sys from napalm import get_network_driver from getpass import getpass def pretty_print(d, indent=0): for key, value in d.items(): print('\t' * indent + str(key)) if isinstance(value, dict): pretty_print(value, indent+1) elif isinstance(value, list): ...
pkomissarov/cisco-parsers
parsecfg.py
parsecfg.py
py
3,480
python
en
code
0
github-code
36
[ { "api_name": "re.findall", "line_number": 75, "usage_type": "call" }, { "api_name": "re.search", "line_number": 80, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 91, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 92, ...
15744632677
import multiprocessing import optparse import os import re from error import InvalidProjectGroupsError from error import NoSuchProjectError from error import RepoExitError from event_log import EventLog import progress # Are we generating man-pages? GENERATE_MANPAGES = os.environ.get("_REPO_GENERATE_MANPAGES_") == "...
GerritCodeReview/git-repo
command.py
command.py
py
17,769
python
en
code
267
github-code
36
[ { "api_name": "os.environ.get", "line_number": 14, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 14, "usage_type": "attribute" }, { "api_name": "os.cpu_count", "line_number": 28, "usage_type": "call" }, { "api_name": "error.RepoExitError", ...
22660738512
# data_processing.py from shapely import wkb from shapely.geometry import shape import binascii import psycopg2 ewkb_data = None def get_variable_ewkb(): global ewkb_data print("variable ewkb") print(ewkb_data) return ewkb_data def process_for_view(data): global ewkb_data # Declare ewkb_da...
Fakhrynm/serverdatatrainingsitepython
Processdataview.py
Processdataview.py
py
1,054
python
en
code
0
github-code
36
[ { "api_name": "shapely.geometry.shape", "line_number": 26, "usage_type": "call" }, { "api_name": "shapely.wkb.dumps", "line_number": 35, "usage_type": "call" }, { "api_name": "shapely.wkb", "line_number": 35, "usage_type": "name" } ]
26246312144
import serial from sense_hat import SenseHat from socket import gethostname from xbee import XBee from statistics import median def clear_matrix(): sense.clear() def show_hostname(): hostname = gethostname() sense.show_message("Hostname: " + hostname) def receive_data(data): print("received data: ", ...
tristndev/UzL_DSN
Tutorial 4/ex04_01_RSSI_to_distance.py
ex04_01_RSSI_to_distance.py
py
4,390
python
en
code
1
github-code
36
[ { "api_name": "socket.gethostname", "line_number": 11, "usage_type": "call" }, { "api_name": "xbee.send", "line_number": 29, "usage_type": "call" }, { "api_name": "statistics.median", "line_number": 41, "usage_type": "call" }, { "api_name": "statistics.median", ...
23006702098
import torch import numpy as np from torch._C import dtype from torch import nn from torch.nn import functional as F from torchvision import transforms from torchvision.transforms import functional as TF class ImageAugmentation(): def __init__(self): super().__init__() """ PepperSaltNoise ...
xmu-xiaoma666/SDATR
models/augmentation.py
augmentation.py
py
6,969
python
en
code
18
github-code
36
[ { "api_name": "numpy.random.rand", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 20, "usage_type": "attribute" }, { "api_name": "torch.full", "line_number": 24, "usage_type": "call" }, { "api_name": "torch.full", "line...
1313517117
from __future__ import print_function import argparse import keras from data_utils import load_data from sklearn.model_selection import train_test_split from model import vgg16 from hyperspace import hyperdrive num_classes = 10 batch_size = 32 epochs = 5 # The data, shuffled and split between train and test sets: ...
yngtodd/vgg_hyper
vgg_hyper/main.py
main.py
py
2,878
python
en
code
0
github-code
36
[ { "api_name": "data_utils.load_data", "line_number": 17, "usage_type": "call" }, { "api_name": "sklearn.model_selection.train_test_split", "line_number": 19, "usage_type": "call" }, { "api_name": "keras.utils.to_categorical", "line_number": 23, "usage_type": "call" }, ...
73368915303
from __future__ import print_function import numpy as np np.random.seed(1337) from itertools import product from sklearn import cluster from sklearn.externals import joblib from keras.datasets import mnist from sklearn.neighbors import KNeighborsClassifier from scipy.misc import imresize from keras.utils import np_util...
jmendozais/lung-nodule-detection
bovw.py
bovw.py
py
12,019
python
en
code
11
github-code
36
[ { "api_name": "numpy.random.seed", "line_number": 3, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 3, "usage_type": "attribute" }, { "api_name": "numpy.empty", "line_number": 26, "usage_type": "call" }, { "api_name": "numpy.double", "lin...
28111130337
from django.db.models import Avg from django.shortcuts import render, redirect from django.contrib import messages from django.contrib.auth.decorators import login_required from django.contrib.auth.models import User from dinnerevent.models import Review from .forms import UserRegisterForm, ProfileForm def register(r...
taheeraahmed/Dinnersharing
middagproj/users/views.py
views.py
py
1,640
python
en
code
0
github-code
36
[ { "api_name": "forms.UserRegisterForm", "line_number": 12, "usage_type": "call" }, { "api_name": "forms.ProfileForm", "line_number": 13, "usage_type": "call" }, { "api_name": "django.contrib.messages.success", "line_number": 21, "usage_type": "call" }, { "api_name...
31310132227
"""Extract KML data into DataFrame.""" from typing import Dict, Sequence, Union import numpy as np import pandas as pd from pykml import parser from pykml.factory import KML_ElementMaker as KML NS = {"t": "http://www.opengis.net/kml/2.2"} def read_kml(filepath: str) -> KML.kml: """Read a KML file. Param...
dankkom/kmldata
kmldata/parser.py
parser.py
py
6,224
python
en
code
0
github-code
36
[ { "api_name": "pykml.parser.parse", "line_number": 29, "usage_type": "call" }, { "api_name": "pykml.parser", "line_number": 29, "usage_type": "name" }, { "api_name": "pykml.factory.KML_ElementMaker.kml", "line_number": 15, "usage_type": "attribute" }, { "api_name"...
22654441124
from matplotlib.colors import ListedColormap from sklearn import neighbors, datasets import numpy as np from matplotlib import pyplot as plt from sklearn.neural_network import MLPClassifier from sklearn.model_selection import train_test_split # same process as svm np.random.seed(0) iris = datasets.load_iris() X = iris...
fh-Zh/Classification.old
bpnn.py
bpnn.py
py
1,918
python
en
code
0
github-code
36
[ { "api_name": "numpy.random.seed", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 9, "usage_type": "attribute" }, { "api_name": "sklearn.datasets.load_iris", "line_number": 10, "usage_type": "call" }, { "api_name": "sklearn....
7078437282
import os import base64 import argparse from cliff.command import Command from cliff.show import ShowOne from cliff.lister import Lister from meteoroid_cli.meteoroid.v1.client.function_client import FunctionClient from meteoroid_cli.meteoroid.v1.errors import CommandError from meteoroid_cli.meteoroid.v1.libs.decorator...
OkinawaOpenLaboratory/fiware-meteoroid-cli
meteoroid_cli/meteoroid/v1/function.py
function.py
py
7,858
python
en
code
5
github-code
36
[ { "api_name": "os.path.splitext", "line_number": 50, "usage_type": "call" }, { "api_name": "os.path", "line_number": 50, "usage_type": "attribute" }, { "api_name": "base64.b64encode", "line_number": 52, "usage_type": "call" }, { "api_name": "meteoroid_cli.meteoroi...
23420270770
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import datetime from django.utils.timezone import utc class Migration(migrations.Migration): dependencies = [ ('stock', '0088_auto_20160620_1304'), ] operations = [ migrations.Create...
pmmrpy/SIGB
stock/migrations/0089_auto_20160622_1414.py
0089_auto_20160622_1414.py
py
2,301
python
es
code
0
github-code
36
[ { "api_name": "django.db.migrations.Migration", "line_number": 9, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 9, "usage_type": "name" }, { "api_name": "django.db.migrations.CreateModel", "line_number": 16, "usage_type": "call" }, ...
6688406212
from langchain.chat_models import ChatOpenAI from langchain.output_parsers import PydanticOutputParser from langchain.prompts import ChatPromptTemplate from pydantic import BaseModel, Field from dotenv import load_dotenv from typing import List import pandas as pd import os # loading api key and defining vars load_d...
oresttokovenko/gpt-anki
src/generate_flashcards.py
generate_flashcards.py
py
2,043
python
en
code
9
github-code
36
[ { "api_name": "dotenv.load_dotenv", "line_number": 13, "usage_type": "call" }, { "api_name": "os.environ.get", "line_number": 14, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 14, "usage_type": "attribute" }, { "api_name": "os.environ.get", ...
27875338483
import json import requests from openerp.tests.common import HttpCase from openerp import api, exceptions, tools, models HOST = '127.0.0.1' PORT = tools.config['xmlrpc_port'] class Webhook(models.Model): _inherit = 'webhook' @api.one def run_wehook_test_get_foo(self): """ This method i...
Blancorama/blancorama_tools
webhook/tests/test_webhook_post.py
test_webhook_post.py
py
3,596
python
en
code
0
github-code
36
[ { "api_name": "openerp.tools.config", "line_number": 9, "usage_type": "attribute" }, { "api_name": "openerp.tools", "line_number": 9, "usage_type": "name" }, { "api_name": "openerp.models.Model", "line_number": 12, "usage_type": "attribute" }, { "api_name": "opene...
27551610430
import argparse import logging import os import shutil import sys import tarfile import tempfile import traceback from zipfile import ZIP_DEFLATED, ZIP_STORED, ZipFile import rdiffweb from rdiffweb.core.librdiff import LANG, STDOUT_ENCODING, find_rdiff_backup, popen logger = logging.getLogger(__name__) # Increase th...
ikus060/rdiffweb
rdiffweb/core/restore.py
restore.py
py
9,753
python
en
code
114
github-code
36
[ { "api_name": "logging.getLogger", "line_number": 14, "usage_type": "call" }, { "api_name": "tarfile.open", "line_number": 34, "usage_type": "call" }, { "api_name": "tarfile.PAX_FORMAT", "line_number": 34, "usage_type": "attribute" }, { "api_name": "tarfile.open",...
2884786469
# coding:utf-8 # @Time : 2020/4/21 19:18 # @Author: Xiawang # Description: import datetime import time import requests import smtplib from email.mime.text import MIMEText from email.mime.multipart import MIMEMultipart from email.header import Header ''' 用于主流程监控定期执行并发送报警信息 ''' def get_fix_time(): now_time = dat...
Ariaxie-1985/aria
task/send_auto_test_report.py
send_auto_test_report.py
py
7,283
python
en
code
0
github-code
36
[ { "api_name": "datetime.datetime.now", "line_number": 20, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 20, "usage_type": "attribute" }, { "api_name": "datetime.timedelta", "line_number": 21, "usage_type": "call" }, { "api_name": "reque...
33279344042
import requests, json BaseURL = 'https://paper-api.alpaca.markets' OrdersURL = '{}/v2/orders'.format(BaseURL) Headers = {"APCA-API-KEY-ID": "PKU31JDVN0AYRLMI1MEQ", "APCA-API-SECRET-KEY": "LVgw3y2RuffyDAMsjDR2EfscgsokGNTsuSEn3LUb"} def create_order(symbol, qty, side, type, time_in_force): data = { 'symbol'...
Jacob-Kenney/JagBot
4.Buy stocks/Buystocks.py
Buystocks.py
py
534
python
en
code
1
github-code
36
[ { "api_name": "requests.post", "line_number": 16, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 17, "usage_type": "call" } ]
2317503124
import torch import torch.nn as nn import torch.nn.functional as F from core.loss.multi_task import MultiTaskProxy from core.loss.segment import SemanticSegmentation from core.loss.matting import ImageMatting from core.loss.grad import MattingGrad, ImageGradient class JointMattingParsingLoss(nn.Module): def __i...
xinyunmian/matting
core/loss/joint.py
joint.py
py
1,456
python
en
code
0
github-code
36
[ { "api_name": "torch.nn.Module", "line_number": 12, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 12, "usage_type": "name" }, { "api_name": "core.loss.segment.SemanticSegmentation", "line_number": 19, "usage_type": "call" }, { "api_name": "...
6129429499
import argparse from src.gt_merger import constants def get_parser(): parser = argparse.ArgumentParser() parser.add_argument('--obaFile', type=str, required=True, help='Path to CSV file exported from OBA Firebase ' 'Export App') parser.a...
CUTR-at-USF/onebusaway-travel-behavior-analysis
src/gt_merger/args.py
args.py
py
2,668
python
en
code
0
github-code
36
[ { "api_name": "argparse.ArgumentParser", "line_number": 6, "usage_type": "call" }, { "api_name": "src.gt_merger.constants.OUTPUT_DIR", "line_number": 13, "usage_type": "attribute" }, { "api_name": "src.gt_merger.constants", "line_number": 13, "usage_type": "name" }, {...
26825630541
#!/usr/bin/python import numpy as np import matplotlib.pyplot as plt import argparse, os, sys, glob, time from tqdm import tqdm from skimage.transform import resize import cPickle from keras.layers import average from keras.models import load_model, Model from training_utils import scale_data, compute_time_series im...
DominicL3/hey-aliens
simulateFRBclassification/predict.py
predict.py
py
13,210
python
en
code
6
github-code
36
[ { "api_name": "os.environ", "line_number": 23, "usage_type": "attribute" }, { "api_name": "PlotCand_dom.FilReader", "line_number": 27, "usage_type": "call" }, { "api_name": "PlotCand_dom.extractPlotCand", "line_number": 42, "usage_type": "call" }, { "api_name": "n...
20077173649
from django.urls import resolve from rest_framework import status from rest_framework.reverse import reverse from rest_framework.test import APITestCase, APIRequestFactory from cars.models import Car, Manufacturer from cars.serializers import CarGetSerializer from cars.views import CarListCreateView factory = APIRequ...
tomasz-rzesikowski/cars_API
cars/tests/tests_views/tests_car_list_view.py
tests_car_list_view.py
py
1,620
python
en
code
0
github-code
36
[ { "api_name": "rest_framework.test.APIRequestFactory", "line_number": 10, "usage_type": "call" }, { "api_name": "rest_framework.test.APITestCase", "line_number": 13, "usage_type": "name" }, { "api_name": "cars.views.CarListCreateView", "line_number": 15, "usage_type": "ca...
35217198422
import requests from urllib.request import urlopen import urllib from selenium import webdriver from bs4 import BeautifulSoup import http.client from openpyxl import Workbook from openpyxl import load_workbook from openpyxl.writer.excel import ExcelWriter from openpyxl.cell.cell import ILLEGAL_CHARACTERS_RE import json...
Just-Doing/python-caiji
src/work/20210719/tydexoptics.py
tydexoptics.py
py
5,791
python
en
code
1
github-code
36
[ { "api_name": "http.client.client", "line_number": 16, "usage_type": "attribute" }, { "api_name": "http.client", "line_number": 16, "usage_type": "name" }, { "api_name": "urllib.request.build_opener", "line_number": 20, "usage_type": "call" }, { "api_name": "urlli...
31748860310
import numpy as np from timeit import default_timer as timer from numba import vectorize @vectorize(['float32(float32, float32)'], target='cuda') def gpu_pow(a, b): return a ** b @vectorize(['float32(float32, float32)'], target='parallel') def cpu_para_pow(a, b): return a ** b def cpu_pow(a, b, c): fo...
Purdue-Academic-Projects/AI_Final_Project
heart_rate_ai/cuda_test/cuda_tutorial.py
cuda_tutorial.py
py
1,237
python
en
code
0
github-code
36
[ { "api_name": "numba.vectorize", "line_number": 6, "usage_type": "call" }, { "api_name": "numba.vectorize", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.random.sample", ...
34622506671
import os import zipfile from pathlib import Path import warnings from shutil import rmtree import time import pandas as pd import numpy as np import SimpleITK as sitk from tqdm import tqdm from segmentation_metrics import compute_segmentation_scores from survival_metrics import concordance_index class AIcrowdEvalu...
voreille/hecktor
src/aicrowd_evaluator/evaluator.py
evaluator.py
py
11,240
python
en
code
65
github-code
36
[ { "api_name": "pathlib.Path", "line_number": 41, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 43, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 44, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_nu...
75273737705
import tkinter import pyperclip sirka = 500 vyska = 450 data = [] size = [] c = tkinter.Canvas(width=sirka, height=vyska) c.pack() def copy(): cptxt = '(' for i in range(size[1]): cptxt += '0b' + ''.join(str(e) for e in data[i]) + ',' if i == size[1] - 1: cptxt = c...
branislavblazek/notes
Python/projekty/char_creator.py
char_creator.py
py
1,990
python
en
code
0
github-code
36
[ { "api_name": "tkinter.Canvas", "line_number": 9, "usage_type": "call" }, { "api_name": "pyperclip.copy", "line_number": 19, "usage_type": "call" }, { "api_name": "tkinter.Button", "line_number": 67, "usage_type": "call" }, { "api_name": "tkinter.Button", "lin...
18483593432
import random import numpy as np import matplotlib.pyplot as plt from PIL import Image, ImageFilter from torchvision import datasets, transforms class RandomGaussianBlur(object): def __call__(self, image): if random.random() < 0.5: image = image.filter(ImageFilter.GaussianBlur( ...
TWSFar/GhostNet-MNIST
datasets/mnist.py
mnist.py
py
1,738
python
en
code
5
github-code
36
[ { "api_name": "random.random", "line_number": 10, "usage_type": "call" }, { "api_name": "PIL.ImageFilter.GaussianBlur", "line_number": 11, "usage_type": "call" }, { "api_name": "PIL.ImageFilter", "line_number": 11, "usage_type": "name" }, { "api_name": "random.ran...
41826934545
# import sqlite library import sqlite3 # create a database and make a connection. conn = sqlite3.connect("first.db") cursor = conn.cursor() sql = """UPDATE programs SET program_level = 'Master''s' WHERE program_name IN ('Anthropology', 'Biology')""" cursor.execute(sql) sql = """INSERT INTO students(student, id_prog...
Ngue-Um/DHRI-June2018-Courses-databases
scripts/challenge.py
challenge.py
py
430
python
en
code
0
github-code
36
[ { "api_name": "sqlite3.connect", "line_number": 5, "usage_type": "call" } ]
74273514024
import numpy as np import jax from jax import lax, random, numpy as jnp import flax from flax.core import freeze, unfreeze from flax import linen as nn from flax import optim from typing import Any, Callable, Sequence, Optional import pickle from tensorflow import keras file_prefix = "struct" activation = nn.relu...
mselezniova/ntk_beyond_limit
ntk_train_dynamics.py
ntk_train_dynamics.py
py
5,198
python
en
code
0
github-code
36
[ { "api_name": "flax.linen.relu", "line_number": 18, "usage_type": "attribute" }, { "api_name": "flax.linen", "line_number": 18, "usage_type": "name" }, { "api_name": "flax.linen.Module", "line_number": 31, "usage_type": "attribute" }, { "api_name": "flax.linen", ...
73381842664
import matplotlib.pyplot as plt import numpy as np #IMAGEN 1 Imagen='33.jpg' I=plt.imread(Imagen) plt.title('Imagen original') plt.imshow(I) plt.show() rgb = [0.2989, 0.5870, 0.1140] ig = np.dot(I[...,:3], rgb) plt.imshow(ig,cmap='gray') plt.axis('off') plt.savefig('b&w.png',bbox_inches='tight',pad_inches=0,dpi=1200...
BrianCobianS/Capitulo4-Python
rgb.py
rgb.py
py
1,806
python
es
code
0
github-code
36
[ { "api_name": "matplotlib.pyplot.imread", "line_number": 7, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 7, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.title", "line_number": 8, "usage_type": "call" }, { "api_name": "matpl...
70064817065
import jsonschema from API.validation import error_format class Validate_AddChannel(): def __init__(self, data): self.data = data self.schema = { "type": "object", "properties": { "name": {"type": "string"}, "type": {"type": "string"...
OStillman/ODACShows
API/validation/add_channel_validation.py
add_channel_validation.py
py
1,067
python
en
code
0
github-code
36
[ { "api_name": "jsonschema.validate", "line_number": 18, "usage_type": "call" }, { "api_name": "jsonschema.exceptions", "line_number": 20, "usage_type": "attribute" }, { "api_name": "API.validation.error_format.FormatValidationError", "line_number": 22, "usage_type": "call...
8451867993
from collections import deque from collections import namedtuple PairedTasks = namedtuple('PairedTasks', ('task_1', 'task_2')) def compute_task_assignment(task_durations: list): durations = deque(sorted(task_durations)) total_time = 0 while durations: total_time = max(total_time, durations.pople...
kashyapa/coding-problems
epi/revise-daily/6_greedy_algorithms/1_compute_optimum_task_assignment.py
1_compute_optimum_task_assignment.py
py
594
python
en
code
0
github-code
36
[ { "api_name": "collections.namedtuple", "line_number": 4, "usage_type": "call" }, { "api_name": "collections.deque", "line_number": 8, "usage_type": "call" } ]
13549248356
import random import Crypto from Crypto.PublicKey import RSA from Crypto import Random import ast import pyDes from Crypto.Cipher import DES from config import max_input_bit_length import time def OT_transfer(m0,m1,bit): m0=int(m0) m1=int(m1) x0=random.randint(0, 2**1024-1) x1=random.randint(0, 2**1024-1) #loadi...
makeapp007/cryptography
mpc/code/nbit-comparator/ot.py
ot.py
py
2,974
python
en
code
0
github-code
36
[ { "api_name": "random.randint", "line_number": 15, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 16, "usage_type": "call" }, { "api_name": "Crypto.PublicKey.RSA.importKey", "line_number": 27, "usage_type": "call" }, { "api_name": "Crypto.P...
73290357865
import json import numpy as np import matplotlib matplotlib.use('TkAgg') import matplotlib.pyplot as plt # 读取JSON文件 with open('./47_data.json') as f: data = json.load(f) # 将数据转换为NumPy数组 images = np.array(data) # 创建一个2x4的子图,用于显示8张图片 fig, axs = plt.subplots(2, 4) # 迭代显示每张图片 for i, ax in enumerate(axs.flatten()): ...
LazySheeeeep/Trustworthy_AI-Assignments
1/testing_images_showcase.py
testing_images_showcase.py
py
696
python
zh
code
0
github-code
36
[ { "api_name": "matplotlib.use", "line_number": 4, "usage_type": "call" }, { "api_name": "json.load", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 12, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.subplots", "...
21130491503
import psycopg2 from config import host, user, password, db_name try: # подключение к существующей БД connection = psycopg2.connect( host=host, user=user, password=password, database=db_name ) connection.autocommit = True # курсор для предоставления операций над БД ...
Tosic48/pizzeria
main2.py
main2.py
py
3,728
python
ru
code
0
github-code
36
[ { "api_name": "psycopg2.connect", "line_number": 6, "usage_type": "call" }, { "api_name": "config.host", "line_number": 7, "usage_type": "name" }, { "api_name": "config.user", "line_number": 8, "usage_type": "name" }, { "api_name": "config.password", "line_num...
71038363623
import collections import numpy as np from math import pi def log_gaussian_prob(obs, mu, sig): num = (obs - mu) ** 2 denum = 2 * sig ** 2 # norm = 1 / sqrt(2 * pi * sig ** 2) # prob = norm * exp(-num/denum) log_prob = (-num / denum) + 0.5 * (np.log(2) + np.log(pi) + 2 * np.log(sig)) return log_prob clas...
Xiaohong-Deng/algorithms
AIML/gaussianNaiveBayes/classifier.py
classifier.py
py
3,774
python
en
code
0
github-code
36
[ { "api_name": "numpy.log", "line_number": 11, "usage_type": "call" }, { "api_name": "math.pi", "line_number": 11, "usage_type": "argument" }, { "api_name": "collections.defaultdict", "line_number": 20, "usage_type": "call" }, { "api_name": "collections.defaultdict...
29673546988
import boto3 import gzip import json import os from math import ceil from pymongo import MongoClient def load_file(filepath): documents = {} lines = open(filepath, 'r').read().splitlines() for line in lines: columns = line.split('\t') documents[columns[0]] = columns[1] return documents...
edgargaticaCU/DocumentMetadataAPI
data_checker.py
data_checker.py
py
3,767
python
en
code
0
github-code
36
[ { "api_name": "gzip.open", "line_number": 21, "usage_type": "call" }, { "api_name": "math.ceil", "line_number": 34, "usage_type": "call" }, { "api_name": "math.ceil", "line_number": 61, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 84, ...