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
16447503794
import argparse import os import torch import torch.nn as nn import torch.nn.functional as F import numpy as np import math import logging import random from tqdm import tqdm from str2bool import str2bool import itertools from datetime import datetime from transformers import BertTokenizer from transformers import Ber...
TingchenFu/EMNLP23-LogicRetrieval
reimpl.py
reimpl.py
py
12,017
python
en
code
0
github-code
7
[ { "api_name": "logging.basicConfig", "line_number": 33, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 35, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 36, "usage_type": "call" }, { "api_name": "argparse.Argu...
41971926564
from src.entities.components.component import Component import tcod class Vision(Component): # stores an entity's field of view maps and level memory. # accessed to check if cells are in field-of-view. def __init__(self, owner, radius): Component.__init__(self, owner) self.radius = radius...
VoxSomniator/andromeda-starbase
src/entities/components/vision.py
vision.py
py
791
python
en
code
1
github-code
7
[ { "api_name": "src.entities.components.component.Component", "line_number": 5, "usage_type": "name" }, { "api_name": "src.entities.components.component.Component.__init__", "line_number": 10, "usage_type": "call" }, { "api_name": "src.entities.components.component.Component", ...
3506449106
import configparser import contextlib import ctypes import json import sys import time from threading import Thread import keyboard import pymem import mdt_cv config_file = "config.ini" cid_temp = 0 cid_temp_duel = 0 cid_temp_deck = 0 cid_temp_oppo = 0 cid_show_gui = 0 pause = False process_exit = False baseAddress ...
SkywalkerJi/mdt
mdt.py
mdt.py
py
5,676
python
en
code
707
github-code
7
[ { "api_name": "mdt_cv.get_scan", "line_number": 108, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 118, "usage_type": "call" }, { "api_name": "pymem.Pymem", "line_number": 134, "usage_type": "call" }, { "api_name": "pymem.process.module_from_n...
25113112927
import cx_Freeze executables = [cx_Freeze.Executable("WordStats.py")] cx_Freeze.setup( name="WordStats", options={"build_exe": {"packages": ['pymsgbox', 'matplotlib', 'numpy']}}, version='1.1', description='A simple text analyzer.', author='Sean Xie', executables=executables )
amitdhandha1996/WordStats
src/setup.py
setup.py
py
316
python
en
code
0
github-code
7
[ { "api_name": "cx_Freeze.Executable", "line_number": 3, "usage_type": "call" }, { "api_name": "cx_Freeze.setup", "line_number": 5, "usage_type": "call" } ]
12354502109
import re import sys from PyQt5.QtWidgets import QApplication,QMainWindow import untitled import requests def ceshi(): a = ui.lineEdit.text() url = 'http://192.168.7.30:8008/ad' res = requests.get(url) ad_name = res.json() try: adname = ad_name[f'{a}'] if a == '': ui.tex...
Aefun-ayi/ayi-demo
demo/demo6/demo.py
demo.py
py
769
python
en
code
0
github-code
7
[ { "api_name": "requests.get", "line_number": 10, "usage_type": "call" }, { "api_name": "PyQt5.QtWidgets.QApplication", "line_number": 24, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 24, "usage_type": "attribute" }, { "api_name": "PyQt5.QtWidge...
36439949633
import datetime class NewFileTest: def __init__(self, filename, first_line, napr): self.filename = filename self.first_line = first_line self.napr = napr self.ko = None def setKo(self): if self.ko == 0: print(f"Файл {self.filename} успешно соз...
softly2000/test_py
seven/class_tr/library/new_file_test.py
new_file_test.py
py
964
python
en
code
0
github-code
7
[ { "api_name": "datetime.datetime.now", "line_number": 21, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 21, "usage_type": "attribute" } ]
72838212702
import gym from gym import spaces from Robots.IdealFluidSwimmer_v1 import IdealFluidSwimmer import numpy as np from math import pi from utils.learning_helper import forward_reward_function class IdealFluidSwimmerEnv(gym.Env): def __init__(self): super(IdealFluidSwimmerEnv, self).__init__() self.sn...
junyaoshi/DeepRobots
envs/IdealFluidSwimmerEnv.py
IdealFluidSwimmerEnv.py
py
985
python
en
code
4
github-code
7
[ { "api_name": "gym.Env", "line_number": 9, "usage_type": "attribute" }, { "api_name": "Robots.IdealFluidSwimmer_v1.IdealFluidSwimmer", "line_number": 12, "usage_type": "call" }, { "api_name": "gym.spaces.Box", "line_number": 13, "usage_type": "call" }, { "api_name...
30165387443
import gym import numpy as np import time import csv from stable_baselines3 import PPO import ctr_reach_envs from ctr_reach_envs.src.utils import run_episode #from ctr_reach_envs.envs.ctr_wrappers import ROSWrapper def drl_ik_solver(env, model, episode, desired_goal=None, initial_joints=None, output_path=None): # ...
keshaviyengar/gym-ctr-ral
ctr_reach_envs/src/evaluations.py
evaluations.py
py
1,387
python
en
code
0
github-code
7
[ { "api_name": "time.sleep", "line_number": 12, "usage_type": "call" }, { "api_name": "ctr_reach_envs.src.utils.run_episode", "line_number": 13, "usage_type": "call" }, { "api_name": "stable_baselines3.PPO.load", "line_number": 32, "usage_type": "call" }, { "api_na...
41172665639
""" Things to Remember Using generators can be clearer than the alternative of returning lists of accumulated results. The iterator returned by a generator produces the set of values passed to yield expressions within the generator function¡¯s body. Generators can produce a sequence of outputs for arbitrarily large...
acybercoder/Python
Effective Python 2015/2. Functions/Item 16 - Consider Generators Instead of Returning Lists/Example.py
Example.py
py
1,374
python
en
code
0
github-code
7
[ { "api_name": "itertools.islice", "line_number": 48, "usage_type": "call" } ]
71570630623
import uuid from unittest.mock import ANY from flask import current_app, json from freezegun import freeze_time import pytest import requests_mock from app.config import QueueNames from app.celery.research_mode_tasks import ( send_sms_response, send_email_response, telstra_callback, twilio_callback, ...
govau/notify
api/tests/app/celery/test_research_mode_tasks.py
test_research_mode_tasks.py
py
6,197
python
en
code
17
github-code
7
[ { "api_name": "app.celery.research_mode_tasks.send_sms_response", "line_number": 28, "usage_type": "call" }, { "api_name": "flask.json.loads", "line_number": 32, "usage_type": "call" }, { "api_name": "flask.json", "line_number": 32, "usage_type": "name" }, { "api_...
36977699468
from torch import nn import torch from HardCoreNAS.timm import create_model, create_optimizer import torch.nn.functional as F import argparse from helper.pytorch.optimizers import SFW from helper.pytorch.constraints import * import model.pytorch.resnet as resnet import model.pytorch.googlenet as googlenet def create_...
samyak19098/Federated_Learning
PyFL-main/PyFL-main/model/pytorch/pytorch_models.py
pytorch_models.py
py
14,656
python
en
code
1
github-code
7
[ { "api_name": "model.pytorch.resnet", "line_number": 14, "usage_type": "name" }, { "api_name": "model.pytorch.resnet", "line_number": 16, "usage_type": "name" }, { "api_name": "model.pytorch.resnet", "line_number": 18, "usage_type": "name" }, { "api_name": "model....
3836800026
from typing import Tuple, List from PIL import Image # requires pillow from IPython.display import display import numpy as np # requires numpy import cogpyt def show_image_from_destination(data: np.ndarray, width, height): display(get_image_from_destination(data, width, height)) def get_image_from_destination...
BoyanH/cogpyt
examples/_convolution_functions.py
_convolution_functions.py
py
3,503
python
en
code
0
github-code
7
[ { "api_name": "numpy.ndarray", "line_number": 8, "usage_type": "attribute" }, { "api_name": "IPython.display.display", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.ndarray", "line_number": 12, "usage_type": "attribute" }, { "api_name": "numpy.arr...
10790000652
import torch import torch.nn as nn class KurtosisWeight: def __init__(self, weight_tensor, name, kurtosis_target=2.0, k_mode='avg', KLD=False): self.kurtosis_loss = 0 self.kurtosis = 0 self.weight_tensor = weight_tensor self.name = name self.k_mode = k_mode self.kur...
BlueAnon/BD-BNN
kurtosis.py
kurtosis.py
py
2,354
python
en
code
4
github-code
7
[ { "api_name": "torch.nn.KLDivLoss", "line_number": 16, "usage_type": "call" }, { "api_name": "torch.nn", "line_number": 16, "usage_type": "name" }, { "api_name": "torch.mean", "line_number": 24, "usage_type": "call" }, { "api_name": "torch.std", "line_number":...
29105140081
import time import numpy as np from scipy import ndimage from niclib.medpy_hausdorff import hd as haussdorf_dist def compute_confusion_matrix(y_true, y_pred): """ Returns tuple tp, tn, fp, fn """ assert y_true.size == y_pred.size true_pos = np.sum(np.logical_and(y_true, y_pred)) true_neg = n...
albertclerigues/stroke-core-ct-segmentation
storage/lib/niclib/metrics.py
metrics.py
py
3,754
python
en
code
7
github-code
7
[ { "api_name": "numpy.sum", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.logical_and", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.sum", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.logical_and", "line_n...
71935447583
from typing import List, NamedTuple import yaml from cros.factory.hwid.service.appengine import git_util from cros.factory.hwid.v3 import filesystem_adapter from cros.factory.utils import type_utils class HWIDDBMetadata(NamedTuple): """A placeholder for metadata of a HWID DB.""" name: str board_name: str ve...
arccode/factory
py/hwid/service/appengine/hwid_repo.py
hwid_repo.py
py
7,611
python
en
code
3
github-code
7
[ { "api_name": "typing.NamedTuple", "line_number": 10, "usage_type": "name" }, { "api_name": "cros.factory.hwid.v3.filesystem_adapter.FileSystemAdapterException", "line_number": 58, "usage_type": "attribute" }, { "api_name": "cros.factory.hwid.v3.filesystem_adapter", "line_num...
74980482142
#!/usr/bin/python3.4 #MKerbachi November 6th, 2015 #Python code to control two motors with Rpi A+ with the H bridge l298n import RPi.GPIO as GPIO # always needed with RPi.GPIO import time import curses # get the curses screen window screen = curses.initscr() # turn off input echoing curses.noecho() # respond t...
dxh8808/rpi-l298n
pi-l298n.py
pi-l298n.py
py
5,702
python
en
code
0
github-code
7
[ { "api_name": "curses.initscr", "line_number": 11, "usage_type": "call" }, { "api_name": "curses.noecho", "line_number": 14, "usage_type": "call" }, { "api_name": "curses.cbreak", "line_number": 17, "usage_type": "call" }, { "api_name": "RPi.GPIO.setmode", "li...
34879050329
from django.urls import path from . import views from django_app import settings urlpatterns = [ path('', views.index, name = 'index'), path('signup', views.signup, name = 'signup'), path('signin', views.signin, name = 'signin'), path('mypage/<int:pk>', views.mypage, name = 'mypage'), path('create...
Yuto-Kurano/english
urls.py
urls.py
py
900
python
en
code
0
github-code
7
[ { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 8, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 9, "usage_type": "call" }, { "api_name": "django.urls.path", ...
24018258571
import json import numpy as np import numpy.testing as npt import pytest from mudata import MuData from scirpy.pp import ir_dist from scirpy.tl._ir_query import ( _reduce_json, _reduce_most_frequent, _reduce_unique_only, ir_query, ir_query_annotate, ir_query_annotate_df, ) @pytest.mark.param...
scverse/scirpy
src/scirpy/tests/test_ir_query.py
test_ir_query.py
py
6,530
python
en
code
181
github-code
7
[ { "api_name": "scirpy.pp.ir_dist", "line_number": 23, "usage_type": "call" }, { "api_name": "scirpy.tl._ir_query.ir_query", "line_number": 24, "usage_type": "call" }, { "api_name": "mudata.MuData", "line_number": 34, "usage_type": "argument" }, { "api_name": "pyte...
35121750193
import numpy as np import matplotlib.pyplot as plt from sympy import Symbol, core from typing import Tuple from sympy.solvers import solve def bifurcation_diagram(funtion_solution, min_alpha, max_alpha, alpha_gap): """ Plots the bifurcation diagram with a given function. Args: funtion_sol...
markustyj/ML-CrowdSimulation
EX4/task2/bifurcation_diagram.py
bifurcation_diagram.py
py
1,747
python
en
code
1
github-code
7
[ { "api_name": "sympy.Symbol", "line_number": 21, "usage_type": "call" }, { "api_name": "numpy.arange", "line_number": 22, "usage_type": "call" }, { "api_name": "sympy.solvers.solve", "line_number": 29, "usage_type": "call" }, { "api_name": "sympy.core.numbers", ...
22699405520
import qrcode # Create a QR code instance qr = qrcode.QRCode(version=1, box_size=10, border=5) # Add data to the QR code data = "Hello, World!" nom = "hasnaoui" prenom = "yahya" age = "23" qr.add_data(data) qr.add_data(nom) qr.add_data(prenom) qr.add_data(age) qr.make(fit=True) # Create an image from the QR code img...
yedder6/createQrCode
qrcodee.py
qrcodee.py
py
418
python
en
code
0
github-code
7
[ { "api_name": "qrcode.QRCode", "line_number": 4, "usage_type": "call" } ]
9344994578
#!/usr/bin/python # -*- coding: utf-8 -*- """The main implementation for calling pysorter from the commandline""" from __future__ import print_function import argparse import logging import os import sys from .oranize import Organizer from .rules import RulesFileClassifier log = logging.getLogger(__name__) _last_...
chriscz/pysorter
pysorter/commandline.py
commandline.py
py
3,913
python
en
code
42
github-code
7
[ { "api_name": "logging.getLogger", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path.abspath", "line_number": 23, "usage_type": "call" }, { "api_name": "os.path", "line_number": 23, "usage_type": "attribute" }, { "api_name": "os.path.join", "li...
30486409301
# -*- coding: utf-8 -*- import pandas as pd import numpy as np import matplotlib.pyplot as plt from sklearn.preprocessing import StandardScaler X = pd.read_csv('two_years_merged_and_reduced.csv', index_col='time', parse_dates=['time']) def wind_angle(row): x = row['Wind_U'] y = row['Win...
tvaisanen/data-mining-project-2021
01_06_weighted_power_production_and_turbine_details.py
01_06_weighted_power_production_and_turbine_details.py
py
1,119
python
en
code
0
github-code
7
[ { "api_name": "pandas.read_csv", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.logical_and.reduce", "line_number": 27, "usage_type": "call" }, { "api_name": "numpy.logical_and", "line_number": 27, "usage_type": "attribute" }, { "api_name": "pandas...
10739582032
import sys from PyQt5.QtGui import QTextCharFormat, QTextDocument, QTextCursor from PyQt5.QtWidgets import (QApplication, QMainWindow, QTextEdit, QToolBar, QLineEdit, QPushButton, QColorDialog, QHBoxLayout, QWidget) class TextEdit(QMainWindow): def __init__(self, parent=None): ...
won2930015/PyQt2
QTextEdit/HighlightText.py
HighlightText.py
py
1,970
python
en
code
6
github-code
7
[ { "api_name": "PyQt5.QtWidgets.QMainWindow", "line_number": 7, "usage_type": "name" }, { "api_name": "PyQt5.QtWidgets.QTextEdit", "line_number": 10, "usage_type": "call" }, { "api_name": "PyQt5.QtWidgets.QWidget", "line_number": 13, "usage_type": "call" }, { "api_...
24218835727
import idaapi import idascript import idautils import idc import math import itertools import json import csv import datetime import cProfile def createitems(basicblock): xrefs = lambda ea: len([x for x in XrefsFrom(ea,0)]) drefs = lambda ea: len([x for x in DataRefsFrom(ea)]) consts = lambda e...
arnew/kuestennebel
extract_json.py
extract_json.py
py
4,417
python
en
code
0
github-code
7
[ { "api_name": "idaapi.UA_MAXOP", "line_number": 15, "usage_type": "attribute" }, { "api_name": "idaapi.FlowChart", "line_number": 20, "usage_type": "call" }, { "api_name": "idaapi.get_func", "line_number": 20, "usage_type": "call" }, { "api_name": "idaapi.get_func...
23545249117
# -*- coding: utf-8 -*- from django.conf import settings from django.contrib.auth.models import Group from django.core.management.base import BaseCommand, CommandError from django.db import connection # Used for django tenants. from django.utils.translation import ugettext_lazy as _ from rest_framework.authtoken.models...
over55/workery-django
workery/tenant_foundation/management/commands/create_tenant_account.py
create_tenant_account.py
py
7,393
python
en
code
10
github-code
7
[ { "api_name": "django.core.management.base.BaseCommand", "line_number": 27, "usage_type": "name" }, { "api_name": "django.utils.translation.ugettext_lazy", "line_number": 28, "usage_type": "call" }, { "api_name": "django.db.connection.set_schema_to_public", "line_number": 75,...
31989150957
import numpy as np from torch.utils.data import Dataset from torch.utils.data import DataLoader class WineDataset(Dataset): def __init__(self, data:np.ndarray): self.data = data def __len__(self): return self.data.shape[0] def __getitem__(self, index): x = self....
lhycms/Deep_Learning_Notes
1.Basic/code/1.demo1/wineDataset.py
wineDataset.py
py
1,275
python
en
code
0
github-code
7
[ { "api_name": "torch.utils.data.Dataset", "line_number": 6, "usage_type": "name" }, { "api_name": "numpy.ndarray", "line_number": 7, "usage_type": "attribute" }, { "api_name": "numpy.loadtxt", "line_number": 24, "usage_type": "call" }, { "api_name": "torch.utils.d...
71385735904
import contextlib import io import os import subprocess import sys import six from six.moves import xrange, input try: import simplejson as json except ImportError: import json stdout = io.FileIO(sys.stdout.fileno(), "wb") stderr = io.FileIO(sys.stderr.fileno(), "wb") def run_proc(cmd, **kwargs): p = ...
eldarion/gondor-client
gondor/utils.py
utils.py
py
3,982
python
en
code
38
github-code
7
[ { "api_name": "io.FileIO", "line_number": 16, "usage_type": "call" }, { "api_name": "sys.stdout.fileno", "line_number": 16, "usage_type": "call" }, { "api_name": "sys.stdout", "line_number": 16, "usage_type": "attribute" }, { "api_name": "io.FileIO", "line_num...
38525590113
import streamlit as st import pandas as pd name_1 = st.text_input("Name 1:- ") date_1 = st.text_input("Date of birth 1:- ") name_2 = st.text_input("Name 2:- ") date_2 = st.text_input("Date of birth 2:- ") compat_dict = {"A" : {1 : [4, 5, 7], 2 : [4, 6, 22], 3 : [3, 6, 8, 9], 4 : [1, 2, 7, 8], 5 : [1], 6 : [2, 3, ...
PrabhupadaPradhan/numerology_2
numerology_4.py
numerology_4.py
py
2,748
python
en
code
1
github-code
7
[ { "api_name": "streamlit.text_input", "line_number": 3, "usage_type": "call" }, { "api_name": "streamlit.text_input", "line_number": 4, "usage_type": "call" }, { "api_name": "streamlit.text_input", "line_number": 5, "usage_type": "call" }, { "api_name": "streamlit...
11118508827
# -*- coding: utf-8 -*- """Application filter for `datetime`_ 24 hours. .. _datetime: https://docs.python.org/2/library/datetime.html """ from datetime import date, timedelta from django import template register = template.Library() @register.filter(name='format_time') def format_time(value): if value is None:...
rubenvanerk/lifesavingrankings
rankings/templatetags/datetime_filter.py
datetime_filter.py
py
817
python
en
code
1
github-code
7
[ { "api_name": "django.template.Library", "line_number": 10, "usage_type": "call" }, { "api_name": "django.template", "line_number": 10, "usage_type": "name" }, { "api_name": "datetime.timedelta", "line_number": 19, "usage_type": "call" }, { "api_name": "datetime.d...
40661251057
import numpy as np import matplotlib.pyplot as plt def loadDataSet(fileName): data=[] with open(fileName,'r+') as f: content=f.readlines() for line in content: line_arr=line.strip().split('\t') data.append(list([float(line_arr[4]),float(line_arr[3])])) return data #...
whyang78/machineLearning-base
K-means/地理坐标聚类.py
地理坐标聚类.py
py
4,385
python
en
code
3
github-code
7
[ { "api_name": "numpy.sqrt", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.sum", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.power", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.sin", "line_number": 21, ...
25864066626
import numpy as np import pandas as pd import matplotlib.pyplot as plt import matplotlib.patches as patches np.random.seed(1) plt.rcParams["font.family"] = "Times New Roman" colors = ['C1', 'C0'] def generate_fake_data(n, freqs, alphas, starts=None): if starts is None: starts = np.random.ra...
thomas097/Haemodynamic-Optimization-Reinforcement-Learning
figures/figure_resampling.py
figure_resampling.py
py
3,702
python
en
code
0
github-code
7
[ { "api_name": "numpy.random.seed", "line_number": 5, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 5, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot.rcParams", "line_number": 7, "usage_type": "attribute" }, { "api_name": "matp...
30321988429
""" Little module offering functions to destroy text by repeated Google translations. .. moduleauthor:: Signaltonsalat """ import logging as log import random from time import sleep import click import googletrans from fuzzywuzzy import fuzz COOLDOWN = 0.5 def validate_path(path): """ Takes a comma-separ...
Palculator/schwurbler
src/schwurbler/schwurbler.py
schwurbler.py
py
4,754
python
en
code
0
github-code
7
[ { "api_name": "googletrans.LANGUAGES", "line_number": 46, "usage_type": "attribute" }, { "api_name": "googletrans.Translator", "line_number": 74, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 82, "usage_type": "call" }, { "api_name": "googletr...
29019154179
import scipy.io.wavfile as sio import scipy.signal as sig import scipy.ndimage as ndimg import numpy as np import cv2 #Import raw 11025 Hz wav file (Fs, audioRaw) = sio.read('DataAq/Resampled/20190523_195020Z_137100000Hz_AF.wav') audioRaw = audioRaw/(2.**15) lineLen = int(np.floor(Fs/2)) lineTotal = int(np....
fdcavalcanti/wsat-decoder
wsat-decode.py
wsat-decode.py
py
2,060
python
en
code
0
github-code
7
[ { "api_name": "scipy.io.wavfile.read", "line_number": 8, "usage_type": "call" }, { "api_name": "scipy.io.wavfile", "line_number": 8, "usage_type": "name" }, { "api_name": "numpy.floor", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.floor", "l...
73079595742
import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns from sklearn.linear_model import LogisticRegression from sklearn.model_selection import train_test_split import os from sklearn.externals import joblib df = pd.read_csv("heart.csv") print(df.head()) print(df.tar...
Guru7373/Heart-Disease-Prediction-Using-ML-and-Flask
final.py
final.py
py
7,462
python
en
code
1
github-code
7
[ { "api_name": "pandas.read_csv", "line_number": 10, "usage_type": "call" }, { "api_name": "seaborn.countplot", "line_number": 16, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.show", "line_number": 17, "usage_type": "call" }, { "api_name": "matplotlib.p...
16153427704
import discord import os import io import random from discord.ext import commands from contextlib import redirect_stdout import traceback import textwrap bot = commands.Bot(command_prefix = "a.", description = "This is a customized bot for The Clubhouse! If you have any suggestions, please tag a Bot Developer.", owner...
MininDiamond123/clubhouse
club.py
club.py
py
3,370
python
en
code
0
github-code
7
[ { "api_name": "discord.ext.commands.Bot", "line_number": 10, "usage_type": "call" }, { "api_name": "discord.ext.commands", "line_number": 10, "usage_type": "name" }, { "api_name": "discord.Embed", "line_number": 28, "usage_type": "call" }, { "api_name": "discord.C...
71308496542
import matplotlib.pyplot as plt import numpy as np import pandas as pd import scipy.stats as ss from matplotlib.ticker import FixedFormatter from matplotlib.ticker import FixedLocator def plot_individual_specific_effects(with_parameters=None): fig, ax = plt.subplots() x = np.linspace(-5, 5, 5000) pdf = s...
OpenSourceEconomics/ose-course-data-science
lectures/potential-outcome-model/auxiliary.py
auxiliary.py
py
1,434
python
en
code
87
github-code
7
[ { "api_name": "matplotlib.pyplot.subplots", "line_number": 11, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 11, "usage_type": "name" }, { "api_name": "numpy.linspace", "line_number": 12, "usage_type": "call" }, { "api_name": "scipy.sta...
603742735
import os import pandas as pd import streamlit as st from llama_index import GPTVectorStoreIndex, SimpleDirectoryReader from llama_index import download_loader from matplotlib import pyplot as plt from pandasai.llm.openai import OpenAI documents_folder = "documents" # Load PandasAI loader, Which is a wrapper over Pa...
anoopshrma/Chat-with-Docs
chat_with_docs.py
chat_with_docs.py
py
4,353
python
en
code
80
github-code
7
[ { "api_name": "llama_index.download_loader", "line_number": 13, "usage_type": "call" }, { "api_name": "streamlit.title", "line_number": 15, "usage_type": "call" }, { "api_name": "streamlit.header", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path....
73102530462
import tensorflow as tf import model_input import cv2 import numpy as np import os def pred(test_data, log_dir, model_path, image_size): images = tf.placeholder(tf.float32, shape=[None, image_size, image_size, 3]) logits = model_input.inference(model_path, images, 2, False) predict = tf.nn.softmax(logits)...
buptlj/tf_finetune
prediction.py
prediction.py
py
1,739
python
en
code
4
github-code
7
[ { "api_name": "tensorflow.placeholder", "line_number": 9, "usage_type": "call" }, { "api_name": "tensorflow.float32", "line_number": 9, "usage_type": "attribute" }, { "api_name": "model_input.inference", "line_number": 10, "usage_type": "call" }, { "api_name": "te...
3766034110
from django import forms from . models import Contact class FormContact(forms.ModelForm): name = forms.CharField(max_length=200, label="Name", widget=forms.TextInput(attrs={ 'class' : 'form-control', 'placeholder' : 'Quý danh của bạn', 'required' : 'required', })) email = forms.Em...
HuynhNguyenCaoPhuong/ClassyMen
store/form.py
form.py
py
1,010
python
vi
code
0
github-code
7
[ { "api_name": "django.forms.ModelForm", "line_number": 5, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 5, "usage_type": "name" }, { "api_name": "django.forms.CharField", "line_number": 6, "usage_type": "call" }, { "api_name": "django.f...
14464581147
from django.test import ( TestCase, Client ) from account.models import ( User, Collection ) from .models import ( Photo, HashTag, PhotoHashTag, PhotoCollection ) class RelatedPhotoViewTest(TestCase): def setUp(self): User.objects.create( id = 1, ...
dhkim12310/wecode-weplash
photo/tests.py
tests.py
py
5,336
python
en
code
0
github-code
7
[ { "api_name": "django.test.TestCase", "line_number": 17, "usage_type": "name" }, { "api_name": "account.models.User.objects.create", "line_number": 19, "usage_type": "call" }, { "api_name": "account.models.User.objects", "line_number": 19, "usage_type": "attribute" }, ...
23105105936
from twilio.rest import Client # Your Account Sid and Auth Token from twilio.com/console # DANGER! This is insecure. See http://twil.io/secure account_sid = 'put account sid here' auth_token = 'put auth token here' client = Client(account_sid, auth_token) message = client.messages \ .create( ...
smsenvelope/sms-notifier
src/twilio_example.py
twilio_example.py
py
501
python
en
code
0
github-code
7
[ { "api_name": "twilio.rest.Client", "line_number": 7, "usage_type": "call" } ]
19746353105
import requests import pandas as pd import os from datetime import date as dt def get_articles(category, cat_fmt='cmpageid', save_tsv=False): ''' This function parses a Category page of Wiktionary, extracts the category members and the pageid corresponding to each member's page. It is aimed to extr...
nataquinones/wikiIPA
code/scripts/wikiIPA_tools.py
wikiIPA_tools.py
py
2,800
python
en
code
0
github-code
7
[ { "api_name": "requests.get", "line_number": 41, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 47, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 55, "usage_type": "call" }, { "api_name": "os.path.join", "line_n...
30663381769
from functools import reduce from typing import List class Solution: def wordCount(self, startWords: List[str], targetWords: List[str]) -> int: b = ord('a') seen = set() for s in startWords: r = reduce(lambda a, b: a | b, (1 << (ord(ch) - b) for ch in s)) for i in r...
yutao-li/leetcode
2135.py
2135.py
py
511
python
en
code
0
github-code
7
[ { "api_name": "typing.List", "line_number": 6, "usage_type": "name" }, { "api_name": "functools.reduce", "line_number": 10, "usage_type": "call" } ]
22671520976
from django.contrib import admin from .models import Post, Category admin.site.register(Category) @admin.register(Post) class PostAdmin(admin.ModelAdmin): list_display = ['title', 'slug', 'publish', 'status'] search_fields = ['title', 'body'] # По какому полю искать prepopulated_fields = {'slug': ('titl...
zikrillo098/Salt
gimalian/admin.py
admin.py
py
412
python
en
code
0
github-code
7
[ { "api_name": "django.contrib.admin.site.register", "line_number": 4, "usage_type": "call" }, { "api_name": "models.Category", "line_number": 4, "usage_type": "argument" }, { "api_name": "django.contrib.admin.site", "line_number": 4, "usage_type": "attribute" }, { ...
21276433084
from django.contrib import admin from .models import Blog, Tag, Comment # Register your models here. class BloggingAdmin(admin.ModelAdmin): list_display = ('title', 'author', 'is_published', 'list_date') list_editable = ('is_published') class CommentAdmin(admin.ModelAdmin): list_display = ('name'...
amialiashkasashka/appetizer-django
blogging/admin.py
admin.py
py
532
python
en
code
0
github-code
7
[ { "api_name": "django.contrib.admin.ModelAdmin", "line_number": 6, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 6, "usage_type": "name" }, { "api_name": "django.contrib.admin.ModelAdmin", "line_number": 10, "usage_type": "attribute" ...
37774082038
import tornado.httpserver import tornado.ioloop import tornado.options import tornado.web import logging import nltk import urllib from nltk.corpus import names from nltk.corpus import wordnet from nlp_nn import NaturalLanguageNetwork from tornado.options import define, options define("port", default=8000, help="run ...
alexbass112/Empathica
nlp-service/empathica-nlp.py
empathica-nlp.py
py
2,696
python
en
code
2
github-code
7
[ { "api_name": "tornado.options.define", "line_number": 14, "usage_type": "call" }, { "api_name": "nlp_nn.NaturalLanguageNetwork", "line_number": 16, "usage_type": "call" }, { "api_name": "nltk.corpus.names.fileids", "line_number": 19, "usage_type": "call" }, { "ap...
35948927795
#------------------------------------# # #双分支连接 # #------------------------------------# import numpy as np import torch, math import ttach as tta import matplotlib.pyplot as plt class Combiner: def __init__(self, epoch_number, device,args): self.args =args self.epoch_number = epoch_nu...
Liujehong/BBU_net_seg
building_segmetation/models/conbainer.py
conbainer.py
py
3,322
python
en
code
0
github-code
7
[ { "api_name": "torch.cat", "line_number": 47, "usage_type": "call" }, { "api_name": "torch.sigmoid", "line_number": 50, "usage_type": "call" }, { "api_name": "torch.cat", "line_number": 68, "usage_type": "call" }, { "api_name": "torch.sigmoid", "line_number": ...
25178614280
#!/usr/bin/env python import sys from Bio import SeqIO seq_index = SeqIO.index(sys.argv[1], 'fasta') tau_star_file = open(sys.argv[2]) etaS_file = open(sys.argv[3]) outbase = sys.argv[4] head = etaS_file.readline() hl = head.split(",") strainseqs = [{} for x in range(len(hl)-1)] for line in etaS_file: d = line.rs...
leosouliotis/DESMAN
scripts/write_strain_fasta.py
write_strain_fasta.py
py
1,112
python
en
code
null
github-code
7
[ { "api_name": "Bio.SeqIO.index", "line_number": 5, "usage_type": "call" }, { "api_name": "Bio.SeqIO", "line_number": 5, "usage_type": "name" }, { "api_name": "sys.argv", "line_number": 5, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 6,...
38115171342
#!/usr/bin/env python3 import sys import traceback import pandas as pd def sex2deg(str): deg = 0.0 negative = False for elem in reversed(str.split(":")): if negative: raise Exception("FFS") exit(1) deg /= 60.0 f = float(elem) if f < 0.0: ...
tjgalvin/racs_misc
convert.py
convert.py
py
1,996
python
en
code
1
github-code
7
[ { "api_name": "pandas.read_csv", "line_number": 44, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 44, "usage_type": "attribute" }, { "api_name": "yaml.dump", "line_number": 87, "usage_type": "call" } ]
74009029342
import requests from requests.adapters import HTTPAdapter from requests.packages.urllib3.util.retry import Retry from bs4 import BeautifulSoup counter = 1 user_agent = '''Mozilla/5.0 (Windows NT 10.0; Win64; x64; \ rv:82.0) Gecko/20100101 Firefox/82.0''' def soupify(dataframe): """ Converts the markup o...
Alor-e/datascience_hire_task
product_info_scraper.py
product_info_scraper.py
py
2,183
python
en
code
0
github-code
7
[ { "api_name": "requests.Session", "line_number": 24, "usage_type": "call" }, { "api_name": "requests.packages.urllib3.util.retry.Retry", "line_number": 25, "usage_type": "call" }, { "api_name": "requests.adapters.HTTPAdapter", "line_number": 26, "usage_type": "call" }, ...
21892184938
#!/usr/bin/env python # AUTHOR : AVI MEHENWAL # DATE : 25-March-2014 # PURPOSE : POrt scanning utility """ ENHANCEMENTS: - Parallel Threads - List of open ports ? - Queue Implementation - Gevent based greenlets - SocketStatus to be kept seperate in dict format""" from datetime import datetime import subpr...
avimehenwal/python.avimehenwal
src/PortScanner/PortScanner.py
PortScanner.py
py
3,778
python
en
code
0
github-code
7
[ { "api_name": "subprocess.call", "line_number": 24, "usage_type": "call" }, { "api_name": "subprocess.call", "line_number": 26, "usage_type": "call" }, { "api_name": "os.name", "line_number": 29, "usage_type": "attribute" }, { "api_name": "sys.platform", "line...
75016258143
#!/usr/bin/env python3 # # get all the groups and their memebers to create a CSV for the address book. # this handles nested groups # import argparse import collections import re import subprocess import sys import os BLOCK_LIST = ['owners@cuttersstudios.com', 'skii@cutters.com', 'thursday@cuttersstudios.com', 'tumb...
elliotnev27/gam_scripts
gam_groups_members-cutters.py
gam_groups_members-cutters.py
py
6,140
python
en
code
0
github-code
7
[ { "api_name": "os.path.expanduser", "line_number": 18, "usage_type": "call" }, { "api_name": "os.path", "line_number": 18, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path", "line_numb...
24693077353
import os import ftplib from dotenv import load_dotenv from datetime import datetime load_dotenv() password = os.getenv('_PASSWORD_MYSQL') user = os.getenv('_USER_MYSQL') backup_dir = os.getenv('_BACKUP_DIR') backup_name = ( os.getenv('_BACKUP_NAME') + datetime.now().strftime('%Y%m%d%H%M%S') + '.sql' ) ba...
matheusmendez/mqtt_client_dht22
mqtt_client_dht22/mysql_backup.py
mysql_backup.py
py
1,971
python
en
code
0
github-code
7
[ { "api_name": "dotenv.load_dotenv", "line_number": 6, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 8, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 9, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 10...
27684551030
from discord.ext import commands from src.permissions import is_developer import discord import datetime import time def setup(bot): bot.add_command(setup_command(time.time())) def setup_command(start_time): @commands.command() @is_developer() async def uptime(ctx): current_time = time.time(...
LoaiDev/LoaiBot
src/commands/uptime.py
uptime.py
py
618
python
en
code
0
github-code
7
[ { "api_name": "time.time", "line_number": 9, "usage_type": "call" }, { "api_name": "time.time", "line_number": 16, "usage_type": "call" }, { "api_name": "datetime.timedelta", "line_number": 18, "usage_type": "call" }, { "api_name": "discord.Embed", "line_numbe...
354788707
"""AWS Lambda handlers.""" import email import os import time from fleece.xray import (monkey_patch_botocore_for_xray) from decorators import authenticate from decorators import get_ses_message from decorators import is_not_blocked from helpers import send_letter from helpers import send_message from helpers import ...
hmngwy/secureletter
methods.py
methods.py
py
4,476
python
en
code
0
github-code
7
[ { "api_name": "fleece.xray.monkey_patch_botocore_for_xray", "line_number": 19, "usage_type": "call" }, { "api_name": "os.environ.get", "line_number": 20, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 20, "usage_type": "attribute" }, { "api_nam...
20868661313
from collections import deque def solution(maps): def bfs(start,end): n = len(maps) m = len(maps[0]) dx = [-1,1,0,0] dy = [0,0,-1,1] queue = deque([(start,end)]) while queue: x,y = queue.popleft() for i in range(4): nx = ...
kimdouk/Algorithm-PS
프로그래머스/lv2/1844. 게임 맵 최단거리/게임 맵 최단거리.py
게임 맵 최단거리.py
py
646
python
en
code
0
github-code
7
[ { "api_name": "collections.deque", "line_number": 10, "usage_type": "call" } ]
14489267189
import os import requests import re from bs4 import BeautifulSoup from pytube import YouTube #from moviepy.editor import * def get_linklist_by_title(searh_request, count=5): urls, plst, urls_emb = [], set(), [] #convert to querry view and get response resp = requests.get('https://www.youtube.com/results...
asmalx/MP3-downloader
functions.py
functions.py
py
1,979
python
en
code
3
github-code
7
[ { "api_name": "requests.get", "line_number": 14, "usage_type": "call" }, { "api_name": "re.findall", "line_number": 16, "usage_type": "call" }, { "api_name": "pytube.YouTube", "line_number": 33, "usage_type": "call" }, { "api_name": "pytube.YouTube", "line_num...
24595131814
from django.contrib import admin from django.contrib.auth.admin import UserAdmin from . import models @admin.register(models.User) class CustomUserAdmin(UserAdmin): """Custom User Admin """ CUSTOM_PROFILE_FILED = ( ( "Custom Profile", { "fields": ( ...
ChoiNakHoon/stampKorea
users/admin.py
admin.py
py
997
python
en
code
0
github-code
7
[ { "api_name": "django.contrib.auth.admin.UserAdmin", "line_number": 7, "usage_type": "name" }, { "api_name": "django.contrib.auth.admin.UserAdmin.fieldsets", "line_number": 30, "usage_type": "attribute" }, { "api_name": "django.contrib.auth.admin.UserAdmin", "line_number": 30...
23991474383
from ..dataset import Sample, Subset, ClassificationDataset import pickle import numpy as np import os class PetsDataset(ClassificationDataset): ''' Dataset of cat and dog images from CIFAR-10 (class 0: cat, class 1: dog). ''' def __init__(self, fdir: str, subset: Subset): ''' Loads a ...
Normale/DeepLearning-course
cats_dogs/dlvc/datasets/pets.py
pets.py
py
3,540
python
en
code
0
github-code
7
[ { "api_name": "dataset.ClassificationDataset", "line_number": 6, "usage_type": "name" }, { "api_name": "dataset.Subset", "line_number": 11, "usage_type": "name" }, { "api_name": "pickle.load", "line_number": 31, "usage_type": "call" }, { "api_name": "dataset.Subse...
22448815732
import torch import torch.nn as nn import torch.optim as optim import torch.nn.functional as F from PIL import Image import numpy as np import os import pdb import torchvision from torchvision import models from torch.utils.data import Dataset, DataLoader from torchvision import transforms, utils from sklearn.model_sel...
rahulbansal10/domain_adaptation
work_code/main.py
main.py
py
5,286
python
en
code
1
github-code
7
[ { "api_name": "pickle.load", "line_number": 25, "usage_type": "call" }, { "api_name": "torchvision.transforms.Normalize", "line_number": 40, "usage_type": "call" }, { "api_name": "torchvision.transforms", "line_number": 40, "usage_type": "name" }, { "api_name": "t...
20561829204
from nltk import word_tokenize, pos_tag from nltk.corpus import wordnet as wn import time def sentence_similarity(sentence1, sentence2): """ compute the sentence similarity using Wordnet """ # Tokenize and tag sentence1 = word_tokenize(sentence1) sentence2 = word_tokenize(sentence2) # Get the ...
dantordj/SemanticClustering
sem_distance.py
sem_distance.py
py
1,322
python
en
code
1
github-code
7
[ { "api_name": "nltk.word_tokenize", "line_number": 10, "usage_type": "call" }, { "api_name": "nltk.word_tokenize", "line_number": 11, "usage_type": "call" }, { "api_name": "nltk.corpus.wordnet.synsets", "line_number": 14, "usage_type": "call" }, { "api_name": "nlt...
42937553114
import errno import functools import socket from time import sleep import pandas import paho.mqtt.client as mqtt import json from argos import tbHome import tornado.ioloop from tornado.iostream import IOStream from multiprocessing.pool import ThreadPool import argparse _workers = ThreadPool(50) thingsboardHost = "1...
argosp/pyargos
argos/old/bin/argos-port-to-MQTT-NDIR.py
argos-port-to-MQTT-NDIR.py
py
3,608
python
en
code
0
github-code
7
[ { "api_name": "multiprocessing.pool.ThreadPool", "line_number": 16, "usage_type": "call" }, { "api_name": "pandas.Timestamp", "line_number": 40, "usage_type": "call" }, { "api_name": "tornado.iostream.IOStream", "line_number": 55, "usage_type": "call" }, { "api_na...
12151651894
# import numpy as np # import matplotlib.pyplot as plt # import os # from skimage.io import imread # from skimage.draw import polygon # import pandas as pd # from sklearn.metrics import confusion_matrix, classification_report # from skimage.util import img_as_float # # disaster_type = 'wind' # labelsDB = pd.read_pickle...
Seyed-Ali-Ahmadi/Building-Damage-Assessment
CodeGarbage/check_1.py
check_1.py
py
11,491
python
en
code
6
github-code
7
[ { "api_name": "matplotlib.colors.ListedColormap", "line_number": 90, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 94, "usage_type": "call" }, { "api_name": "skimage.draw.polygon", "line_number": 104, "usage_type": "call" }, { "api_name": "pa...
30488031421
import pygame from player import Player from bullet import Bullet from enemy import Enemy from squadron import Squadron # Game settings WINDOW_WIDTH = 400 WINDOW_HEIGHT = 600 GAME_SIDE_MARGIN = 10 GAME_TOP_MARGIN = 40 GAME_BOTTOM_MARGIN = GAME_TOP_MARGIN GAME_BORDER_WIDTH = 3 GAME_WALL_TOP = GAME_TOP_MARGIN + GAME_B...
alvarogarcia123/SpaceInvadersGame
main.py
main.py
py
4,753
python
en
code
0
github-code
7
[ { "api_name": "pygame.init", "line_number": 26, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 27, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 27, "usage_type": "attribute" }, { "api_name": "pygame.displa...
21888346308
import pyttsx3 import speech_recognition as sr import datetime import os import webbrowser import wikipedia import random import smtplib print(" INITIALIZING JARVIS ") CREATOR= "JOHN" # YOUR NAME CAN BE ENTERED HERE engine = pyttsx3.init("sapi5") voices = engine.get...
Avimehta14/RUDIMENTARY-PYTHON-V.A-
F.L.Y.N.N.py
F.L.Y.N.N.py
py
6,074
python
en
code
0
github-code
7
[ { "api_name": "pyttsx3.init", "line_number": 14, "usage_type": "call" }, { "api_name": "smtplib.SMTP", "line_number": 19, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 32, "usage_type": "call" }, { "api_name": "datetime.datetime", ...
34302992209
import operator import re from ..lib.misc import file_scan, hash_files, random_string from functools import reduce from itertools import chain from pyramid.view import view_config from pyramid.renderers import render_to_response import logging log = logging.getLogger(__name__) random_revision = random_string() @...
kusl/flexi-core-system
webapp/flexi/views/cache_manifest.py
cache_manifest.py
py
1,097
python
en
code
0
github-code
7
[ { "api_name": "logging.getLogger", "line_number": 12, "usage_type": "call" }, { "api_name": "lib.misc.random_string", "line_number": 15, "usage_type": "call" }, { "api_name": "itertools.chain", "line_number": 24, "usage_type": "call" }, { "api_name": "operator.att...
29042234527
import os,psutil,time,datetime as dttime from optparse import OptionParser from paircarstools.access_ms import * from paircarstools.basic_func import * from paircarstools.flagger import * from paircarstasks.split_ms import * from casatasks import * from casatools import msmetadata,table,measures,quanta,agentflagger,ima...
devojyoti96/P-AIRCARS
paircarstasks/parallel_ms_split.py
parallel_ms_split.py
py
18,442
python
en
code
0
github-code
7
[ { "api_name": "os.system", "line_number": 11, "usage_type": "call" }, { "api_name": "psutil.cpu_count", "line_number": 32, "usage_type": "call" }, { "api_name": "psutil.cpu_percent", "line_number": 32, "usage_type": "call" }, { "api_name": "time.time", "line_n...
73431848223
from pymongo import MongoClient import config client = MongoClient() db = client[config.db_name] posts = db.posts def get_coord(t_id): loc_log = {} loc_lat = {} for id in t_id: count2 = 0 for post in posts.find({'id':id}): log = 0.0 lat = 0.0 count = 0....
himanshuIndia/sentiment_analysis
db_op.py
db_op.py
py
982
python
en
code
0
github-code
7
[ { "api_name": "pymongo.MongoClient", "line_number": 5, "usage_type": "call" }, { "api_name": "config.db_name", "line_number": 6, "usage_type": "attribute" } ]
72844248222
import os import glob import argparse from PIL import Image from skimage import io import numpy as np from tqdm import tqdm WORK_DIR = './workspace/U-2-Net' def parse_args(): parser = argparse.ArgumentParser( description='Postprocess for U-2-Net' ) parser.add_argument('--image_dir', type=str, d...
Ascend/ModelZoo-PyTorch
ACL_PyTorch/built-in/cv/U2-Net_for_PyTorch/postprocess.py
postprocess.py
py
1,979
python
en
code
31
github-code
7
[ { "api_name": "argparse.ArgumentParser", "line_number": 15, "usage_type": "call" }, { "api_name": "PIL.Image.fromarray", "line_number": 27, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 27, "usage_type": "name" }, { "api_name": "os.sep", "l...
43025384309
import glob import numpy as np import cv2 import yaml boardsize = [6, 7] numEdgeX = 7 numEdgeY = 6 img_shape = (640,480) criteria = (cv2.TermCriteria_EPS + cv2.TermCriteria_MAX_ITER, 30, 0.001) criteria_cal = (cv2.TermCriteria_EPS + cv2.TermCriteria_MAX_ITER, 30, 1e-5) objp = n...
BanafshehKarimian/stereo
t1.py
t1.py
py
4,644
python
en
code
0
github-code
7
[ { "api_name": "cv2.TermCriteria_EPS", "line_number": 11, "usage_type": "attribute" }, { "api_name": "cv2.TermCriteria_MAX_ITER", "line_number": 12, "usage_type": "attribute" }, { "api_name": "cv2.TermCriteria_EPS", "line_number": 13, "usage_type": "attribute" }, { ...
8560060590
import logging import pandas as pd from dotenv import load_dotenv import os from pymongo import MongoClient import certifi import requests from pyquery import PyQuery logger = logging.getLogger('process_doc') logger.setLevel(logging.INFO) logger.addHandler(logging.StreamHandler()) #init Mongo Client as global client ...
Marcus-Lion/ml-samples
src/process/process_doc.py
process_doc.py
py
5,717
python
en
code
1
github-code
7
[ { "api_name": "logging.getLogger", "line_number": 10, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 11, "usage_type": "attribute" }, { "api_name": "logging.StreamHandler", "line_number": 12, "usage_type": "call" }, { "api_name": "dotenv.load...
36099126725
import pandas as pd from pymongo import MongoClient,TEXT from json import loads from datetime import datetime client = MongoClient('mongodb://localhost:27017/') db = client["datavis"] senate = db["senate"] chamber = db["chamber"] def to_mongo(dest, data, idxs=[]): dest.drop() for chunk in data: dest...
israelcvidal/datavis-project
insert.py
insert.py
py
861
python
en
code
0
github-code
7
[ { "api_name": "pymongo.MongoClient", "line_number": 6, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 16, "usage_type": "call" }, { "api_name": "pymongo.TEXT", "line_number": 21, "usage_type": "name" }, { "api_name": "datetime.datetime", "l...
7615795328
import pandas as pd import re #清楚数字标点的标准库 from textblob import TextBlob import emotion from nltk.corpus import stopwords # 下载之后 载入字典 from nltk.stem.porter import PorterStemmer # stem:词根 PorterStemmer: 词根函数库 positive, negative = emotion.get_emotion() positive = tuple(positive) negative = tuple(negative) table = "m...
SunshineHJian/--hujian
code/first_1.py
first_1.py
py
3,943
python
en
code
1
github-code
7
[ { "api_name": "emotion.get_emotion", "line_number": 9, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 18, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 35, "usage_type": "call" }, { "api_name": "nltk.stem.porter.PorterStem...
27599503987
from collections import OrderedDict import glob import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt plt.style.use('apj') import h5py from scipy.interpolate import interp1d import pandas as pd dirs_p1 = ["erf_AE_cut/erf_step_3D_Re4e2_P1e0_zeta1e-3_S1e3_Lz2_Lcz1_Pr0.5_a2_Titer0_64x64x256_schwar...
evanhanders/convective_penetration_paper
data/consolidate_time_data.py
consolidate_time_data.py
py
7,747
python
en
code
2
github-code
7
[ { "api_name": "matplotlib.pyplot.style.use", "line_number": 6, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.style", "line_number": 6, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot", "line_number": 6, "usage_type": "name" }, { "api_name"...
28972517650
import sys from collections import deque def bfs(v): q = deque([v]) #큐 구현을 위해 deque 사용 while q: v = q.popleft() if v == k: return visited[v]#BFS연산이므로 최소값을 따로 정의하지 않아도 된다. for i in (v-1, v+1, 2*v): if 0 <= i <= 100000 and not visited[i]: visited[i]...
wjsrlahrlco1998/Coding-Test-Study
koo-kwang-mo/[BOJ] 숨바꼭질/[BOJ] 숨바꼭질.py
[BOJ] 숨바꼭질.py
py
610
python
ko
code
3
github-code
7
[ { "api_name": "collections.deque", "line_number": 5, "usage_type": "call" }, { "api_name": "sys.stdin.readline", "line_number": 15, "usage_type": "call" }, { "api_name": "sys.stdin", "line_number": 15, "usage_type": "attribute" } ]
410716411
from unityagents import UnityEnvironment import numpy as np from ddpg_agent import Agent import torch from collections import deque import matplotlib.pyplot as plt env = UnityEnvironment(file_name='Tennis_Windows_x86_64/Tennis.exe',no_graphics=True) # get the default brain brain_name = env.brain_names[0] brain = env....
stgering/p3
Tennis.py
Tennis.py
py
3,774
python
en
code
0
github-code
7
[ { "api_name": "unityagents.UnityEnvironment", "line_number": 8, "usage_type": "call" }, { "api_name": "ddpg_agent.Agent", "line_number": 28, "usage_type": "call" }, { "api_name": "collections.deque", "line_number": 33, "usage_type": "call" }, { "api_name": "numpy....
9877980357
import asyncio import random import time, logging format = '[%(asctime)s] %(levelname)s: %(message)s' logger = logging.getLogger(__name__) logging.basicConfig(level=logging.DEBUG, format=format) async def heavy_work(n: int): i = 2 # random.randint(0, 2) logger.info(f"sleep for {i}") await asyncio.sleep(i...
nvkhedkar/python-code
learn/my_saas_python_class/Basics/async_base.py
async_base.py
py
678
python
en
code
0
github-code
7
[ { "api_name": "logging.getLogger", "line_number": 6, "usage_type": "call" }, { "api_name": "logging.basicConfig", "line_number": 7, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 7, "usage_type": "attribute" }, { "api_name": "asyncio.sleep",...
22710380565
import xenon_worker as wkr import utils import asyncio import pymongo from datetime import datetime, timedelta import random from backups import BackupSaver, BackupLoader MAX_BACKUPS = 15 class BackupListMenu(wkr.ListMenu): embed_kwargs = {"title": "Your Backups"} async def get_items(self): args =...
DrTexx/xenon-main
modules/backups.py
backups.py
py
13,515
python
en
code
0
github-code
7
[ { "api_name": "xenon_worker.ListMenu", "line_number": 14, "usage_type": "attribute" }, { "api_name": "pymongo.DESCENDING", "line_number": 21, "usage_type": "attribute" }, { "api_name": "utils.datetime_to_string", "line_number": 31, "usage_type": "call" }, { "api_n...
38064900627
import json from enum import Enum from typing import List, Optional from pydantic import BaseModel, Field, validator # pylint: disable=no-name-in-module class ContentSignature(BaseModel): """ Defines the data used to generate the signature, as well as the signer's identifier. """ event_content_hash:...
franciscomirasg/TFG-Blockchaindatabase-Exploration-Release
src/interfaces/event.py
event.py
py
6,057
python
en
code
0
github-code
7
[ { "api_name": "pydantic.BaseModel", "line_number": 8, "usage_type": "name" }, { "api_name": "pydantic.Field", "line_number": 12, "usage_type": "call" }, { "api_name": "pydantic.Field", "line_number": 14, "usage_type": "call" }, { "api_name": "pydantic.Field", ...
11538487825
from typing import List from raspberry_home.view.view import * class ZStack(View): def __init__(self, children: List[View]): self.children = children def content_size(self, container_size: Size) -> Size: width, height = 0, 0 for child in self.children: content_size = chi...
merskip/raspberry-home
raspberry_home/view/zstack.py
zstack.py
py
609
python
en
code
1
github-code
7
[ { "api_name": "typing.List", "line_number": 8, "usage_type": "name" } ]
72349974943
from django.conf import settings from django.core.mail import EmailMultiAlternatives, send_mail from django.template import loader, RequestContext, TemplateDoesNotExist email_templates = [ 'order_confirmation', 'payment_confirmation' ] def templates(): """Loads all the required templates""" base = {} ...
Zadigo/django_api
ecommerce_emails/base.py
base.py
py
715
python
en
code
0
github-code
7
[ { "api_name": "django.template.loader.render_to_string", "line_number": 14, "usage_type": "call" }, { "api_name": "django.template.loader", "line_number": 14, "usage_type": "name" }, { "api_name": "django.template.loader.render_to_string", "line_number": 23, "usage_type":...
5363958612
import logging import functools import torch import torch.nn.functional as F from torch.nn.modules.loss import _Loss import network.utils as utils import network.models as models logger = logging.getLogger() def get_loss_act(activation): if activation == 'tanh': act = utils.nn_tanh_phi_fn_dir ...
frellan/neural-synthesizer
network/models/srs_loss.py
srs_loss.py
py
11,227
python
en
code
0
github-code
7
[ { "api_name": "logging.getLogger", "line_number": 12, "usage_type": "call" }, { "api_name": "network.utils.nn_tanh_phi_fn_dir", "line_number": 17, "usage_type": "attribute" }, { "api_name": "network.utils", "line_number": 17, "usage_type": "name" }, { "api_name": ...
24949227218
import boto3 from datetime import datetime def create_record(): client = boto3.client('dynamodb') try: client.put_item( TableName='customerRecords', Item={ 'customerId': {'S': 'cust-71004'}, 'recordCreateDate': {'S': f'{datetime.now().strftime("%...
Dev-StanKin/AWSDeveloperProject
dynamo_fund/create_spec.py
create_spec.py
py
608
python
en
code
0
github-code
7
[ { "api_name": "boto3.client", "line_number": 6, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 12, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 12, "usage_type": "name" } ]
33807779198
# -*- coding: utf-8 -*- #### # 01/2011 Bernd Schlapsi <brot@gmx.info> # # This script is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. #...
gpodder/gpodder
share/gpodder/extensions/tagging.py
tagging.py
py
9,941
python
en
code
1,186
github-code
7
[ { "api_name": "logging.getLogger", "line_number": 41, "usage_type": "call" }, { "api_name": "mutagen.mp4.MP4Tags._padding", "line_number": 46, "usage_type": "attribute" }, { "api_name": "mutagen.mp4.MP4Tags", "line_number": 46, "usage_type": "name" }, { "api_name"...
14625305813
"""empty message Revision ID: 1217bc0ef9b2 Revises: 599b0de4dc98 Create Date: 2020-01-26 15:56:14.294785 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '1217bc0ef9b2' down_revision = '599b0de4dc98' branch_labels = None depends_on = None def upgrade(): # ...
nkatwesigye/Music-Venue-Booking-Site-Furry
starter_code/migrations/versions/1217bc0ef9b2_.py
1217bc0ef9b2_.py
py
667
python
en
code
0
github-code
7
[ { "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.String"...
8330751596
# Import the necessary libraries from gripable.udpclient.flex.FlexUdp import FlexUdp from gripable.udpclient.flex.FlexUdp2 import FlexUdp2 from gripable.udpclient.flex.protobuf.SensorData_pb2 import SensorData import time import RPi.GPIO as gpio import statistics # Start connections with the GripAble devices flex_righ...
carlosgd96/TFM_Carlos_Gil_Delgado
car_MOVit_movement.py
car_MOVit_movement.py
py
9,292
python
en
code
0
github-code
7
[ { "api_name": "gripable.udpclient.flex.FlexUdp.FlexUdp", "line_number": 10, "usage_type": "call" }, { "api_name": "gripable.udpclient.flex.FlexUdp2.FlexUdp2", "line_number": 11, "usage_type": "call" }, { "api_name": "RPi.GPIO.setmode", "line_number": 22, "usage_type": "ca...
27477154774
# # Sample for PyArrow on PyPy # This should work for ideally pypy:3.6-7.3.2-slim-buster as well as 3.9-7.3.9-slim-bullseye. But if need be, we can sacrify 3.6 in favor of 3.9 # import datetime import pyarrow.parquet as pq import pyarrow as pa arrow_schema = pa.schema( [ pa.field('id', pa.string()), pa.field('da...
bivald/pyarrow-on-pypy3
pyarrow-on-pypy.py
pyarrow-on-pypy.py
py
1,584
python
en
code
0
github-code
7
[ { "api_name": "pyarrow.schema", "line_number": 10, "usage_type": "call" }, { "api_name": "pyarrow.field", "line_number": 12, "usage_type": "call" }, { "api_name": "pyarrow.string", "line_number": 12, "usage_type": "call" }, { "api_name": "pyarrow.field", "line...
20497597325
from flask import Flask,flash, request, jsonify, render_template,redirect,send_from_directory,session, url_for import flask import os from werkzeug.utils import secure_filename import tensorflow as tf from tensorflow.keras.applications.inception_v3 import InceptionV3 import tensorflow.keras.applications.inception_v3 fr...
AhmedaliElgabry/Image_captioning
app.py
app.py
py
4,010
python
en
code
3
github-code
7
[ { "api_name": "os.environ", "line_number": 20, "usage_type": "attribute" }, { "api_name": "tensorflow.keras.models.load_model", "line_number": 23, "usage_type": "call" }, { "api_name": "tensorflow.keras", "line_number": 23, "usage_type": "attribute" }, { "api_name...
39516763660
from django.contrib import messages from django.contrib.auth import logout, authenticate, login from django.http import HttpResponseRedirect from django.shortcuts import render # Create your views here. from car.models import Car, Category, Images from home.models import Setting, ContactFormu, ContactFormMessage, User...
tugceozdemirci/Django-Arac-Kiralama
home/views.py
views.py
py
5,318
python
en
code
0
github-code
7
[ { "api_name": "home.models.Setting.objects.get", "line_number": 13, "usage_type": "call" }, { "api_name": "home.models.Setting.objects", "line_number": 13, "usage_type": "attribute" }, { "api_name": "home.models.Setting", "line_number": 13, "usage_type": "name" }, { ...
42926139508
import pandas as pd import datetime as dt import os import numpy as np import nltk from nltk.corpus import stopwords from nltk.sentiment.vader import SentimentIntensityAnalyzer import tidytext import matplotlib.pyplot as plt import seaborn as sns import praw import time # read in the scraped posts posts_df = pd.read_c...
vyycy/Reddit-NLP-Sentiment-Project
RedditWSB_NLP_Sentiment_Analysis/sentiment_scoring.py
sentiment_scoring.py
py
4,676
python
en
code
0
github-code
7
[ { "api_name": "pandas.read_csv", "line_number": 15, "usage_type": "call" }, { "api_name": "tidytext.unnest_tokens", "line_number": 25, "usage_type": "call" }, { "api_name": "nltk.corpus.stopwords.words", "line_number": 29, "usage_type": "call" }, { "api_name": "nl...
20761548350
#Boundary of objects #contours !=edges" import cv2 as cv import numpy as np img = cv.imread('../photos/big-bang.jpg') cv.imshow('Bang',img) blank=np.zeros(img.shape, dtype='uint8') cv.imshow('Blank',blank) gray = cv.cvtColor(img,cv.COLOR_BGR2GRAY) cv.imshow('Gray',gray) ret,thresh = cv.threshold(gray,125,255,cv.T...
GraniteMask/OpenCv-basic2advanced-tools
contourDraw.py
contourDraw.py
py
799
python
en
code
1
github-code
7
[ { "api_name": "cv2.imread", "line_number": 6, "usage_type": "call" }, { "api_name": "cv2.imshow", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 9, "usage_type": "call" }, { "api_name": "cv2.imshow", "line_number": 10, ...
74386741663
__all__ = [ "signal_minmax", "signal_normalize", "signal_quantize_midtread", "SignalProcessor", "SignalProcessorState", ] import dataclasses import warnings from typing import Any, Iterable, Optional, Union, TYPE_CHECKING import torch if TYPE_CHECKING: from datasets.series_dataset import Seri...
cheind/autoregressive
autoregressive/signal.py
signal.py
py
4,477
python
en
code
61
github-code
7
[ { "api_name": "typing.TYPE_CHECKING", "line_number": 15, "usage_type": "name" }, { "api_name": "typing.Union", "line_number": 20, "usage_type": "name" }, { "api_name": "torch.Tensor", "line_number": 20, "usage_type": "attribute" }, { "api_name": "typing.Iterable",...
30987324962
import random import matplotlib.pyplot as plt from src import NodeData from src.DiGraph import DiGraph class Show_graph: WIDTH, HEIGHT = 800, 600 def __init__(self, graph: DiGraph): self.pr_graph = graph def have_pos(self): """ Checks if there is a vertex that does not have a pos...
amit9676/OOPTask3
src/Show_graph.py
Show_graph.py
py
1,453
python
en
code
0
github-code
7
[ { "api_name": "src.DiGraph.DiGraph", "line_number": 10, "usage_type": "name" }, { "api_name": "src.NodeData", "line_number": 22, "usage_type": "name" }, { "api_name": "random.randint", "line_number": 26, "usage_type": "call" }, { "api_name": "random.randint", ...
19462974970
#!/usr/bin/env python """ Create an image for each note. USAGE ./create_images.py NOTES_CSV_FILE FILEPATH FONT NOTES_CSV_FILE: the list of notes to create FILEPATH: where to store the images FONT: location of the font file """ from PIL import Image,ImageDraw,ImageFont import sys,csv,os if len(sys.argv) < 4: prin...
jasonsbrooks/ARTIST
util/create_images.py
create_images.py
py
905
python
en
code
0
github-code
7
[ { "api_name": "sys.argv", "line_number": 14, "usage_type": "attribute" }, { "api_name": "sys.exit", "line_number": 16, "usage_type": "call" }, { "api_name": "PIL.ImageFont.truetype", "line_number": 22, "usage_type": "call" }, { "api_name": "PIL.ImageFont", "li...
34171424159
import plotly.graph_objects as go import math def addToDict(dictionary, d, universeSize, bfSize): dDict = { 'd': d, 'universeSizeList': universeSize, 'bfSize': bfSize } dictionary[d] = dDict def createDictionary(type): dictionary = {} with open(f'{type}_res.txt') as fp: ...
noambenmoshe/simpleBloom
src/ols_script/plot_uni_vector.py
plot_uni_vector.py
py
2,241
python
en
code
0
github-code
7
[ { "api_name": "plotly.graph_objects.Figure", "line_number": 40, "usage_type": "call" }, { "api_name": "plotly.graph_objects", "line_number": 40, "usage_type": "name" }, { "api_name": "plotly.graph_objects.Scatter", "line_number": 42, "usage_type": "call" }, { "api...
37954855508
#!/usr/bin/env python3 from random import randint import torch from torchvision import datasets, transforms import pickle #import json import numpy as np import os.path import matplotlib.pyplot as plt import matplotlib matplotlib.use('GTK3Cairo') NUM_IMAGES = 10000 STITCH_SIZE = 4 DATA_PATH = os.path.join(os.path.dir...
jmnel/neuralsort
junk/src/mnist_nsort/database_builder.py
database_builder.py
py
3,521
python
en
code
2
github-code
7
[ { "api_name": "matplotlib.use", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path.path.join", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path.path", "line_number": 16, "usage_type": "attribute" }, { "api_name": "os.path", "lin...
11865852703
#useful when the scale of an object with keyframe needs to be changed #shawn - May 2018 import maya.cmds as cm animCurves = cm.keyframe(sl=True,name=True,q=True) for eachCurve in animCurves: keyIndex = cm.keyframe(eachCurve,sl=True,indexValue=True,q=True) for eachIndex in keyIndex: currV = cm.ke...
NMVHS/mayaScripts
ScaleKeyframeValues.py
ScaleKeyframeValues.py
py
503
python
en
code
3
github-code
7
[ { "api_name": "maya.cmds.keyframe", "line_number": 6, "usage_type": "call" }, { "api_name": "maya.cmds", "line_number": 6, "usage_type": "name" }, { "api_name": "maya.cmds.keyframe", "line_number": 10, "usage_type": "call" }, { "api_name": "maya.cmds", "line_n...
43905729993
""" This module contains a Transaction class which represents a single financial transaction. It also contains an enum class TransactionType which has two members, EXPENCE and INCOME, representing the type of transaction. This class raises the following exceptions: - InvalidTypeException: If an invalid transactio...
RaziyeNikookolah/m93-practices
hw11/transaction/models.py
models.py
py
4,657
python
en
code
1
github-code
7
[ { "api_name": "enum.Enum", "line_number": 24, "usage_type": "name" }, { "api_name": "datetime.datetime.now", "line_number": 69, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 69, "usage_type": "name" }, { "api_name": "datetime.datetime.t...
72226213662
""" This module contains API calls to FoodCity """ import asyncio import logging import time import re from pyppeteer.errors import ElementHandleError from pyppeteer import launch from pyppeteer_stealth import stealth from fcclipper import __fcclipper_user_data_dir__ from .libs.memoize import Memoized LOG = logging....
jadunn1/fcclipper
fcclipper/api.py
api.py
py
10,214
python
en
code
0
github-code
7
[ { "api_name": "logging.getLogger", "line_number": 14, "usage_type": "call" }, { "api_name": "fcclipper.__fcclipper_user_data_dir__", "line_number": 21, "usage_type": "name" }, { "api_name": "pyppeteer.launch", "line_number": 41, "usage_type": "call" }, { "api_name...
24830894119
from app.model.employee import EmployeeModel from app.db.configuration import sa from flask.testing import FlaskClient from flask import Flask from typing import Any class TestEmployeeyResourceGet: def test_when_employee_exists(self, client: FlaskClient, app: Flask, employee_model_data: dict[str, Any]) -> None: ...
WojciechKubak/FLASK-BASE
tests/routes/employee/employee_resource/test_get.py
test_get.py
py
880
python
en
code
0
github-code
7
[ { "api_name": "flask.testing.FlaskClient", "line_number": 10, "usage_type": "name" }, { "api_name": "flask.Flask", "line_number": 10, "usage_type": "name" }, { "api_name": "typing.Any", "line_number": 10, "usage_type": "name" }, { "api_name": "app.model.employee.a...