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
19239212432
import sys input = sys.stdin.readline from collections import deque N = int(input()) pair = [[] for _ in range(N+1)] # 자식, 부모 알 수 없기에 이중 리스트에 둘 다 담아두기 for _ in range(N-1): a, b = map(int, input().split()) pair[a] += [b] pair[b] += [a] visited = [0, 1] + [0] * (N-1) # 자식의 부모 노드를 담아두는 역할을 할 것 parent = deq...
sdh98429/dj2_alg_study
BAEKJOON/tree/b11725.py
b11725.py
py
828
python
ko
code
0
github-code
6
[ { "api_name": "sys.stdin", "line_number": 2, "usage_type": "attribute" }, { "api_name": "collections.deque", "line_number": 15, "usage_type": "call" } ]
2139778094
import os,sys import numpy as np import codecs from pyqtgraph.Qt import QtGui, QtCore import pyqtgraph as pg import pyqtgraph.opengl as gl if len(sys.argv) !=2: print("Usage: afshow x-samples") exit(0) # number of FFT samples x_samples = int(sys.argv[1]) ## Create a GL View widget to display data app = QtGui.QAppl...
NazimAliev/public
embedded/gpu-fft2d-rpi/afshow.py
afshow.py
py
1,816
python
en
code
0
github-code
6
[ { "api_name": "sys.argv", "line_number": 8, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 13, "usage_type": "attribute" }, { "api_name": "pyqtgraph.Qt.QtGui.QApplication", "line_number": 16, "usage_type": "call" }, { "api_name": "pyqtgraph....
17195331607
import threading from queue import Empty from .utils import db def call_clsinit(*args, **kwargs): cls = type(*args, **kwargs) cls._clsinit() return cls; class DynamoMasterScheduler(threading.Thread): def __init__(self, input_queue, **kwargs): if "output_queues" in kwargs: kwargs.pop("output_queues...
ganton000/Concurrency
wiki-reader/workers/DynamoWorker.py
DynamoWorker.py
py
1,396
python
en
code
0
github-code
6
[ { "api_name": "threading.Thread", "line_number": 11, "usage_type": "attribute" }, { "api_name": "queue.Empty", "line_number": 25, "usage_type": "name" }, { "api_name": "utils.db.create_table", "line_number": 49, "usage_type": "call" }, { "api_name": "utils.db", ...
36256668865
from flask import Flask, jsonify, request app = Flask(__name__) data = [ { "Contact": '0000000000', "Name": 'Vampire', "done": False, "id": 1 }, { "Contact": "1111111111", "Name": "Zombie", "done": False, "id": 2 } ] @app.route("/app-dat...
Hriddhiman17/Project124
Project124.py
Project124.py
py
634
python
en
code
0
github-code
6
[ { "api_name": "flask.Flask", "line_number": 3, "usage_type": "call" }, { "api_name": "flask.request.json", "line_number": 22, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 22, "usage_type": "name" }, { "api_name": "flask.jsonify", ...
30310784371
import os import tensorflow as tf from config.config_Faster_RCNN import cfg import random import numpy as np import skimage.io from utils.faster_rcnn.anchors import all_anchor_conner, anchor_labels_process import cv2 import xml.etree.ElementTree as ET class preprocess: def __init__(self, is_train=True): #...
kwonsungil/Faster-RCNN
utils/faster_rcnn/load_coco.py
load_coco.py
py
20,271
python
en
code
0
github-code
6
[ { "api_name": "config.config_Faster_RCNN.cfg.num_classes", "line_number": 18, "usage_type": "attribute" }, { "api_name": "config.config_Faster_RCNN.cfg", "line_number": 18, "usage_type": "name" }, { "api_name": "config.config_Faster_RCNN.cfg.data_dir", "line_number": 19, ...
21296040236
# -*- coding: utf-8 -*- from diaryday import* from diarydraw import* #import datetime import calendar import pyecharts from pyecharts import options as opts from pyecharts.charts import Bar, Line, Pie,Grid, Page, WordCloud, Calendar from pyecharts.faker import Faker from pyecharts.globals import ThemeType from pyechar...
NingChenhui/Mirror
diarymonth.py
diarymonth.py
py
11,886
python
en
code
0
github-code
6
[ { "api_name": "pyecharts.globals", "line_number": 14, "usage_type": "attribute" }, { "api_name": "calendar.monthrange", "line_number": 35, "usage_type": "call" }, { "api_name": "pyecharts.charts.Bar", "line_number": 115, "usage_type": "call" }, { "api_name": "pyec...
4931790964
# -*- coding: utf-8 -*- import torch import sys from collections import deque import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from torch.autograd import Variable import numpy as np import cv2 import math import random sys.path.append("game/") import wrapped_flappy_bird as game clas...
wondervictor/DeepQLearning
dqn.py
dqn.py
py
6,088
python
en
code
0
github-code
6
[ { "api_name": "sys.path.append", "line_number": 15, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 15, "usage_type": "attribute" }, { "api_name": "torch.nn.Module", "line_number": 19, "usage_type": "attribute" }, { "api_name": "torch.nn", "li...
43263500213
# Creating a Matrix in Python import matplotlib.pyplot as plt import numpy as np from numpy import linalg as LA, linspace # We use the np.array for matrices n = 5 d1 = np.diag(np.ones(n)*2, k=0) # 5X5 matrix with diagonal 2s d2 = np.diag(np.ones(n-1), k=1) # 5X5 matrix with diagonal 1s shifted right d3 = np.diag(np....
UW-ParksidePhysics/Kliger-Rhett
Problem3_Chapter2_00.py
Problem3_Chapter2_00.py
py
1,001
python
en
code
0
github-code
6
[ { "api_name": "numpy.diag", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.ones", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.diag", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.ones", "line_number": 9, ...
28211497499
# Integrations with other Python libraries import os try: import comet_ml # noqa: F401 _has_comet = True except (ImportError): _has_comet = False try: import wandb wandb.ensure_configured() if wandb.api.api_key is None: _has_wandb = False wandb.termwarn("W&B installed but...
timonziegenbein/sufficiency-assessment-generation
src/repo/transformers/src/transformers/integrations.py
integrations.py
py
1,424
python
en
code
5
github-code
6
[ { "api_name": "wandb.ensure_configured", "line_number": 17, "usage_type": "call" }, { "api_name": "wandb.api", "line_number": 18, "usage_type": "attribute" }, { "api_name": "wandb.termwarn", "line_number": 20, "usage_type": "call" }, { "api_name": "os.getenv", ...
71844575548
import vrep import sys import time import cv2 import numpy as np import math def nothing(x): pass def objectSelection(image_RGB,resolution_RGB): img = np.array(image_RGB, dtype=np.uint8) img.resize([resolution_RGB[0], resolution_RGB[1], 3]) img = np.flipud(img) img = cv2.cvtColor(img, cv2.COLOR_RGB...
KuzMu/A-motion-algorithm-gripper-device-V-Rep-and-Python
Trial_code.py
Trial_code.py
py
14,088
python
ru
code
0
github-code
6
[ { "api_name": "numpy.array", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.uint8", "line_number": 11, "usage_type": "attribute" }, { "api_name": "numpy.flipud", "line_number": 13, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_nu...
38261821771
import ast import json from api_define import person_index from orm import user, main_task, child_task, model_to_dict class PersonIndex(person_index): """ 个人页 {"MyTask":[{ "project":"实验室任务管理", "actor":"组长", "OnePer":"60%" }], "percent":"60%" } """ def entry(self, req...
wangxinyu666666/task_manage
Vue/tornado/person/person_index.py
person_index.py
py
2,058
python
en
code
0
github-code
6
[ { "api_name": "api_define.person_index", "line_number": 7, "usage_type": "name" }, { "api_name": "orm.user.select", "line_number": 27, "usage_type": "call" }, { "api_name": "orm.user", "line_number": 27, "usage_type": "name" }, { "api_name": "orm.user.mainID", ...
18294285256
import numpy as np import itertools import time class StarConstructor: def __init__(self, size=10, star_count=1): self.size = size self.star_positions = [] self.star_count = star_count # all neighbour calculations except [0, 0] self.neighbours_calc = np.array([[i, j] for i,...
MayuriXxx/starbattlesrevive
StarBattlesRev/StarConstructor.py
StarConstructor.py
py
5,575
python
en
code
0
github-code
6
[ { "api_name": "numpy.array", "line_number": 12, "usage_type": "call" }, { "api_name": "itertools.product", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.uint8", "line_num...
22206427575
import numpy as np from tqdm import tqdm import tensorflow as tf from models.mf import mf from models.predictor import predict from evaluation.metrics import evaluate from utils.progress import WorkSplitter from utils.regularizers import Regularizer from scipy.sparse import vstack, lil_matrix from utils.io import sampl...
dgliu/TKDE_KDCRec
LR/models/refine_mf.py
refine_mf.py
py
11,264
python
en
code
2
github-code
6
[ { "api_name": "tensorflow.contrib", "line_number": 20, "usage_type": "attribute" }, { "api_name": "tensorflow.variable_scope", "line_number": 44, "usage_type": "call" }, { "api_name": "tensorflow.placeholder", "line_number": 46, "usage_type": "call" }, { "api_name...
2113655613
import ast import argparse import sys from copy import deepcopy import random exec_lines = list() if_stmt = dict() cond_taken = set() def trace_file_execution(file_name, args): with open(file_name) as f: code = compile(f.read(), file_name, 'exec') def trace_lines(frame, event, arg): if event ==...
potatmen/pycoverage
pcov.py
pcov.py
py
4,265
python
en
code
0
github-code
6
[ { "api_name": "ast.Expression", "line_number": 21, "usage_type": "call" }, { "api_name": "sys.settrace", "line_number": 27, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 28, "usage_type": "attribute" }, { "api_name": "sys.settrace", "line_nu...
73028235387
from django.utils.text import slugify from accounts.models import Account from orders.views import payment from store.models import Product, Variation from orders.models import Order, OrderProduct, Payment from store.views import product_detail from .forms import CategoryForm, ProductForm, OrderForm,VariationForm...
azadranjith/gastyle-e-commerce-app
gaadmin/views.py
views.py
py
8,777
python
en
code
2
github-code
6
[ { "api_name": "django.contrib.auth.authenticate", "line_number": 35, "usage_type": "call" }, { "api_name": "django.contrib.auth", "line_number": 35, "usage_type": "name" }, { "api_name": "django.contrib.auth.login", "line_number": 40, "usage_type": "call" }, { "ap...
33806686855
import os import joblib import argparse import numpy as np import pandas as pd from azureml.core.run import Run from azureml.core import Dataset from sklearn.linear_model import LogisticRegression from sklearn.model_selection import train_test_split def load_data(input_data, ws): # Get the input dataset by name ...
sudipta002/Capstone_Project_Azure_ML_Engineer
train.py
train.py
py
1,725
python
en
code
1
github-code
6
[ { "api_name": "azureml.core.Dataset.get_by_name", "line_number": 15, "usage_type": "call" }, { "api_name": "azureml.core.Dataset", "line_number": 15, "usage_type": "name" }, { "api_name": "sklearn.model_selection.train_test_split", "line_number": 24, "usage_type": "call" ...
5358971033
from django.shortcuts import render,redirect from django.views import View from .models import * from django.contrib.auth.mixins import LoginRequiredMixin from django.contrib import messages from .forms import * from django.urls import reverse_lazy import string import random class AllClass(LoginRequiredMixin,View)...
NijoNinan/Classroom-Manager
TheSchool/classes/views.py
views.py
py
8,199
python
en
code
0
github-code
6
[ { "api_name": "django.contrib.auth.mixins.LoginRequiredMixin", "line_number": 14, "usage_type": "name" }, { "api_name": "django.views.View", "line_number": 14, "usage_type": "name" }, { "api_name": "django.contrib.messages.error", "line_number": 28, "usage_type": "call" ...
33792741895
from django.urls import include, path from . import views as v urlpatterns = [ path('', v.home, name="home"), path('add_item/', v.add_item, name="add_item"), path('edit_item/<task_id>', v.edit_item, name="edit_item"), path('done_task/<task_id>', v.done_task, name="done_task"), path('undone/<task_id...
Sudipta-Trisha/To-do-List
to_do_list/to_do/urls.py
urls.py
py
407
python
en
code
0
github-code
6
[ { "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", ...
26598396071
import pybullet as p import pybullet_data import time physicsClient = p.connect(p.GUI) p.setAdditionalSearchPath(pybullet_data.getDataPath()) p.setGravity(0,0,-10) p_ID = p.loadURDF("plane.urdf") sphere_orien = p.getQuaternionFromEuler([0,0,0]) ######## here, we started the fbonacci series from 1 ... d...
AYUSH-ISHAN/Robo_Camp_Pybullet_Simulations
Week 1/Subpart 3/Fibonacci Series/Week1_Subpart3_BonusTask.py
Week1_Subpart3_BonusTask.py
py
1,227
python
en
code
0
github-code
6
[ { "api_name": "pybullet.connect", "line_number": 5, "usage_type": "call" }, { "api_name": "pybullet.GUI", "line_number": 5, "usage_type": "attribute" }, { "api_name": "pybullet.setAdditionalSearchPath", "line_number": 6, "usage_type": "call" }, { "api_name": "pybu...
72758333308
import json import os from mgba.gba import GBA from shutil import copyfile # KEYMAP = {GBA.KEY_A: 'a', GBA.KEY_B: 'b', GBA.KEY_SELECT: 'select', GBA.KEY_START: 'start', GBA.KEY_RIGHT: 'right', GBA.KEY_LEFT: 'left', GBA.KEY_UP: 'up', GBA.KEY_DOWN: 'down', GBA.KEY_R: 'r', GBA.KEY_L: 'l'} KEY_TURBO = 10 KEY_SETTINGS_NEX...
BFriedrichs/switch-gba
src/backend/layout.py
layout.py
py
833
python
en
code
88
github-code
6
[ { "api_name": "os.path.join", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path", "line_number": 16, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path.join", "line_nu...
18101119164
from unittest import main, TestCase from typing import List class Solution: def maxArea(self, height: List[int]) -> int: max_area, i, j = 0, 0, len(height) - 1 while i < j: # calc area area = min(height[i], height[j]) * (j - i) # update max_area if a...
hirotake111/leetcode_diary
leetcode/container_With_Most_Water/solution.py
solution.py
py
744
python
en
code
0
github-code
6
[ { "api_name": "typing.List", "line_number": 6, "usage_type": "name" }, { "api_name": "unittest.TestCase", "line_number": 22, "usage_type": "name" }, { "api_name": "unittest.main", "line_number": 31, "usage_type": "call" } ]
35925653609
from typing import Optional, Any, Union, Dict import time import matplotlib.pyplot as plt import numpy as np import keras.backend as K import tensorflow.keras as keras import tensorflow as tf import pandas as pd import random # import numpy as np # import keras.backend as K # from keras.layers import Dense, Activation ...
philine-bommer/Climate_X_Quantus
CphXAI/cphxai/src/utils/utilities_network.py
utilities_network.py
py
10,579
python
en
code
0
github-code
6
[ { "api_name": "tensorflow.keras.callbacks", "line_number": 33, "usage_type": "attribute" }, { "api_name": "tensorflow.keras", "line_number": 33, "usage_type": "name" }, { "api_name": "time.time", "line_number": 38, "usage_type": "call" }, { "api_name": "time.time"...
21402429735
import os import argparse import inspect class Configuration: def __init__(self, **kwargs): self.update(kwargs) def update(self, config_options): for k, v in config_options.items(): setattr(self, k, v) def __repr__(self): content = [] for k, v in self.__...
cedricrupb/ctxmutants
config.py
config.py
py
4,047
python
en
code
0
github-code
6
[ { "api_name": "os.path.join", "line_number": 56, "usage_type": "call" }, { "api_name": "os.path", "line_number": 56, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 57, "usage_type": "call" }, { "api_name": "os.path", "line_number": 5...
7899138141
import time import urllib.parse import urllib.request import json from influxdb import InfluxDBClient def queryPrice(srick_id, stock_name): # 初始化 client = InfluxDBClient('localhost', 8086, 'root', '', 'stock') url='https://wechatapp.futu5.com/stock/basic-quote' values = { 'stock_ids': srick_id...
Carty090616/python
stock/utils.py
utils.py
py
2,246
python
en
code
0
github-code
6
[ { "api_name": "influxdb.InfluxDBClient", "line_number": 9, "usage_type": "call" }, { "api_name": "urllib.parse.parse.urlencode", "line_number": 19, "usage_type": "call" }, { "api_name": "urllib.parse.parse", "line_number": 19, "usage_type": "attribute" }, { "api_n...
43786446969
from math import atan2 from enum import Enum from nav_msgs.msg import Path from std_msgs.msg import Bool from geometry_msgs.msg import Point, Twist, PoseWithCovarianceStamped from tf.transformations import euler_from_quaternion import rospy from basic_def import * import numpy a...
KaiChen1008/Sim-to-Real-Virtual-Guidance-for-Robot-Navigation
planner_module/ball_generator.py
ball_generator.py
py
4,687
python
en
code
72
github-code
6
[ { "api_name": "rospy.Subscriber", "line_number": 39, "usage_type": "call" }, { "api_name": "nav_msgs.msg.Path", "line_number": 39, "usage_type": "argument" }, { "api_name": "rospy.Subscriber", "line_number": 40, "usage_type": "call" }, { "api_name": "geometry_msgs...
8413665094
import requests import json from ..common.settings import policy_url, api_url, headers class Policy: def new(self, policy_dict): if type(policy_dict) is dict: self.__dict__ = policy_dict else: print("The Policy object takes an agrument of a dictionary defining the...
Cirorules/volumezsdk
volumezsdk/core/policies.py
policies.py
py
3,123
python
en
code
0
github-code
6
[ { "api_name": "common.settings.headers", "line_number": 19, "usage_type": "name" }, { "api_name": "requests.get", "line_number": 23, "usage_type": "call" }, { "api_name": "common.settings.api_url", "line_number": 23, "usage_type": "name" }, { "api_name": "common.s...
6727955181
#!/usr/bin/env python3 """ Edit feature files by adding a prefix to the file and columns names. This is to make each file unique, which is neccesary to run PoPs. Author - Stijn Arends Date - 15-6-2022 """ import multiprocessing as mp import pandas as pd import os from pathlib import Path import argparse import sys ...
molgenis/benchmark-gwas-prio
prioritization_methods/PoPS/rename_file_contents.py
rename_file_contents.py
py
5,835
python
en
code
0
github-code
6
[ { "api_name": "pathlib.Path", "line_number": 23, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 48, "usage_type": "name" }, { "api_name": "os.rename", "line_number": 59, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number":...
30062005061
import sys import pygame import math import random import time from pygame.locals import * pygame.init() # screen variables screen_width = 1200 screen_height = 600 screen_size = (screen_width, screen_height) # colors black = (0, 0, 0) grey = (94, 92, 92) white = (255, 255, 255) red = (239, 33, 33) # set the screen ...
liangdrew/Glide
pygame_simulation/glider_simulation.py
glider_simulation.py
py
4,299
python
en
code
1
github-code
6
[ { "api_name": "pygame.init", "line_number": 8, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 22, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 22, "usage_type": "attribute" }, { "api_name": "pygame.Surface...
10774941779
from itertools import permutations from collections import deque data = [int(d) for d in open('2019/07-input.txt').read().split(',')] def pad(d): p = '0' * (5 - len(str(d))) + str(d) return map(int, (p[0], p[1], p[2], p[3:])) class IntCodeComputer: pc = 0 data: list = None stdin: deque = None ...
knjmooney/Advent-Of-Code
2019/07-intcode3.py
07-intcode3.py
py
2,816
python
en
code
0
github-code
6
[ { "api_name": "collections.deque", "line_number": 13, "usage_type": "name" }, { "api_name": "collections.deque", "line_number": 14, "usage_type": "call" }, { "api_name": "itertools.permutations", "line_number": 83, "usage_type": "call" }, { "api_name": "collection...
13250365793
# -*- coding: utf-8 -*- from typing import Optional, Callable, Any import jarpc try: import requests except ImportError: requests = None class RequestsTransport: """ Transport to make rpc as HTTP request using requests library. To use this transport you need to install "requests" package. "...
hicebank/jarpc-clients
jarpc_clients/requests_client.py
requests_client.py
py
4,115
python
en
code
0
github-code
6
[ { "api_name": "typing.Optional", "line_number": 24, "usage_type": "name" }, { "api_name": "requests.Session", "line_number": 36, "usage_type": "call" }, { "api_name": "jarpc.JarpcRequest", "line_number": 44, "usage_type": "attribute" }, { "api_name": "typing.Optio...
29669305450
# coding=utf-8 import io from pypise import __version__ from setuptools import find_packages, setup with io.open("README.md", encoding='utf-8') as f: long_description = f.read() setup( name='pypise', version=__version__, description='WebUI automation testing framework based on Selenium and unittest.'...
gerrywen/pypise
setup.py
setup.py
py
978
python
en
code
1
github-code
6
[ { "api_name": "io.open", "line_number": 7, "usage_type": "call" }, { "api_name": "setuptools.setup", "line_number": 10, "usage_type": "call" }, { "api_name": "pypise.__version__", "line_number": 12, "usage_type": "name" }, { "api_name": "setuptools.find_packages",...
40315959615
########################## # Imports ########################## import fileinput import re from itertools import cycle from collections import deque ########################## # Read input - 10 players; last marble is worth 1618 points: high score is 8317 ########################## gameInfo = [] for line in fileinput....
hdd2k/adventOfCode
2018/09/9.py
9.py
py
1,465
python
en
code
2
github-code
6
[ { "api_name": "fileinput.input", "line_number": 13, "usage_type": "call" }, { "api_name": "re.search", "line_number": 14, "usage_type": "call" }, { "api_name": "collections.deque", "line_number": 26, "usage_type": "call" } ]
40673412083
import getopt import logging import os import platform import re import shutil import socket import subprocess import sys import threading import time import webbrowser # Initialize the lock lock = threading.Lock() # Dictionary to maintain k8s services whether they are Running or not k8s_obj_dict = {} # Build context ...
magma/magma
cn/deploy/scripts/mvc1_5g_orc8r_deployment_script.py
mvc1_5g_orc8r_deployment_script.py
py
18,251
python
en
code
1,605
github-code
6
[ { "api_name": "threading.Lock", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 20, "usage_type": "call" }, { "api_name": "os.path", "line_number": 20, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_num...
34804060844
# Code borrowed from: # https://www.edureka.co/blog/web-scraping-with-python/ from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from bs4 import BeautifulSoup from PIL import...
lmendes14/Genre-Predictor
scraper.py
scraper.py
py
7,343
python
en
code
0
github-code
6
[ { "api_name": "selenium.webdriver.ChromeOptions", "line_number": 15, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 15, "usage_type": "name" }, { "api_name": "selenium.webdriver.Chrome", "line_number": 19, "usage_type": "call" }, { "api...
23019706105
import torch import torch.nn as nn import torch.nn.functional as F class SceneRecognition(nn.Module): def __init__(self): super().__init__() kernel1 = torch.tensor([[-1,0,+1],[-2,0,+2],[-1,0,+1]]).repeat(1,1,1).type(torch.float) kernel2 = torch.tensor([[-1,-2,-1],[0,0,0],[+1,+2,+1]]).repea...
jfrancis71/PyGenBrix
hippocampus/scene_recognition.py
scene_recognition.py
py
679
python
en
code
0
github-code
6
[ { "api_name": "torch.nn.Module", "line_number": 6, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 6, "usage_type": "name" }, { "api_name": "torch.tensor", "line_number": 9, "usage_type": "call" }, { "api_name": "torch.float", "line_numbe...
39221869249
import os import openai import time import warnings import shutil from google.colab import drive from IPython.display import clear_output import requests import json from typing import List, Union, Optional, Dict from pathlib import Path from rich import print, panel as rich_panel, text as rich_text, console as rich_co...
keirVQGAN/yetiChat
yetiChat.py
yetiChat.py
py
4,158
python
en
code
0
github-code
6
[ { "api_name": "rich.console.Console", "line_number": 14, "usage_type": "call" }, { "api_name": "rich.console", "line_number": 14, "usage_type": "name" }, { "api_name": "requests.post", "line_number": 58, "usage_type": "call" }, { "api_name": "json.dumps", "lin...
73738509946
from skimage import feature, io, filters, transform, segmentation import matplotlib.pyplot as plt img_file = "../data/similar_objects/4.JPG" # load the image and convert it to a floating point data type image = io.imread(img_file) image = transform.rescale(image, 0.1) segm_f = segmentation.quickshift(image) plt.ims...
m3rik/nn
CNTK/GeneralizedHoughTransform/other_segm_methods.py
other_segm_methods.py
py
342
python
en
code
0
github-code
6
[ { "api_name": "skimage.io.imread", "line_number": 8, "usage_type": "call" }, { "api_name": "skimage.io", "line_number": 8, "usage_type": "name" }, { "api_name": "skimage.transform.rescale", "line_number": 9, "usage_type": "call" }, { "api_name": "skimage.transform...
21940370439
r"""Utlities for fixing lints. Convenience functions for writing general fix functions for style lints. Opening and closing files, modifying contents, all should happen in the fix function callback. Fix functions are run as `fn(lint_args, *fix_args)` and executed once for each unique fn-args pair. Callbacks passed th...
tensorflow/docs
tools/tensorflow_docs/tools/nblint/fix.py
fix.py
py
1,690
python
en
code
5,917
github-code
6
[ { "api_name": "typing.Dict", "line_number": 16, "usage_type": "name" }, { "api_name": "typing.Any", "line_number": 16, "usage_type": "name" }, { "api_name": "typing.Pattern", "line_number": 16, "usage_type": "name" }, { "api_name": "re.sub", "line_number": 27,...
32043924355
# -*- coding: utf-8 -*- """ Created on Mon Jan 14 17:31:50 2019 @author: Michael """ #importig the necessary datasets from keras.applications import VGG16 from keras.applications import imagenet_utils from keras.preprocessing.image import load_img, img_to_array from sklearn.preprocessing import LabelEncode...
Monarene/CV-Deep-learning-Pracittioner
extract_features.py
extract_features.py
py
2,128
python
en
code
0
github-code
6
[ { "api_name": "random.seed", "line_number": 19, "usage_type": "call" }, { "api_name": "imutils.paths.list_images", "line_number": 28, "usage_type": "call" }, { "api_name": "imutils.paths", "line_number": 28, "usage_type": "name" }, { "api_name": "random.shuffle", ...
29353397236
import copy from typing import Dict from pyzeebe.errors import NoZeebeAdapterError from pyzeebe.job.job_status import JobStatus class Job(object): def __init__( self, key: int, _type: str, process_instance_key: int, bpmn_process_id: str, process_definition_version:...
Andy-JB/pyzeebe
pyzeebe/job/job.py
job.py
py
6,049
python
en
code
null
github-code
6
[ { "api_name": "typing.Dict", "line_number": 19, "usage_type": "name" }, { "api_name": "typing.Dict", "line_number": 23, "usage_type": "name" }, { "api_name": "pyzeebe.job.job_status.JobStatus", "line_number": 24, "usage_type": "name" }, { "api_name": "pyzeebe.job....
18598166605
from __future__ import annotations from data_access.dto import SponsorTeamDTO from typing import TYPE_CHECKING if TYPE_CHECKING: from fake_lib.providers import ( RandomValueFromListProvider, DatesRangeProvider ) class SponsorTeamFactory: def __init__( self, sponsor_...
pyteacher123/py35-onl
sports_db_project/populate_db/factories/sponsor_team.py
sponsor_team.py
py
985
python
en
code
2
github-code
6
[ { "api_name": "typing.TYPE_CHECKING", "line_number": 4, "usage_type": "name" }, { "api_name": "fake_lib.providers.RandomValueFromListProvider", "line_number": 14, "usage_type": "name" }, { "api_name": "fake_lib.providers.RandomValueFromListProvider", "line_number": 15, "u...
35909142384
import tensorflow as tf import numpy as np import keras from keras.utils import plot_model import matplotlib.pyplot as plt import globals as g #Load model and test data model_path = g.chooseModel() model = keras.models.load_model(model_path) (x_train, y_train), (x_test, y_test) = g.getNormalizedData() #Te...
noam1364/Convolutional-Neural-Networks
mnistCNN/testModel.py
testModel.py
py
708
python
en
code
0
github-code
6
[ { "api_name": "globals.chooseModel", "line_number": 9, "usage_type": "call" }, { "api_name": "keras.models.load_model", "line_number": 10, "usage_type": "call" }, { "api_name": "keras.models", "line_number": 10, "usage_type": "attribute" }, { "api_name": "globals....
17405770257
# -*- coding: utf-8 -*- import os.path import torch import torch.nn as nn from torchvision import models, transforms from torch.autograd import Variable import numpy as np from PIL import Image import json import os os.environ["CUDA_VISIBLE_DEVICES"] = "0" feature_path = 'Resnet34.jsnol' def...
mendy-2013/JSFR
backbone/feature_extraction.py
feature_extraction.py
py
1,846
python
en
code
0
github-code
6
[ { "api_name": "os.environ", "line_number": 16, "usage_type": "attribute" }, { "api_name": "torchvision.transforms.Compose", "line_number": 22, "usage_type": "call" }, { "api_name": "torchvision.transforms", "line_number": 22, "usage_type": "name" }, { "api_name": ...
71151722747
#!/usr/bin/env python # -*- coding: utf-8 -*- import obspy import numpy as np import warnings from matplotlib import pyplot as plt from matplotlib import dates as md from scipy.signal import stft, istft, hanning from statsmodels import robust from obspy.core.trace import Trace from . import logtable from . import ma...
leonard-seydoux/covnet
covnet/data.py
data.py
py
22,670
python
en
code
4
github-code
6
[ { "api_name": "warnings.catch_warnings", "line_number": 18, "usage_type": "call" }, { "api_name": "warnings.simplefilter", "line_number": 19, "usage_type": "call" }, { "api_name": "obspy.core", "line_number": 64, "usage_type": "attribute" }, { "api_name": "matplot...
26234877427
from collections import defaultdict def get_unique_neighbours(state): """ returns a set of tuples containing a pair of rooms if they are next to eachother and the direction from 0 to 1 removes duplicates. e.g. (room2,room3), (room3,room2) """ neighbours = set() for item in state: if it...
japhster/Adgen
state_functions.py
state_functions.py
py
4,506
python
en
code
0
github-code
6
[ { "api_name": "collections.defaultdict", "line_number": 97, "usage_type": "call" } ]
8494193042
from typing import List, Optional from heapq import heappush, heappop class ListNode: def __init__(self, val=0, next=None): self.val: int = val self.next: ListNode = next def print_listnode(self): while self: print(self.val, "->", end = '') self = self.next ...
NicoloTartaggia/LeetCode
Hard/23.Merge_k_sorted_lists/merge_k_sorted_lists.py
merge_k_sorted_lists.py
py
1,228
python
en
code
0
github-code
6
[ { "api_name": "typing.List", "line_number": 15, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 15, "usage_type": "name" }, { "api_name": "heapq.heappush", "line_number": 21, "usage_type": "call" }, { "api_name": "heapq.heappop", "line_...
19115267944
import datetime import re import plugins.qlprofile as qlprofile import minqlbot import threading LENGTH_REGEX = re.compile(r"(?P<number>[0-9]+) (?P<scale>seconds?|minutes?|hours?|days?|weeks?|months?|years?)") TIME_FORMAT = "%Y-%m-%d %H:%M:%S" DEFAULT_REASON = "Reason not specified." class ban(minqlbot.Plugin): d...
razers3dge/Modified-QL-Minobot
plugins/ban.py
ban.py
py
13,999
python
en
code
1
github-code
6
[ { "api_name": "re.compile", "line_number": 7, "usage_type": "call" }, { "api_name": "minqlbot.Plugin", "line_number": 11, "usage_type": "attribute" }, { "api_name": "minqlbot.PRI_HIGH", "line_number": 14, "usage_type": "attribute" }, { "api_name": "minqlbot.RET_ST...
41247248323
import json import os from flask import flash, redirect, render_template, request, url_for from flask_login import login_required, login_user, logout_user from werkzeug.security import check_password_hash, generate_password_hash from werkzeug.utils import secure_filename from data.sql_alchemy import database as db from...
claudionorjr/test-Serasa
src/routes.py
routes.py
py
5,788
python
en
code
0
github-code
6
[ { "api_name": "data.sql_alchemy.database.session.add", "line_number": 15, "usage_type": "call" }, { "api_name": "data.sql_alchemy.database.session", "line_number": 15, "usage_type": "attribute" }, { "api_name": "data.sql_alchemy.database", "line_number": 15, "usage_type":...
74021856829
import pytest import sys from unittest.mock import patch, sentinel from autocommand import autocommand autocommand_module = sys.modules['autocommand.autocommand'] def _asyncio_unavailable(): try: import asyncio # This is here to silence flake8 complaining about "unused import" assert as...
Lucretiel/autocommand
test/test_autocommand.py
test_autocommand.py
py
3,877
python
en
code
51
github-code
6
[ { "api_name": "sys.modules", "line_number": 7, "usage_type": "attribute" }, { "api_name": "pytest.mark.skipif", "line_number": 22, "usage_type": "call" }, { "api_name": "pytest.mark", "line_number": 22, "usage_type": "attribute" }, { "api_name": "unittest.mock.pat...
71803059069
# -*-coding:utf-8-*- from flask_restful import Resource, reqparse from models.job import JobModel from flask import jsonify import json class Job(Resource): def __init__(self): self.parser = reqparse.RequestParser() def get(self, id): obj = JobModel.get_by_id(id) if obj: ...
isteven-xu/etlx-web
api/job.py
job.py
py
2,476
python
en
code
0
github-code
6
[ { "api_name": "flask_restful.Resource", "line_number": 8, "usage_type": "name" }, { "api_name": "flask_restful.reqparse.RequestParser", "line_number": 10, "usage_type": "call" }, { "api_name": "flask_restful.reqparse", "line_number": 10, "usage_type": "name" }, { ...
26113297615
__authors__ = ["T. Vincent"] __license__ = "MIT" __date__ = "03/10/2017" import time import logging from silx.gui import qt from silx.gui.icons import getQIcon from .Plot3DAction import Plot3DAction _logger = logging.getLogger(__name__) class _SetViewpointAction(Plot3DAction): """Base class for actions setti...
silx-kit/silx
src/silx/gui/plot3d/actions/viewpoint.py
viewpoint.py
py
6,642
python
en
code
106
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 14, "usage_type": "call" }, { "api_name": "Plot3DAction.Plot3DAction", "line_number": 17, "usage_type": "name" }, { "api_name": "silx.gui.icons.getQIcon", "line_number": 54, "usage_type": "call" }, { "api_name": "s...
12637037784
import matplotlib.pyplot as plt import numpy as np # Pontos A, B e C points = {'A': (3, 2), 'B': (6, 8), 'C': (7, 3)} # Coordenadas do ponto C C = (7, 3) # Adicionando ponto C aos pontos points.update({'C': C}) # Definindo os pares de pontos para os lados do triângulo triangle_sides = [('A', 'B'), ('B'...
Raikyr4/Estudos_Computcao_Grafica
Lista01/05.py
05.py
py
2,089
python
pt
code
1
github-code
6
[ { "api_name": "matplotlib.pyplot.figure", "line_number": 17, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 17, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.xlim", "line_number": 18, "usage_type": "call" }, { "api_name": "mat...
71881724668
import logging import types from exceptions_ import BucketValueMissingException, \ EndOfFileReachedException, \ FileIsClosedException, \ FileNotFoundException, \ InternalStorageOperationException, \ UnsupportedProviderException from model.block import Block from model.descriptor import Descriptor i...
SafeBreach-Labs/AltFS
AltFS.py
AltFS.py
py
25,471
python
en
code
54
github-code
6
[ { "api_name": "logging.basicConfig", "line_number": 21, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 21, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 22, "usage_type": "call" }, { "api_name": "exceptions_....
27214292975
from setuptools import setup, find_packages __version__ = '1.0.0' setup(name='snacky', version=__version__, description='', author='Hans Daigle', author_email='hansdaigle@me.com', url='https://github.com/HansDaigle/snacky', packages=find_packages(), install_requires=["fastapi...
HansDaigle/snacky
setup.py
setup.py
py
365
python
en
code
1
github-code
6
[ { "api_name": "setuptools.setup", "line_number": 5, "usage_type": "call" }, { "api_name": "setuptools.find_packages", "line_number": 11, "usage_type": "call" } ]
36446308422
from date_processing import * from data_getter import * from database_model import * import plotly import plotly.graph_objs as go import warnings warnings.filterwarnings("ignore") class Morkov: def __init__(self, begin, type_name, period, num): self.num = num self.period = period self.typ...
atonyxu/fog_private
Morkov.py
Morkov.py
py
1,939
python
en
code
0
github-code
6
[ { "api_name": "warnings.filterwarnings", "line_number": 8, "usage_type": "call" }, { "api_name": "plotly.graph_objs.Scatter", "line_number": 41, "usage_type": "call" }, { "api_name": "plotly.graph_objs", "line_number": 41, "usage_type": "name" }, { "api_name": "pl...
8185924307
from pyautogui import moveTo, click, rightClick, write, keyDown, keyUp, hotkey, scroll import pyautogui import pyperclip import re import time from threading import Thread, Event import sys unmutestoploop = Event() def send(message1): pyautogui.moveTo(189, 20, 0.1) pyautogui.click() pyautogui.m...
BainBan/Makise-Kurisu-MD-a-whatsapp-bot-with-mute-unmute-chatgpt
main.py
main.py
py
8,532
python
en
code
2
github-code
6
[ { "api_name": "threading.Event", "line_number": 9, "usage_type": "call" }, { "api_name": "pyautogui.moveTo", "line_number": 11, "usage_type": "call" }, { "api_name": "pyautogui.click", "line_number": 12, "usage_type": "call" }, { "api_name": "pyautogui.moveTo", ...
70501170109
from traceback import print_exc from flask import Flask, request, jsonify from trasto.infrastructure.awsmultiprocess.accion_repository import \ AccionRepository from trasto.infrastructure.awsmultiprocess.comando_repository import \ ComandoRepository from trasto.infrastructure.memory.repositories import (Esta...
jpardobl/jpardobl-trastobrain
trasto/application/web_multi.py
web_multi.py
py
2,497
python
es
code
18
github-code
6
[ { "api_name": "trasto.infrastructure.memory.repositories.LoggerRepository", "line_number": 17, "usage_type": "call" }, { "api_name": "trasto.infrastructure.awsmultiprocess.accion_repository.AccionRepository", "line_number": 19, "usage_type": "call" }, { "api_name": "flask.Flask",...
17431045500
import requests import random from random import seed, randint import time import string from datetime import datetime username = str(input("Username: ")) phrase = str(input("Text to Send: ")) seed = 1 counter = 1 def do_requests(username, phrase, seed, counter): url = "https://ngl.link/" + username while True...
nextgeek05/nglspammer
main.py
main.py
py
764
python
en
code
0
github-code
6
[ { "api_name": "random.seed", "line_number": 9, "usage_type": "name" }, { "api_name": "random.randint", "line_number": 16, "usage_type": "call" }, { "api_name": "requests.post", "line_number": 18, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "...
72531941309
from collections.abc import Callable from dataclasses import dataclass, field from typing import Any, Generic, TypeVar ItemT = TypeVar("ItemT") @dataclass class LimitedOrderedStack(Generic[ItemT]): """Container designed only to keep the most relevant items (i.e called max) and drop everything else C...
ITISFoundation/osparc-simcore
packages/service-library/src/servicelib/aiohttp/incidents.py
incidents.py
py
1,801
python
en
code
35
github-code
6
[ { "api_name": "typing.TypeVar", "line_number": 5, "usage_type": "call" }, { "api_name": "typing.Generic", "line_number": 9, "usage_type": "name" }, { "api_name": "collections.abc.Callable", "line_number": 21, "usage_type": "name" }, { "api_name": "typing.Any", ...
6904857544
import numpy as np from itertools import product def read_input(fn): with open(fn, "r") as f: enhancement = f.readline().replace("\n", "") _ = f.readline() lines = [inp.replace("\n", "") for inp in f.readlines()] return enhancement, np.array([[s for s in t] for t in lines]) def enhanc...
SRoz/advent-of-code-2021
day20/day20.py
day20.py
py
1,261
python
en
code
0
github-code
6
[ { "api_name": "numpy.array", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.pad", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.zeros_like", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.pad", "line_number":...
34247497036
# -*- coding: utf-8 -*- """ This script fine tunes pretrained BERT model on play store app reviews for sentiment classification using app ratings as labels. """ import datetime import time import random import os import argparse import pandas as pd import numpy as np from transformers import BertTo...
Taaniya/bert-for-sentiment-classification-pytorch
train.py
train.py
py
12,477
python
en
code
4
github-code
6
[ { "api_name": "torch.utils.data.Dataset", "line_number": 26, "usage_type": "name" }, { "api_name": "torch.tensor", "line_number": 54, "usage_type": "call" }, { "api_name": "torch.long", "line_number": 54, "usage_type": "attribute" }, { "api_name": "torch.utils.dat...
39200564514
import time import logic import pygame from pygame_widgets import Button pygame.init() '''colors''' # R G B BLACK = ( 0, 0, 0) RED = (255, 0, 0) GREEN = (124, 209, 65) DARK_BLUE = ( 16, 34, 60) PINK = (255, 20, 147) BLUE = (152, 244, 245) YELLOW = (248,...
2arian3/Cool-Programming-Challenges
Tic-Tac-Toe/graphics.py
graphics.py
py
10,667
python
en
code
9
github-code
6
[ { "api_name": "pygame.init", "line_number": 5, "usage_type": "call" }, { "api_name": "pygame.font.SysFont", "line_number": 30, "usage_type": "call" }, { "api_name": "pygame.font", "line_number": 30, "usage_type": "attribute" }, { "api_name": "pygame.font.SysFont",...
41495207194
""" YAML Parser. Takes in .yml config file and creates a config object used in other programs. (C) 2020 Sean Cummins, Drogheda, Ireland Realeased under the GNU Public License (GPL) email seancummins16@gmail.com """ import yaml class ConfigurationError(Exception): pass class YAML_Configurator(): def __init...
Sean-Cummins/gamma-spectrum-fitting
confParse.py
confParse.py
py
4,097
python
en
code
0
github-code
6
[ { "api_name": "yaml.safe_load", "line_number": 26, "usage_type": "call" } ]
31393043894
"""Controller to handle user operations""" from flask import jsonify from src.exception.inactive_user_exception import InactiveUserException from src.exception.invalid_credentials_exception import InvalidCredentialsException from src.exception.invalid_input import InvalidInput from src.exception.missing_field_exception...
ecourtial/gmg
src/controller/user_controller.py
user_controller.py
py
4,223
python
en
code
1
github-code
6
[ { "api_name": "src.service.user_service.UserService", "line_number": 17, "usage_type": "call" }, { "api_name": "src.exception.missing_field_exception.MissingFieldException", "line_number": 21, "usage_type": "name" }, { "api_name": "flask.jsonify", "line_number": 22, "usag...
74197650749
import logging from datetime import datetime, timedelta, timezone import pytimeparse import os, errno from django.conf import settings import shutil import docker import humanize import time from tno.proccess import ProccessManager import parsl from parsl import * import json from statistics import mean from tno.db imp...
linea-it/tno
backend/old_apps/predict/prediction_occultation.py
prediction_occultation.py
py
72,006
python
en
code
1
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 31, "usage_type": "call" }, { "api_name": "django.conf.settings.ARCHIVE_DIR", "line_number": 35, "usage_type": "attribute" }, { "api_name": "django.conf.settings", "line_number": 35, "usage_type": "name" }, { "api_...
74126510269
import os import sys import pandas as pd import numpy as np from sklearn.preprocessing import StandardScaler from sklearn.model_selection import KFold from sklearn.ensemble import RandomForestRegressor from qmdesc import ReactivityDescriptorHandler import time from rdkit import Chem from rdkit.Chem import AllChem impor...
PKUMDL-AI/Reaxtica
DA/predict_DA.py
predict_DA.py
py
17,439
python
en
code
6
github-code
6
[ { "api_name": "sys.path.append", "line_number": 15, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 15, "usage_type": "attribute" }, { "api_name": "warnings.filterwarnings", "line_number": 22, "usage_type": "call" }, { "api_name": "argparse.Argume...
5921530794
from flask import Flask, render_template, request, jsonify import psycopg2 import openai import config app = Flask(__name__) openai.api_key = config.OPENAI_API_KEY def connect_to_db(): return psycopg2.connect( host=config.DB_HOST, database=config.DB_NAME, user=config.DB_USER, passwo...
aryanjain9953/gtp_sql
app.py
app.py
py
4,170
python
en
code
0
github-code
6
[ { "api_name": "flask.Flask", "line_number": 5, "usage_type": "call" }, { "api_name": "openai.api_key", "line_number": 6, "usage_type": "attribute" }, { "api_name": "config.OPENAI_API_KEY", "line_number": 6, "usage_type": "attribute" }, { "api_name": "psycopg2.conn...
1829457116
##################################################### # getFromPubAnnotation file for Snorkel # # This program will allow a file to be passed # # with PMIDs and PubAnnotation project(s) to be # # exported into a Snorkel compatible data tables # # to potentially (or in our case) to be treated as # # gold-labels ...
jmbanda/snorkelBioMed
pubannotationutils/getfrompubannotation.py
getfrompubannotation.py
py
3,168
python
en
code
1
github-code
6
[ { "api_name": "urllib2.urlopen", "line_number": 18, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 20, "usage_type": "call" }, { "api_name": "csv.reader", "line_number": 30, "usage_type": "call" }, { "api_name": "string.replace", "line_numb...
70097317629
# author_network.py import networkx as nx import matplotlib.pyplot as plt import pandas as pd # Load data def load_and_preprocess_data(filepath): df = pd.read_csv(filepath) df['authors'] = df['authors'].apply(lambda x: x.split(',') if isinstance(x, str) else []) df['citations'] = df['citations'].apply(lambda x:...
IanDxSSXX/DLKG
graph/author.py
author.py
py
4,611
python
en
code
0
github-code
6
[ { "api_name": "pandas.read_csv", "line_number": 9, "usage_type": "call" }, { "api_name": "networkx.Graph", "line_number": 18, "usage_type": "call" }, { "api_name": "networkx.number_connected_components", "line_number": 35, "usage_type": "call" }, { "api_name": "ne...
43634650223
from __future__ import division from __future__ import absolute_import #typing #overrides import torch from allennlp.training.metrics.metric import Metric try: from itertools import izip except: izip = zip class MentionRecall(Metric): def __init__(self) : self._num_gold_mentions = 0 ...
plasticityai/magnitude
pymagnitude/third_party/allennlp/training/metrics/mention_recall.py
mention_recall.py
py
1,503
python
en
code
1,607
github-code
6
[ { "api_name": "itertools.izip", "line_number": 14, "usage_type": "name" }, { "api_name": "allennlp.training.metrics.metric.Metric", "line_number": 18, "usage_type": "name" }, { "api_name": "itertools.izip", "line_number": 27, "usage_type": "call" }, { "api_name": ...
21884426507
"""Simulate a large CHIME population.""" from frbpoppy import CosmicPopulation, lognormal, Survey from frbpoppy import pprint, LargePopulation, SurveyPopulation from joblib import Parallel, delayed import os from tqdm import tqdm N_SRCS = 200 N_DAYS = 50 RATE = 9 # per day MAX_SIZE = int(N_SRCS / 2) LARGE_POP = False...
TRASAL/frbpoppy
tests/chime/sim.py
sim.py
py
2,198
python
en
code
26
github-code
6
[ { "api_name": "frbpoppy.CosmicPopulation", "line_number": 20, "usage_type": "call" }, { "api_name": "frbpoppy.lognormal", "line_number": 30, "usage_type": "call" }, { "api_name": "frbpoppy.lognormal", "line_number": 32, "usage_type": "call" }, { "api_name": "frbpo...
26392853171
import logging ID = "addop" permission = 3 def notInList(user, userlist): for name in userlist: if name.lower() == user.lower(): return False return True def execute(self, username, params, channel, userdata, rank): names = params for name in names: if notInList(...
RenolY2/Renol-IRC
commands/addAdmin.py
addAdmin.py
py
627
python
en
code
6
github-code
6
[ { "api_name": "logging.info", "line_number": 22, "usage_type": "call" } ]
32639581820
import unittest from selenium import webdriver from selenium.webdriver.common.by import By class SearchTests(unittest.TestCase): def setUp(self) -> None: self.driver = webdriver.Chrome(executable_path='chromedriver') self.driver.get("https://www.mercadolibre.com") self.driver.maximize...
yorlysoro/intro_selenium_course
mercadolibre.py
mercadolibre.py
py
1,686
python
en
code
0
github-code
6
[ { "api_name": "unittest.TestCase", "line_number": 6, "usage_type": "attribute" }, { "api_name": "selenium.webdriver.Chrome", "line_number": 9, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 9, "usage_type": "name" }, { "api_name": "sele...
26113012475
__authors__ = ["T. Vincent"] __license__ = "MIT" __date__ = "21/12/2018" import logging import weakref import numpy from .. import items from .._utils import FLOAT32_MINPOS from . import BackendBase from ... import colors from ... import qt from ..._glutils import gl from ... import _glutils as glu from . import gl...
silx-kit/silx
src/silx/gui/plot/backends/BackendOpenGL.py
BackendOpenGL.py
py
53,380
python
en
code
106
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 21, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 39, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 40, "usage_type": "call" }, { "api_name": "numpy.array", "line_num...
72255276348
from __future__ import annotations import asyncio import re import textwrap from typing import TYPE_CHECKING, List import discord from discord.ext import commands from utils import BOT_MENTION_RE, get_pokemon if TYPE_CHECKING: from bot import Bot async def setup(bot: Bot): await bot.add_cog(MessageEvents...
LeoCx1000/fish
src/cogs/events/messages.py
messages.py
py
2,746
python
en
code
0
github-code
6
[ { "api_name": "typing.TYPE_CHECKING", "line_number": 14, "usage_type": "name" }, { "api_name": "bot.Bot", "line_number": 18, "usage_type": "name" }, { "api_name": "bot.add_cog", "line_number": 19, "usage_type": "call" }, { "api_name": "discord.ext.commands.Cog", ...
21813701140
import cv2 import os image_folder = './screens' video_name = 'video.avi' images = [] for i in range(1, 31640): images.append(f"image_{i}.jpg") frame = cv2.imread(os.path.join(image_folder, images[0])) height, width, layers = frame.shape video = cv2.VideoWriter(video_name, 0, 120, (width,height)) for image in i...
skcajs/ntnu-artificial-intelligence
reinforcement_learning/deep-q/tmp.py
tmp.py
py
430
python
en
code
0
github-code
6
[ { "api_name": "cv2.imread", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path", "line_number": 11, "usage_type": "attribute" }, { "api_name": "cv2.VideoWriter", "line_numb...
41489808319
import matplotlib.pyplot as plt import torch def plot(rewards, name:str): # clear_output(True) plt.figure(figsize=(10,5)) plt.plot(rewards) plt.savefig(name) # plt.show() plt.clf() plt.close() import json def json_read_file(filename): ''' @brief: read data from json file...
quantumiracle/Cascading-Decision-Tree
src/utils/common_func.py
common_func.py
py
720
python
en
code
32
github-code
6
[ { "api_name": "matplotlib.pyplot.figure", "line_number": 6, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 6, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 7, "usage_type": "call" }, { "api_name": "matplo...
70768927228
#!.env/Scripts/python.exe __doc__ = ''' Составляем списки словосочетаний по корпусу. https://www.nltk.org/howto/collocations.html ''' import logging import math from pathlib import Path import nltk from nltk.collocations import BigramAssocMeasures, BigramCollocationFinder from nltk.corpus import stopwords from nltk....
fateevda/creating_dataset
11_collocation.py
11_collocation.py
py
3,772
python
ru
code
1
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 21, "usage_type": "call" }, { "api_name": "math.sqrt", "line_number": 27, "usage_type": "call" }, { "api_name": "nltk.collocations.BigramCollocationFinder", "line_number": 30, "usage_type": "name" }, { "api_name": ...
35765386143
from datetime import datetime from es.weso.oecdextractor.translator.json_loader import JsonLoader from es.weso.oecdextractor.translator.path_object_pair import PathObjectPair from lpentities.computation import Computation from lpentities.data_source import DataSource from lpentities.dataset import Dataset from lpentit...
weso/landportal-importers
OECD_Importer/es/weso/oecdextractor/translator/model_object_builder.py
model_object_builder.py
py
25,978
python
en
code
0
github-code
6
[ { "api_name": "es.weso.oecdextractor.translator.json_loader.JsonLoader", "line_number": 44, "usage_type": "call" }, { "api_name": "reconciler.country_reconciler.CountryReconciler", "line_number": 68, "usage_type": "call" }, { "api_name": "lpentities.license.License", "line_nu...
70542908347
import pygame from random import randint def lixo_show(): for i in range(100): espaco_lixo.append([randint(1,740), randint(-2500, 0 )]) def movimento_do_lixo(): for i in range(len(espaco_lixo)): if espaco_lixo[i] != [0, 0]: espaco_lixo[i][1] += 1 screen.blit(lixo, [esp...
debsk/Games
Game.py
Game.py
py
2,754
python
pt
code
0
github-code
6
[ { "api_name": "random.randint", "line_number": 6, "usage_type": "call" }, { "api_name": "pygame.image.load", "line_number": 40, "usage_type": "call" }, { "api_name": "pygame.image", "line_number": 40, "usage_type": "attribute" }, { "api_name": "pygame.image.load",...
12392705019
import tensorflow as tf # type: ignore[import] from numpy import array # type: ignore[import] from numpy import split from sklearn.metrics import mean_squared_error # type: ignore[import] from pandas import concat # type: ignore[import] from pandas import read_csv from os import path from typing import List, Any, Tuple...
chanelcolgate/predict-smp
src/models/model.py
model.py
py
3,681
python
en
code
0
github-code
6
[ { "api_name": "os.path.dirname", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path", "line_number": 19, "usage_type": "name" }, { "api_name": "os.path.join", "line_number": 20, "usage_type": "call" }, { "api_name": "os.path", "line_number": 20,...
18847898084
import argparse def run(): parser = argparse.ArgumentParser() parser.add_argument('--iops', required=True, type=float, help='iops for 4KiB requests') parser.add_argument('--bw', required=True, type=float, help='bandwidth for 4MiB requests') args = parser.parse_args() i1 = args.iops i2 = arg...
ydb-platform/nbs
cloud/blockstore/tools/analytics/calculate-perf-settings/__main__.py
__main__.py
py
533
python
en
code
32
github-code
6
[ { "api_name": "argparse.ArgumentParser", "line_number": 5, "usage_type": "call" } ]
9740768589
import xml.etree.ElementTree as ET import os from datetime import datetime # Função para criar um novo pedido de produção def criar_ordem_producao(): try: produto = str(input("Nome do produto: ")) quantidade = int(input("Quantidade desejada: ")) data_entrega = input("Data de entreg...
dropox3/factorysystem
main.py
main.py
py
3,955
python
pt
code
0
github-code
6
[ { "api_name": "datetime.datetime.strptime", "line_number": 13, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 13, "usage_type": "name" }, { "api_name": "xml.etree.ElementTree.Element", "line_number": 15, "usage_type": "call" }, { "api_na...
31244087941
from flask import render_template, request from .utils import read_int_from_form from . import app import logging logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO) @app.route('/bankdomain/show_words', methods=['GET'], defaults={'min_count': 8}) @app.route('/bankdomain/show...
diegoami/bankdomain_PY
src/web/show_words.py
show_words.py
py
846
python
en
code
0
github-code
6
[ { "api_name": "logging.basicConfig", "line_number": 9, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 9, "usage_type": "attribute" }, { "api_name": "flask.render_template", "line_number": 19, "usage_type": "call" }, { "api_name": "flask.rende...
14654457024
from pathlib import Path class MOD: def __init__(self,file): self.file=file def movingObjectDetection(self): # -*- coding: utf-8 -*- """Moving_Object_Detection_in_Videos.ipynb Automatically generated by Colaboratory. Original file is located at https://c...
arorapragya/MovingObjectRecognition
myapp/Moving_object_Detection.py
Moving_object_Detection.py
py
6,264
python
en
code
0
github-code
6
[ { "api_name": "cv2.cvtColor", "line_number": 27, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2RGB", "line_number": 27, "usage_type": "attribute" }, { "api_name": "pathlib.Path", "line_number": 34, "usage_type": "call" }, { "api_name": "cv2.VideoCapture", ...
41361223563
from __future__ import division import os import logging import sys # If the python binding doesnt work mxnet can be added manually #sys.path.insert(1, '/work/mxnet/python/') import mxnet as mx import numpy as np from graphviz import ExecutableNotFound from mxnet import profiler from mxnet import gluon import time ...
Alekrom/showcase-projects
MasterThesis/code/ThesisCodeAlexanderKromer/main.py
main.py
py
13,959
python
en
code
0
github-code
6
[ { "api_name": "shared_weight_network.SharedWeightNetwork", "line_number": 53, "usage_type": "call" }, { "api_name": "mxnet.nd.array", "line_number": 68, "usage_type": "call" }, { "api_name": "mxnet.nd", "line_number": 68, "usage_type": "attribute" }, { "api_name":...
29577156700
# -*- coding: utf-8 -*- """ Created on Mon Jul 23 16:17:06 2018 @author: Akitaka """ import numpy as np import matplotlib.pyplot as plt from sklearn.metrics import mean_absolute_error from sklearn.metrics import mean_squared_error from sklearn.metrics import r2_score def print_gscv...
nakanishi-akitaka/python2018_backup
0724/my_library.py
my_library.py
py
2,148
python
en
code
5
github-code
6
[ { "api_name": "numpy.sqrt", "line_number": 27, "usage_type": "call" }, { "api_name": "sklearn.metrics.mean_squared_error", "line_number": 27, "usage_type": "call" }, { "api_name": "sklearn.metrics.mean_absolute_error", "line_number": 28, "usage_type": "call" }, { ...
36551619231
import numpy import matplotlib.pyplot as plt from random import randrange, sample covariance = [[1.2, 0], [0, 1.2]] # Spherical covariance class DataHandler(object): def get2DGaussian(self, size, mean, covariance=covariance): x, y = numpy.random.multivariate_normal(mean, covariance, size).T plt....
Mustapha-Belkacim/Linear-classifier
DataHandler.py
DataHandler.py
py
2,712
python
en
code
0
github-code
6
[ { "api_name": "numpy.random.multivariate_normal", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 10, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 11, "usage_type": "call" }, { "api_nam...
33262763355
import json from sklearn.feature_extraction.text import CountVectorizer config_file = open("/content/big_bot_config.json", "r") BIG_CONFIG = json.load(config_file) BIG_CONFIG.keys() dict_keys(['intents', 'failure_phrases']) len(BIG_CONFIG["intents"]) X = [] # Фразы y = [] # Намерения # Собираем фразы и интенты и...
kuzbassghost/Course
Webinar/Chat2.py
Chat2.py
py
1,248
python
ru
code
0
github-code
6
[ { "api_name": "json.load", "line_number": 6, "usage_type": "call" }, { "api_name": "sklearn.feature_extraction.text.CountVectorizer", "line_number": 34, "usage_type": "call" }, { "api_name": "sklearn.feature_extraction.text.CountVectorizer", "line_number": 37, "usage_type...
17333258664
from typing import Iterable, List, Tuple from common import Item def save_instance(path: str, pallet_width: int, pallet_height: int, items: Iterable[Item]) -> None: with open(path, 'w') as file: print(pallet_width, pallet_height, file=file, sep='\t') for item in items: if item.mass is...
yad439/pallet-packing
problem_io.py
problem_io.py
py
930
python
en
code
0
github-code
6
[ { "api_name": "typing.Iterable", "line_number": 6, "usage_type": "name" }, { "api_name": "common.Item", "line_number": 6, "usage_type": "name" }, { "api_name": "common.Item", "line_number": 24, "usage_type": "call" }, { "api_name": "typing.Tuple", "line_number...
7751443647
import datetime from dateutil import parser def get_time_diff_days(start, end): ''' Number of days between two dates in UTC format ''' if start is None or end is None: return None if type(start) is not datetime.datetime: start = parser.parse(start).replace(tzinfo=None) if type(end) i...
timhayduk/glusterDashboard
GrimoireELK/grimoire/elk/utils.py
utils.py
py
565
python
en
code
1
github-code
6
[ { "api_name": "datetime.datetime", "line_number": 10, "usage_type": "attribute" }, { "api_name": "dateutil.parser.parse", "line_number": 11, "usage_type": "call" }, { "api_name": "dateutil.parser", "line_number": 11, "usage_type": "name" }, { "api_name": "datetime...
24948245121
from setuptools import setup, find_packages version = "0.0.1" with open("OSS_VERSION", "rt") as f: mf_version = f.read() setup( name="mycompany-metaflow", version=version, description="Metaflow Custom Extensions", author="Your team name", author_email="team@company.com", packages=find_pac...
Netflix/metaflow-extensions-template
setup.py
setup.py
py
609
python
en
code
8
github-code
6
[ { "api_name": "setuptools.setup", "line_number": 8, "usage_type": "call" }, { "api_name": "setuptools.find_packages", "line_number": 14, "usage_type": "call" } ]
13954400663
import matplotlib.pyplot as plt import numpy as np if __name__ == "__main__": x = np.arange(0,10,0.2) y1 = np.cos(x) y2 = np.sin(x) y3 = np.tan(x) plt.plot(x,y1,'o',linewidth=5,color="y") plt.plot(x,y2, "*",linewidth=6,color='b') plt.plot(x,y3, "-",linewidth=3,color='r') plt.grid() ...
eSwayyy/UCM-projects
python/MatPlotLib/Ejemplo6Multigráficos.py
Ejemplo6Multigráficos.py
py
451
python
en
code
1
github-code
6
[ { "api_name": "numpy.arange", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.cos", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.sin", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.tan", "line_number": 10, ...
1909089071
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from builtins import open from builtins import str from future import standard_library standard_library.install_aliases() import http.client import json import logging ...
HewlettPackard/python-hpOneView
hpOneView/connection.py
connection.py
py
24,773
python
en
code
86
github-code
6
[ { "api_name": "future.standard_library.install_aliases", "line_number": 10, "usage_type": "call" }, { "api_name": "future.standard_library", "line_number": 10, "usage_type": "name" }, { "api_name": "logging.getLogger", "line_number": 24, "usage_type": "call" }, { ...
72186182907
def traverse_preorder(tree, operation): if tree: operation(tree.get_value()) traverse_preorder(tree.get_left_child(), operation) traverse_preorder(tree.get_right_child(), operation) def traverse_inorder(tree, operation): if tree: traverse_inorder(tree.get_left_child(), operatio...
codebuff/snippets
trees/Utilities.py
Utilities.py
py
1,005
python
en
code
1
github-code
6
[ { "api_name": "collections.deque", "line_number": 24, "usage_type": "call" } ]
41669790837
from datetime import timedelta from celery import shared_task from subscription.models import Subscription, Invoice, Customer from django.utils import timezone def create_one_invoice(subscription, customer): Invoice.objects.create(subscription=subscription) customer.credit -= subscription.unit_price custo...
mohsenkk/Cloud-Finantial-Structure
apis/tasks.py
tasks.py
py
1,181
python
en
code
0
github-code
6
[ { "api_name": "subscription.models.Invoice.objects.create", "line_number": 8, "usage_type": "call" }, { "api_name": "subscription.models.Invoice.objects", "line_number": 8, "usage_type": "attribute" }, { "api_name": "subscription.models.Invoice", "line_number": 8, "usage_...
3135435925
import igl import numpy as np import random from pathlib import Path import customconfig system_props = customconfig.Properties('./system.json') verts, faces = igl.read_triangle_mesh( Path(system_props['datasets_path']) / 'data_uni_1000_tee_200527-14-50-42_regen_200612-16-56-43' / 'tee_0BEJ3JZP2O' / 'tee_0BEJ3JZ...
maria-korosteleva/Garment-Pattern-Estimation
nn/utility_scripts/igl_sampling_test.py
igl_sampling_test.py
py
1,099
python
en
code
84
github-code
6
[ { "api_name": "customconfig.Properties", "line_number": 8, "usage_type": "call" }, { "api_name": "igl.read_triangle_mesh", "line_number": 10, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 11, "usage_type": "call" }, { "api_name": "igl.random...
73835492669
""" Python to calculate E-field data using 1-minute INTERMAGNET data and a resistive 1-D Quebec ground profile. The INTERMAGNET data used here is taken from 3 days at the Eskdalemuir observatory. 1-D Z-tensor taken from http://www.digitalearthlab.com/tutorial/tutorial-1d-mt-forward/ """ import numpy as np import...
TerminusEst/Auroral_Boundary_Geomag
Efield_CALC.py
Efield_CALC.py
py
5,892
python
en
code
1
github-code
6
[ { "api_name": "numpy.pi", "line_number": 41, "usage_type": "attribute" }, { "api_name": "numpy.pi", "line_number": 46, "usage_type": "attribute" }, { "api_name": "numpy.sqrt", "line_number": 49, "usage_type": "call" }, { "api_name": "numpy.sqrt", "line_number"...
197697623
#!/usr/bin/env python # -*- coding: utf-8 -*- import logging import re import json from collections import deque from kippo_object import LoginAttempt class KippoParser(object): def __init__(self): self.logger = logging.getLogger(__name__) @staticmethod def dict_converter(x): if isinsta...
spartan223193/hungryhungrykippo
hungryhungrykippo/kippoparser.py
kippoparser.py
py
5,655
python
en
code
1
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 14, "usage_type": "call" }, { "api_name": "logging.info", "line_number": 44, "usage_type": "call" }, { "api_name": "collections.deque", "line_number": 47, "usage_type": "call" }, { "api_name": "json.dumps", "li...
32724954352
from rest_framework import viewsets, mixins from rest_framework.permissions import IsAuthenticated from rest_framework.authentication import SessionAuthentication from rest_framework_simplejwt.authentication import JWTAuthentication from user_operation.models import UserFav, UserLeavingMessage, UserAddress from user_o...
xiaocaotest/MxShop
apps/user_operation/views.py
views.py
py
3,001
python
en
code
0
github-code
6
[ { "api_name": "rest_framework.viewsets.GenericViewSet", "line_number": 12, "usage_type": "attribute" }, { "api_name": "rest_framework.viewsets", "line_number": 12, "usage_type": "name" }, { "api_name": "rest_framework.mixins.ListModelMixin", "line_number": 12, "usage_type...