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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
167633175 |
from pathlib import Path
#data_folder = Path("C:/Users/langzx/Desktop/github/EAmosm/data")
data_folder = Path('/Users/zhenlang/Desktop/github/EAmosm/data')
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import array
import random
import json
from math import sqrt
from deap import algorithms
fr... | ellelang/EAmosm | code/python/experiment/addseeds.py | addseeds.py | py | 2,695 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pathlib.Path",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.round",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_numb... |
2249079757 | from django.urls import path
from . import views
urlpatterns = [
path('', views.index, name='index'),
path('venues', views.venues, name='venues'),
path('calendar', views.calendar, name='calendar'),
path('essense', views.essense, name="essense"),
path('newsnnotes', views.newsnnotes, name="newsnnote... | winstonsummers/SquareCall | Stevie/urls.py | urls.py | py | 325 | python | en | code | 0 | github-code | 18 | [
{
"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",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
3623780144 | import requests
import json
import mycommons.mqtt_wrap as mqtt
import mycommons.data_structure as ds
credentials_file = '../credentials/ibm.json'
classes_json = '../models/nlu_classes.json'
ibm_service = 'nlu'
headers = {'Content-Type': 'application/json'}
def init(client:mqtt.MQTTClient):
with open(credentials_... | thomasreolon/UNITN-bachelor-thesis | project/src/components/classifiers/c_ibm_nlu.py | c_ibm_nlu.py | py | 2,148 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "mycommons.mqtt_wrap.MQTTClient",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "mycommons.mqtt_wrap",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "json.load",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "jso... |
34475346931 | # e_x_.py - число со степенью
from WmlEquation_Parser.utils.we import we, doc
from lxml import etree
e = we.run_('e') # основание
x = we.run_('x') # степень
e_x = we.e_x_(e, x)
equation = we.equation_(e_x)
xml_equation = etree.fromstring(equation)
p = doc.add_paragraph()
p._element.append(xml_equation)
doc.save(... | rymatoi/EqAnalizator | WmlEquation_Parser/e_x_.py | e_x_.py | py | 370 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "WmlEquation_Parser.utils.we.we.run_",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "WmlEquation_Parser.utils.we.we",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "WmlEquation_Parser.utils.we.we.run_",
"line_number": 7,
"usage_type": "c... |
15317064788 | from collections import deque
di = [0,0,1,-1]
dj = [1,-1,0,0]
n, m = map(int,input().split())
a = [list(input()) for _ in range(n)]
d = [[[[-1]*4 for _ in range(4)]for _ in range(m)] for _ in range(n)]
q = deque()
x1,y1,x2,y2 = -1,-1,-1,-1
ans = -1
for i in range(n):
for j in range(m):
if a[i][j] == 'S... | cldud400/python-coding-test | 문제풀이/1175.py | 1175.py | py | 1,088 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "collections.deque",
"line_number": 10,
"usage_type": "call"
}
] |
13608608052 | import numpy as np
from tqdm import tqdm
import matplotlib.pyplot as plt
import h5py
import os
from scipy import fft
from scipy import signal
import statistics
import scipy.stats as stats
class acq:
def __init__(self, no_samples, chunk):
self.chunk = chunk
self.no_samples = no_samples
self.... | kab-ph/acq_traces | acq_traces.py | acq_traces.py | py | 5,310 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "os.listdir",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.mkdir",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 31,
... |
40605593307 | import os
from .file_family import FileFamilyManager
from .mdlfile import MDLparser
from pathlib import Path
class FormatAssets():
def __init__(self, asset_paths, tf_path):
r'''pass in an array of relative path objects and the /tf/ folder absolute path
'''
self.__TF_PATH = tf_p... | r00142/NEA | file_handlers/format_assets.py | format_assets.py | py | 7,411 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pathlib.Path",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "file_family.FileFamilyManager"... |
32684463369 | import django
import os
# Configuring Django Settings
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "backend.settings")
django.setup()
import requests
import json
from restaurants.models import Category, Restaurant
import pandas as pd
from restaurants.utils import add_restaurants_to_db, add_categories_to_db
URL = ... | Niangmodou/MunchMap-Backend | get_restaurants.py | get_restaurants.py | py | 2,668 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "os.environ.setdefault",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "django.setup",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "requests.get",
"l... |
7742377106 | import torch
import torch.nn.functional as F
from collections import OrderedDict
import json
import os
import numpy as np
def padding(cp, cs, den, nz_orig, nx_orig, nz, nx, nPml, nPad):
tran_cp = cp.view(1, 1, nz_orig, nx_orig)
tran_cs = cs.view(1, 1, nz_orig, nx_orig)
tran_den = den.view(1, 1, nz_orig, nx... | lidongzh/TorchFWI | Ops/FWI/fwi_utils.py | fwi_utils.py | py | 3,826 | python | en | code | 46 | github-code | 18 | [
{
"api_name": "torch.nn.functional.interpolate",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "torch.nn.functional",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "torch.nn.functional.interpolate",
"line_number": 13,
"usage_type": "call"
},
{
... |
4961474010 | from django.shortcuts import render
from msg.models import get_msg as db_get_msg
from msg.models import clear as db_clear
from django.http import HttpResponse
import json as simplejson
import logging
from django.shortcuts import redirect
# Create your views here.
# ajax get msg
def get_msg(request):
is_login = requ... | Christings/dazhu | msg/views.py | views.py | py | 1,124 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "msg.models.get_msg",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "logging.debug",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "msg.models",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "msg.models.__dict__",
... |
13543636553 | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$', views.principal, name='principal'),
url(r'^home/$', views.home, name='home'),
url(r'^logout/$', views.logout_user, name='logout'),
url(r'^version/$', views.version, name='version'),
url(r'^mp/$', views.mp, name='mp'),
... | nanomolina/JP | src/odontology/core/urls.py | urls.py | py | 499 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "django.conf.urls.url",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.co... |
73343675881 | from flask import Flask, request, jsonify
import mlflow.pyfunc
import numpy as np
# model details
logged_model = "s3://t-airticket-bucket-v1/artifacts/1/d5fa30d062ae46b3bbead72bd526ec5b/artifacts/KNNEconomy_Exp"
loaded_model = mlflow.pyfunc.load_model(logged_model)
app = Flask(__name__)
# create a URL for the web AP... | Shibli-Nomani/MLOps-Project-AirTicketPricePrediction | app/main.py | main.py | py | 1,464 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "mlflow.pyfunc.pyfunc.load_model",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "mlflow.pyfunc.pyfunc",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "mlflow.pyfunc",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "... |
12743872756 | from typing import *
import torch
from torch import nn
import torchvision
from dl_imaging_kit.models import blocks
class BaseEncoder(nn.Module):
def __init__(self,
conv_blocks: List[blocks.ConvBlock],
stem: Optional[blocks.ConvBlock] = None,
add_pool_to_blocks... | edvinforsgren/ProjSweep | tools/dl_imaging_kit/models/encoder.py | encoder.py | py | 3,993 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "torch.nn.Module",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "dl_imaging_kit.models.blocks.ConvBlock",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_nam... |
12736865301 | import torch
import torch.nn as nn
class RNN(nn.Module):
def __init__(self, input_size, hidden_size, output_size):
super().__init__()
self.W_xh = nn.Parameter(torch.zeros(input_size, hidden_size))
self.W_hh = nn.Parameter(torch.zeros(hidden_size, hidden_size))
self.W_hy = nn.Parame... | GabrielMajeri/char-rnn-pytorch | rnn.py | rnn.py | py | 675 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "torch.nn.Module",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "torch.nn.Parameter",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_nu... |
16037672671 | #!/usr/bin/env python3
# coding: utf-8
"""
一些实用的小功能
"""
import os
from collections import Counter
from datetime import datetime, timedelta
from .core import Deck, Decks, MODE_STANDARD
def diff_decks(*decks):
"""
卡组对比
:param decks: 两个或以上的卡组
:return: 返回每个卡组特有的部分
"""
intersection = decks[0].c... | NemoFree/hsdata | hsdata/utils.py | utils.py | py | 1,838 | python | en | code | null | github-code | 18 | [
{
"api_name": "core.MODE_STANDARD",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "core.Decks",
"line_number": 42,
"usage_type": "argument"
},
{
"api_name": "collections.Counter",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "core.Deck",
... |
3102635587 | '''
========================
Reaction Diffusion Field
========================
'''
import copy
import os
import numpy as np
from pint import Quantity
from scipy import constants
from scipy.ndimage import convolve
from vivarium.core.process import Process, assoc_path
from vivarium.core.composition import PROCESS_OUT_DI... | CovertLab/vivarium-ecoli | ecoli/processes/environment/reaction_diffusion_field.py | reaction_diffusion_field.py | py | 15,077 | python | en | code | 9 | github-code | 18 | [
{
"api_name": "numpy.array",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "scipy.constants.N_A",
"line_number": 35,
"usage_type": "attribute"
},
{
"api_name": "scipy.constants",
"line_number": 35,
"usage_type": "name"
},
{
"api_name": "vivarium.core.pr... |
5244456719 | import itertools, os
from django import template
from django.conf import settings
from channelguide import util
def quoted_attribute(attr):
try:
return attr[0] == attr[-1] == '"'
except IndexError:
return False
def unquote_attribute(attr):
return attr[1:-1]
def make_text_or_variable_node... | kmshi/miroguide | channelguide/guide/templatetags/cg_helpers.py | cg_helpers.py | py | 11,040 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "django.template.TextNode",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "django.template",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "django.template.VariableNode",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": ... |
4701262241 | import os
import re
import cv2
import pytesseract
from pytesseract import Output
def main(inputFile):
outputFile = inputFile.split('.')[0]+'-rect.'+'.'.join(inputFile.split('.')[1:])
print(outputFile)
img = cv2.imread(inputFile)
d = pytesseract.image_to_data(img, output_type=Output.DICT)
n_boxes... | SanVik2000/Text_Localisation | Text_Localisation-PyTesseract.py | Text_Localisation-PyTesseract.py | py | 715 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "cv2.imread",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pytesseract.image_to_data",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pytesseract.Output.DICT",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "pyt... |
38234013987 | import time
import pyaudio
import RPi.GPIO as GPIO
import wave
import speech_recognition as sr
from ctypes import *
from contextlib import contextmanager
from picamera import PiCamera
import requests
import uuid
import os
import json
from PIL import Image
GPIO.setmode(GPIO.BCM)
GPIO.setup(18, GPIO.IN, pull_up_down=GPI... | sheriff4000/SCARGlass | Screen/SpeechFunctions.py | SpeechFunctions.py | py | 4,799 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "RPi.GPIO.setmode",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "RPi.GPIO",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "RPi.GPIO.BCM",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "RPi.GPIO.setup",
"lin... |
71303083880 | #!/usr/bin/env python
# coding: utf-8
# # Homework #3
# For this assignment, you will learn about two new libraries, pyttsx3 and speech_recognition, and use voice recognition to obtain weather info <br />
#
# **pyttsx3** - https://pypi.org/project/pyttsx3/ <br />
# **speech_recognition** - https://pypi.org/project/S... | Ckozak003/Advanced-Programming-2023 | HW #3.py | HW #3.py | py | 12,648 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pyttsx3.init",
"line_number": 65,
"usage_type": "call"
},
{
"api_name": "speech_recognition.Microphone.list_microphone_names",
"line_number": 86,
"usage_type": "call"
},
{
"api_name": "speech_recognition.Microphone",
"line_number": 86,
"usage_type": "attrib... |
70877169959 | import json
import socketserver
import threading
import datetime
from app.models import Machine, User
def set_sys_details(sys_details, m):
sys_details.pop("mac")
sys_details.pop("type")
m.sys_details = sys_details
return True
def check_sys_details(sys_details_input, m):
for key in... | Fragamir/OCR-GCE-A-COMPUTER-SCIENCE-PROJECT-H446-03 | app/sockets.py | sockets.py | py | 4,318 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "datetime.datetime.now",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 35,
"usage_type": "attribute"
},
{
"api_name": "datetime.timedelta",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "socke... |
70817698281 | # -*- coding= utf-8 -*-
import os,struct
from datetime import datetime
listdir=[x for x in os.listdir('.') if os.path.isfile(x) and (os.path.splitext(x)[1]=='.BMP' or os.path.splitext(x)[1]=='.bmp')]#目录下后缀为‘.BMP’和‘.bmp’的文件列表
# print(listdir)
os.remove('bmpinfo.txt')#因为open(file,'a')是在文末追加写,所以为避免每次运行重复写入,先删除之前的版本。
if l... | cyber7nights/Python-learningtest | commonlib/bmpinfo.py | bmpinfo.py | py | 1,201 | python | zh | code | 0 | github-code | 18 | [
{
"api_name": "os.listdir",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.path.isfile",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "os.path.splitext",
"line_numb... |
27843577026 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2019/12/20 10:09
# @Author : Wancheng.b
# @File : models.py
# @Software: PyCharm
import time
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
import config
# 定义app对象,配置模板和静态文件的加载路径(在蓝图里面配置不起作用)
app = Flask(__name__, template_folder='../../templates... | bianwancheng/PlatUI | apps/models/models.py | models.py | py | 2,361 | python | zh | code | 0 | github-code | 18 | [
{
"api_name": "flask.Flask",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "flask_sqlalchemy.SQLAlchemy",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "time.strftime",
... |
37299561794 | from collections import Counter
class Solution:
def findOriginalArray(self, changed: List[int]) -> List[int]:
n = len(changed)
ctr = Counter(changed)
res = []
changed.sort()
for el in changed:
if el != 0 and ctr[el] > 0 and ctr[2 * el] > 0:
res.ap... | theabbie/leetcode | find-original-array-from-doubled-array.py | find-original-array-from-doubled-array.py | py | 501 | python | en | code | 11 | github-code | 18 | [
{
"api_name": "collections.Counter",
"line_number": 6,
"usage_type": "call"
}
] |
37089214626 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('catalog', '0002_product_product_price'),
]
operations = [
migrations.CreateModel(
name='Agent',
fiel... | gabkdejesus/CS122Del3Old | del3/catalog/migrations/0003_auto_20170427_1418.py | 0003_auto_20170427_1418.py | py | 915 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.CreateModel",
"line_number": 14,
"usage_type": "call"
},
... |
32541107887 | #!/usr/bin/env python3
import os
from pathlib import Path
import acts
import acts.examples
u = acts.UnitConstants
def runTruthTracking(
trackingGeometry,
field,
outputDir: Path,
digiConfigFile: Path,
directNavigation=False,
reverseFilteringMomThreshold=0 * u.GeV,
s: acts.examples.Sequenc... | adasco2022/act | Examples/Scripts/Python/truth_tracking.py | truth_tracking.py | py | 7,477 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "acts.UnitConstants",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "pathlib.Path",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "pathlib.Path",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "acts.examples",
... |
18451770301 | from torch.utils.data import DataLoader
from datasets.coco_dataset import COCO_Dataset
import datasets.transforms_ as T
from torch.utils.data.distributed import DistributedSampler
def build_dataloader(opts):
transform_test = T.Compose([
T.Resize([800, 800]),
T.ToTensor(),
])
test_set = C... | csm-kr/torchvision_fasterrcnn_tutorial | datasets/build_test.py | build_test.py | py | 1,509 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "datasets.transforms_.Compose",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "datasets.transforms_",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "datasets.transforms_.Resize",
"line_number": 10,
"usage_type": "call"
},
{
"api_n... |
36790941973 | from django.shortcuts import render , redirect
from .models import Room,Message
from django.http.response import HttpResponse
import secrets
import json
import pusher
pusher_client = pusher.Pusher(
app_id='908807',
key='b103533a85ecae4e3e14',
secret='##############', ### NEVER UPLOAD TO GIT
cluster='ap3',
ssl... | wwe221/TIL | python&Django/day18/chatproject/boards/views.py | views.py | py | 3,194 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "pusher.Pusher",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "secrets.token_urlsafe",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "models.Room",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line... |
75191624681 | '''
This procedure reads and calculates J-K colors for all objects Paper XII, and then plot them as a function of spectral type. It also calculates the average for each spectral type and plots those too. It can also plot excluded peculiar objects (blue, dusty, pec) (the code for this is commented out inside makeplot()... | BDNYC/Miscellaneous- | jk_plot_kc.py | jk_plot_kc.py | py | 9,137 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "matplotlib.pyplot.close",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.rc",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "matplo... |
7057731826 | from tf_optimizer.network.client import Client
from tf_optimizer.benchmarker.model_info import ModelInfo
from tf_optimizer_core.benchmarker_core import BenchmarkerCore
from tf_optimizer.dataset_manager import DatasetManager
from . import utils as utils
from tf_optimizer.benchmarker.result import Result
from enum import... | kernel-machine/tf_optimizer | tf_optimizer/benchmarker/benchmarker.py | benchmarker.py | py | 7,853 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "enum.Enum",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "enum.auto",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "enum.auto",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "enum.Enum",
"line_number": 22,
... |
42864795360 | from channels.routing import ProtocolTypeRouter
from django.core.asgi import get_asgi_application
# Initialize Django ASGI application early to ensure the AppRegistry
# is populated before importing code that may import ORM models.
django_asgi_app = get_asgi_application()
application = ProtocolTypeRouter(
{
... | octue/exa | server/asgi.py | asgi.py | py | 358 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "django.core.asgi.get_asgi_application",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "channels.routing.ProtocolTypeRouter",
"line_number": 10,
"usage_type": "call"
}
] |
5988833352 | #!/usr/bin/env python 3.7.2
# -*- coding: utf-8 -*-
import argparse
from termcolor import colored
import sys
try:
import scapy.all as scapy
except KeyboardInterrupt:
print(colored("\n[-] CTRL+C basıldı... Lütfen bekleyiniz...", "red"))
print(colored("[-] Uygulamadan çıkış yapıldı!", "red"))
sys.exit()
import scapy... | mustafadalga/ARP-poisoning-packet-sniffer | packet_sniffer.py | packet_sniffer.py | py | 3,605 | python | tr | code | 7 | github-code | 18 | [
{
"api_name": "termcolor.colored",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "termcolor.colored",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser"... |
23818804331 | import os
import numpy as np
import MDAnalysis as mda
import shutil
from common import read_adresses, read_trajtxt, read_homos
from op_from_hmo import finder
inp = '../proc/adress.txt'
data = read_adresses(inp)
store = '../proc/trajs/'
for idx, (key, item) in enumerate(data.items()):
# if item[:3] in ('000', '001... | dz24/ruthenium | merger.py | merger.py | py | 3,616 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "common.read_adresses",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "os.path.isdir",
"... |
33534452352 | from functools import cache
@cache
def _get_input(input_file):
with open(input_file, "r") as f:
output = [tuple(line.split()) for line in f.read().split("\n") if line != ""]
return output
scores = {
"A": 1,
"B": 2,
"C": 3,
}
to_defeat = {
"A": "B",
"B": "C",
"C... | jyates13/aoc2022 | 02/solve.py | solve.py | py | 1,274 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "functools.cache",
"line_number": 3,
"usage_type": "name"
},
{
"api_name": "functools.cache",
"line_number": 34,
"usage_type": "name"
},
{
"api_name": "functools.cache",
"line_number": 47,
"usage_type": "name"
}
] |
14787793762 | import cv2
import matplotlib.pyplot as plt
import numpy as np
import skimage.transform
import skimage.filters
import torch
# for generating ground truth heatmaps
def gen_hmaps(img, pts, sigma_valu=2):
'''
Generate 17 heatmaps
:param img: np arrray img, (H,W,C)
:param pts: joint points coords, np array... | MattyChoi/OpenMonkeyChallenge | utils/preprocess.py | preprocess.py | py | 3,089 | python | en | code | 4 | github-code | 18 | [
{
"api_name": "numpy.zeros",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "skimage.transform.filters.gaussian",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "skimage.transform.filters",
"line_number": 31,
"usage_type": "attribute"
},
{
"api... |
36503308338 | import os
import webbrowser
import folium
carte = folium.Map([46.59, 2.48],
zoom_start=10,
control_scale=True)
l_icones = [([46.4, 2.3], "fontawesome 4.7", "green", "mixcloud", 'fa'),
([46.4, 2.4], "fontawesome 4.7", "green", "space-shuttle", 'fa'),
([46.4,... | D-BookeR/Python-sans-detour | chapitre_geo/folium_ex6.py | folium_ex6.py | py | 1,121 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "folium.Map",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "folium.Marker",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "folium.Icon",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path.splitdrive",
"line_nu... |
74110660199 | from torch import nn
class Net(nn.Module):
def __init__(self, input_dim, hidden_dim, n_layers):
super().__init__()
self.input_dim = input_dim
self.hidden_dim = hidden_dim
self.n_layers = n_layers
self.input_layer = nn.Sequential(
nn.BatchNorm1d(input_dim),
nn.Linea... | irohasukensirou/Real-Street-Fighter | net.py | net.py | py | 824 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "torch.nn.Module",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 3,
"usage_type": "name"
},
{
"api_name": "torch.nn.Sequential",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_... |
12831857181 | """The DePaul Club Bot."""
import json
import os
import typing as t
from telethon.sync import TelegramClient
from telethon.sync import events
__author__ = "Akshay Mestry (XAMES3) <xa@mes3.dev>"
__version__ = "1.0.1"
# Server credentials
API_ID: t.Final[str] = os.environ["API_ID"]
API_HASH: t.Final[str] = os.environ... | xames3/the_depaul_club_bot | serve.py | serve.py | py | 1,625 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "typing.Final",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "typing.Final",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
... |
2552872314 | from django.db import IntegrityError
from rest_framework.response import Response
from django.http import HttpResponse
from rest_framework.views import APIView
from django.http import QueryDict
from django.contrib.auth.models import User
from drf_yasg.utils import swagger_auto_schema
from drf_yasg import openapi
from .... | CMPUT404-W23/project | socialDist/views.py | views.py | py | 61,601 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "rest_framework.views.APIView",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "models.Author.objects.get",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "models.Author.objects",
"line_number": 29,
"usage_type": "attribute"
},
{
... |
2366839986 | #!/usr/bin/env python
from builtins import range
import argparse
#extract mtDNA annotation from gtf file
parser = argparse.ArgumentParser(usage = "\n" +"python %(prog)s <input_file> <output_file> \n" +"\n" + "Usage examples\
:\npython mt_annotation.py mouse.gtf mouse_mt.gtf n\n"+ "\n" + "Description:\nExtracts mtDNa a... | asan-nasa/mtR_find | add-on/mt_annotation.py | mt_annotation.py | py | 1,556 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "builtins.range",
"line_number": 30,
"usage_type": "call"
}
] |
15943412461 | import arcade
from vector import Vector2
from constants import *
from entity import Entity
class Player(Entity):
def __init__(self, node, fname: str="sprites\eyer.png", scale: float=SCALE/2):
super().__init__(node, fname, scale)
self.name = PLAYER
self.color = WHITE
self.velocity = ... | P4Jammies/Campus-Mania | player.py | player.py | py | 2,045 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "entity.Entity",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "vector.Vector2",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "arcade.key",
"line_number": 45,
"usage_type": "attribute"
},
{
"api_name": "vector.Vector2",
"lin... |
74875753640 | import torch, torch_xla
from transformers import AutoTokenizer, GPT2LMHeadModel, AutoConfig, TrainingArguments
from optimum.neuron import TrainiumTrainer
from transformers.data.data_collator import DataCollatorForLanguageModeling
from datasets import load_from_disk
import os
ds = load_from_disk("poems_dataset_64")
tok... | jhp612/DevConBostonMLWorkshop | scripts/02_train.py | 02_train.py | py | 1,296 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "datasets.load_from_disk",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "transformers.AutoTokenizer.from_pretrained",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "transformers.AutoTokenizer",
"line_number": 9,
"usage_type": "name"
},... |
14652874291 | import requests
from urllib.parse import urljoin
class bcolors:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
ENDC = '\033[0m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m'
base = 'https://malura.de'
redirect_count = 0
redirect_success_... | maluramichael/malura | redirect-test.py | redirect-test.py | py | 965 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "urllib.parse.urljoin",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 25,
"usage_type": "call"
}
] |
15325828809 | #!/usr/bin/env python
import asyncio
from pyexpat import features
from xxlimited import Null
import cv2
import os
import sys, getopt
import signal
import time
import json
from edge_impulse_linux.image import ImageImpulseRunner
import numpy as np
from azure.iot.device.aio import IoTHubModuleClient
runner = None
show_... | SaraOlsson/edgeimpulse-on-iotedge | modules/eicameradetect/main.py | main.py | py | 10,720 | python | en | code | 5 | github-code | 18 | [
{
"api_name": "time.time",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "cv2.VideoCapture",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "signal.signal",
"line_number"... |
27790680867 | import matplotlib.pyplot as plt
from pylab import mpl
import math
# Ajuste lineal unario
# Los datos de ajuste utilizados son xi = 1,2,3,4,5,6,7
# El valor correspondiente de la función correspondiente yi = 0.5,2.5,2,4,3.5,6,5.5
# Completar el cálculo de los parámetros de la curva de ajuste
def liner_fitting(data_x,... | TheIronhidex/energy-blackout-project | src/visual_functions.py | visual_functions.py | py | 5,101 | python | es | code | 0 | github-code | 18 | [
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 42,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.scatter",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "ma... |
19640637152 | from typing import List, Optional
import numpy as np
def find_pareto_frontier_points(all_points: np.ndarray,
is_decreasing: Optional[bool] = True) -> List[int]:
"""Takes in a list of n-dimensional points, one per row, returns the list of row indices
which are Pareto-fronti... | Dhruvi-Lodhavia/ECE226-Project | archai/nlp/nas/nas_utils/pareto_frontier.py | pareto_frontier.py | py | 1,605 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "numpy.ndarray",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "typing.Optional",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 7,
"usage_type": "name"
}
] |
22444200956 | import numpy as np
class PrimitiveObject(object):
def save_primitive_matrix(self,primitive_mtx):
self.primitive_mtx = primitive_mtx
self.discrete_primitive_mtx = primitive_mtx
self.num_primitives = np.shape(self.primitive_mtx)[1]
def save_primitive_names(self,names):
self.... | HazyResearch/ukb-cardiac-mri | ukb/weak_supervision/coral/tutorials/primitive_helpers.py | primitive_helpers.py | py | 3,679 | python | en | code | 22 | github-code | 18 | [
{
"api_name": "numpy.shape",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.shape",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 4... |
21129646304 | # -*- coding: utf-8 -*-
import os
import pickle
import numpy as np
import pandas as pd
import statsmodels.api as sm
industry = pd.read_pickle('C:/Users/wuwangchuxin/Desktop/yinhua_\
min/data/industry.pkl').drop_duplicates()
return_data = pd.read_pickle('G:short_period_mf/dailyreturn.pick\
le').rename(columns... | wuwangchuxinybf/learngit | standard.py | standard.py | py | 1,578 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pandas.read_pickle",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pandas.read_pickle",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "statsmodels.api.OLS",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "statsmodels.... |
3963704514 | # -*- coding: utf-8 -*-
"""
Plot chance pairs
Created on Fri Oct 11 14:46:23 2019
@author: Gebruiker
"""
import numpy as np
import cartopy.crs as ccrs
import cartopy.feature as cfeature
import matplotlib.pyplot as plt
import cartopy.mpl.ticker as cticker
import matplotlib.animation as anim
import seaborn as sns
impor... | reint-fischer/MAIOproject | plottraj.py | plottraj.py | py | 7,691 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "numpy.genfromtxt",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.genfromtxt",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.genfromtxt",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "numpy.genfromtxt",... |
23278579699 | # -*- coding: utf-8 -*-
import os
from json import dumps
from django import template
from django.conf import settings
from django.template.base import TemplateSyntaxError, kwarg_re, Node
from django.utils.encoding import smart_text
from django.utils.safestring import mark_safe
from django.utils.six import text_type
fr... | dwebdevcore/BoardDirector_dashboard | apps/common/templatetags/common_tags.py | common_tags.py | py | 7,962 | python | en | code | 8 | github-code | 18 | [
{
"api_name": "django.template.Library",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "django.template",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "documents.models.Document.objects.filter",
"line_number": 22,
"usage_type": "call"
},
{
"... |
70085945959 | # https://www.geeksforgeeks.org/find-co-ordinates-of-contours-using-opencv-python/
# https://www.pyimagesearch.com/2016/02/01/opencv-center-of-contour/
# https://www.nkp.hu/tankonyv/matematika_11/lecke_04_068
import numpy as np
import cv2
# Reading image
font = cv2.QT_FONT_NORMAL
img2 = cv2.imread('test.jpg'... | legokor/DenesKezdo | haromszog.py | haromszog.py | py | 2,373 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "cv2.QT_FONT_NORMAL",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "cv2.imread",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "cv2.IMREAD_COLOR",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "cv2.imread",
... |
21159720581 | from typing import List, Union, Tuple
from data_structure import ListNode, TreeNode
def singly_list(nodes: Union[List[int], List[list]] = []) -> Union[ListNode, None]:
nextNode = None
for e in nodes[::-1]:
nextNode = ListNode(e, next = nextNode)
return nextNode
def binary_tree(array: List) -> Unio... | ZhijiaCHEN/LeetCode | utility.py | utility.py | py | 1,637 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "typing.Union",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "data_structure.ListNode",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "data_structure.ListNode... |
17438681335 | import face_recognition
import cv2
import os
import pickle
with open('known_faces.pickle', 'rb') as f:
names, encodings = pickle.load(f)
UNKNOWN_DIR = 'data/unknown_faces/'
file_names = os.listdir(UNKNOWN_DIR)
for fn in file_names:
img = cv2.imread(UNKNOWN_DIR+fn)
rgb = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
lo... | MustafaLotfi/AISC-202303 | 21-2-10/recognize_unknown.py | recognize_unknown.py | py | 981 | python | en | code | 7 | github-code | 18 | [
{
"api_name": "pickle.load",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 16... |
27343667431 | from __future__ import absolute_import, division, print_function
from builtins import map
from builtins import str
from builtins import object
import os
import copy
import numpy
import re
import wx
import psychopy.experiment.utils
try:
from wx.lib.agw import flatnotebook
except ImportError: # was here wx<4.0:
... | soheilbr82/BluegrassWorkingMemory | Python_Engine/Lib/site-packages/psychopy/app/builder/dialogs/__init__.py | __init__.py | py | 85,530 | python | en | code | 5 | github-code | 18 | [
{
"api_name": "wx.Colour",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "wx.Colour",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "builtins.object",
"line_number": 35,
"usage_type": "name"
},
{
"api_name": "numpy.ndarray",
"line_number"... |
43437119765 | from tkinter import *
from tkinter import Tk, Label, Button
from tkinter import ttk
from tkinter import filedialog
import openpyxl
from tkinter import messagebox
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import random
import math
class Kmeans():
def dosyaSec(self):
try:
... | kursatkaragoz/DataMining-Clustering-KMeans-Application | Kmeans.py | Kmeans.py | py | 24,081 | python | tr | code | 0 | github-code | 18 | [
{
"api_name": "tkinter.filedialog.askopenfilename",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "tkinter.filedialog",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.xlabel",
"line_number": 28,
"usage_type": "call"
},
{
"ap... |
29281379258 | from selenium import webdriver
from selenium.webdriver.common.by import By
options = webdriver.FirefoxOptions()
options.add_argument('--headless')
import time
class jay:
driver = webdriver.Firefox()
def __init__(self,url):
self.url = url
def by_anchor_tag(self,anchor_tag_link):
... | prakash2196/prakash2196 | zen_class_workouts/fun18.py | fun18.py | py | 758 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "selenium.webdriver.FirefoxOptions",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 3,
"usage_type": "name"
},
{
"api_name": "selenium.webdriver.Firefox",
"line_number": 9,
"usage_type": "call"
},
{
"api_... |
3625157257 | from datetime import datetime
def getBasicInfo():
choice = input("""\t1. Add new income
2. Add new expense
3. Check current balance (income - expenses)
4. Check specific month's balance
5. Check specific month's income data
6. Check specific month's expenses data
7. Check total income by c... | OCiesla01/ExpensesTracker | programMethods.py | programMethods.py | py | 2,665 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "datetime.datetime.now",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 35,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.strptime",
"line_number": 92,
"usage_type": "call"
},
{
"api_name": "da... |
12801742556 | # IMPORTS #
import os
import requests
from bs4 import BeautifulSoup as bs
# SET VARIABLES #
url = "https://unsplash.com/search/photos/puppet"
page = requests.get(url)
soup = bs(page.text, 'html.parser')
image_tags = soup.find_all('img')
i = 0
# CREATE DIRECTORY TO STORE IMAGES #
if not os.path.exists('puppet'):
... | rossmdev/puppetbot | imagescraper.py | imagescraper.py | py | 759 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "requests.get",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_numbe... |
9134836944 | #!/usr/bin/env python3
import pygame as pg
import colors as col
import solar_vis as vis
import solar_model as physics
import solar_input as file_io
def main():
pg.init()
screen = pg.display.set_mode((vis.window_width, vis.window_height))
GUI_manager = vis.InterfaceManager(screen)
model = physics.Mod... | bkz7354/solar | solar_main.py | solar_main.py | py | 1,149 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pygame.init",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "solar_vis.win... |
28827501019 | from django.urls import path, include
# Импортируем созданное нами представление
from .views import PostList,PostDetail,PostCreate,PostUpdate,PostDelete,subscribe_me,PostCount, upgrade_me, notsubscribe_me, TTT
from django.views.decorators.cache import cache_page
urlpatterns = [
path('', cache_page(60)(PostList.as_... | mafusailovich/django_teach_project | NewsPaper/news/urls.py | urls.py | py | 1,243 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.views.decorators.cache.cache_page",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "views.PostList.as_view",
"line_number": 7,
"usage_type": "call"
},
{
"api... |
41957288725 | from typing import Optional, Tuple, List, Union
from ovos_bus_client.client import MessageBusClient
from ovos_plugin_common_play.ocp import OCP_ID
from ovos_plugin_common_play.ocp.status import *
from ovos_plugin_common_play.ocp.utils import ocp_plugins, find_mime
from ovos_utils.json_helper import merge_dict
from ovo... | OpenVoiceOS/ovos-ocp-audio-plugin | ovos_plugin_common_play/ocp/media.py | media.py | py | 22,072 | python | en | code | 4 | github-code | 18 | [
{
"api_name": "ovos_plugin_common_play.ocp.OCP_ID",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "os.path.join",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "os.pa... |
6597914086 | from typing import List
from collections import deque, defaultdict
n = 0
mmap = []
dx, dy = (1, 0, -1, 0), (0, 1, 0, -1)
db = defaultdict(list)
def encode(lst):
ret = 0
for l in lst:
ret *= 10
ret += l
return ret
def decode(num):
return list(map(int, list(str(num))))
def _gen_db(l... | ihansam/Certi-Pro | real_test/220610/solution.py | solution.py | py | 3,470 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "collections.defaultdict",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "collections.deque",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "typing.List",
"line_number": 44,
"usage_type": "name"
},
{
"api_name": "typing.List",
... |
32474724159 | """ Discord bot """
#! /usr/bin/env python3
import discord
from discord.ext import commands
from typing import Dict, List, Any
from compute.middle_layer import check_backend
from utils.env import TOKEN, CHANNEL, GUILD, CMD_PREFIX
CUSTOM_COGS = ["cogs.players_cmds", "cogs.elevated_cmds"]
NEED_REGISTER_FUNCS... | jpmondet/RagnaBot | csleadbot.py | csleadbot.py | py | 2,544 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "discord.ext.commands.Bot",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "discord.ext.commands",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "utils.env.CMD_PREFIX",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "ut... |
30619880298 | class Solution(object):
def mergeStones(self, stones, K):
"""
:type stones: List[int]
:type K: int
:rtype: int
"""
N = len(stones)
prefix = [0 for i in range(N + 1)]
for i in range(N):
prefix[i + 1] += (prefix[i] + stones[i])
inf =... | baldFemale/LeetCode-Solution | python/Dynamic Programming/Minimum Cost to Merge Stones/Minimum Cost to Merge Stones.py | Minimum Cost to Merge Stones.py | py | 806 | python | en | code | 15 | github-code | 18 | [
{
"api_name": "functools.lru_cache",
"line_number": 17,
"usage_type": "call"
}
] |
36956670350 | from collections import Counter
import pytest
from startupradar.transformers.basic import (
DomainNameTransformer,
CommonStringTransformer,
CounterTransformer,
)
from startupradar.transformers.util.exceptions import InvalidDomainError
DOMAINS_INVALID = [
"127.0.0.1",
"localhost",
"api.startup... | startupradar/transformers | tests/test_basic.py | test_basic.py | py | 1,860 | python | en | code | 6 | github-code | 18 | [
{
"api_name": "startupradar.transformers.basic.DomainNameTransformer",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "startupradar.transformers.basic.DomainNameTransformer",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "pytest.raises",
"line_number": 29... |
12216336854 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('project', '0016_auto_20141101_2222'),
]
operations = [
migrations.AddField(
model_name='project',
na... | calblueprint/revolv | revolv/project/migrations/0017_project_internal_rate_return.py | 0017_project_internal_rate_return.py | py | 584 | python | en | code | 29 | github-code | 18 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.AddField",
"line_number": 14,
"usage_type": "call"
},
{
... |
40820048256 | from datetime import datetime
from flask import Blueprint, render_template, request, g, redirect, url_for, flash
from blueprints.forms import QuestionForm, AnswerForm
from exts import db
from decorators import login_required, admin_login_required
from models import QuestionModel, AnswerModel, UserModel
# /auth
bp = B... | yangxir/flask-communication | AI+X/blueprints/admin/admin_question.py | admin_question.py | py | 2,864 | python | en | code | 3 | github-code | 18 | [
{
"api_name": "flask.Blueprint",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "flask.request.args.get",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "flask.request.args",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "flask.... |
73634646761 | import requests
import os
from dotenv import load_dotenv
load_dotenv()
def telegram_send_message(message):
send_text = (
"https://api.telegram.org/bot"
+ os.getenv("BOTTOKEN")
+ "/sendMessage?chat_id="
+ os.getenv("CHATID")
+ "&parse_mode=Markdown&text="
+ message
... | juanpsenn/simple-monitor | helpers.py | helpers.py | py | 394 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "dotenv.load_dotenv",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number... |
43188119820 | #!/usr/bin/env python3
import logging
import os
import sys
import netaddr
import requests
import yaml
logger = logging.getLogger("dhcp-hook")
if not logger.handlers:
formatter = logging.Formatter("[%(asctime)s] %(levelname)s in %(module)s: %(message)s")
# stdout logging
handler = logging.StreamHandler()
... | SUNET/cnaas-nms | src/cnaas_nms/tools/dhcp_hook.py | dhcp_hook.py | py | 6,005 | python | en | code | 66 | github-code | 18 | [
{
"api_name": "logging.getLogger",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "logging.Formatter",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "logging.StreamHandler",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "logging.DEB... |
71826926439 | # coding=utf-8
from gym import Env
from gym.spaces import Discrete, Box
import numpy as np
import random
from enum import Enum
import json
REWARD_COLLISION = -10
REWARD_EDGE_OR_STOP = 0
REWARD_TIMEOUT_EXTRA = -1
REWARD_NORMAL = 2
REWARD_DELIVERY_SUCCESS = 20
class DeliveryEnv(Env):
def __init__(self):
s... | madfrog/delivery_rl | delivery_env.py | delivery_env.py | py | 5,835 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "gym.Env",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "gym.spaces.Discrete",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "gym.spaces.Discrete",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "random.sample",
"... |
31348057913 | from pandas import read_csv
from pickle import dump
from glob import glob
from tqdm import tqdm
HEADERS = ["DATE", "NAME", "LATITUDE", "LONGITUDE", "MIN", "MAX", "PRCP", "PRCP_ATTRIBUTES", "SNDP", "FRSHTT"]
TYPES = {"NAME": str, "LATITUDE": float, "LONGITUDE": float, "MIN": float, "MAX": float, "PRCP": float, "PRCP_AT... | saviravi/frontyardigans | Recommendation/weather/flyio/weather/convert.py | convert.py | py | 759 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "glob.glob",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "tqdm.tqdm",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pickle.dump",
"line_number": ... |
4474511379 | import cv2
import numpy as np
webcam = cv2.VideoCapture(0)
webcam.set(3,640)
webcam.set(4,480)
webcam.set(10,100)
marea =400
count=0
face_cascade = cv2.CascadeClassifier('Resources/haarcascades/haarcascade_russian_plate_number.xml')
while True:
ret, frame = webcam.read()
imageGray=cv2.cvtColor(frame,... | 49paunilay/Python-Opencv-Projects | numberplate1.py | numberplate1.py | py | 1,133 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "cv2.CascadeClassifier",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2GRAY"... |
3286534671 | import webapp2
import cgi
import urllib,json
class MainPage(webapp2.RequestHandler):
def get(self):
self.response.write("""
<html>
<head>
<link type="text/css" rel="stylesheet" href="/stylesheets/main.css" />
</head>
<titl... | jaseemkp/twitter-app-in-python | twitter.py | twitter.py | py | 1,574 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "webapp2.RequestHandler",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "webapp2.RequestHandler",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "cgi.escape",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "url... |
15048422649 | import os
import io
import shutil
import hashlib
import mimetypes
from datetime import datetime
import pytz
from googleapiclient.http import MediaFileUpload
from . import log, auth, remote_fs
from .filesystem import *
from .errors import *
class LinuxFS(FileSystem):
""" A linux specific file handler.
Ca... | akhlakm/Python_GDrive_CLI | gdclient/local_fs.py | local_fs.py | py | 7,051 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "os.path.relpath",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "os.path.exists",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_numbe... |
24950164606 | import controller
import time
import datetime
start_time = time.time()
####define com ports for controller and baudrate (keep at 115200)
# port = '/dev/ttyACM0' # Linux
port = "COM5" # Windows
baud_rate = 115200
setup = controller.Setup(port, baud_rate)
setup.connect()
#################### Fluidics parameters ####... | jrlLAB/ElectroLab | src/electrolab/b_rescue.py | b_rescue.py | py | 3,239 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "time.time",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "controller.Setup",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "controller.Motor",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "controller.MainPower",
... |
7916780636 | import csv
import pandas as pd
import pathlib
import os.path
from validate import validate_date
# leeg sold.csv aanmaken
def create_soldcsv():
with open(
pathlib.Path(__file__).parent / "sold.csv", "w", newline=""
) as soldFile:
writer = csv.writer(soldFile)
writer.writerow(
... | AnnetteBotman/Winc_module5_assingment-Superpy | superpy/csvhelper_sell.py | csvhelper_sell.py | py | 8,223 | python | nl | code | 0 | github-code | 18 | [
{
"api_name": "pathlib.Path",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "csv.writer",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path.path.isfile",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "os.path.path",
"line_... |
10185343642 | __author__ = 'suixin'
import sys
import threading
import socketserver
import numpy as np
import cv2
from predict import predict2
from carCtrHelper import RCTest
# distance data measured by ultrasonic sensor
sensor_data = None
class SensorDataHandler(socketserver.BaseRequestHandler):
data = " "
def handle... | suixin567/SuiXinCar | computer/drive.py | drive.py | py | 2,681 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "socketserver.BaseRequestHandler",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "socketserver.StreamRequestHandler",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "carCtrHelper.RCTest",
"line_number": 30,
"usage_type": "call"... |
7355568555 | from requests import get
from bs4 import BeautifulSoup as bs
from threading import Thread
print('K O N T O O O O L'.center(40))
print('*'*50)
link = ['https://ailisgarcia.com/wp-content/uploads/2018/09/',
'https://ailisgarcia.com/wp-content/uploads/2018/10/',
'https://ailisgarcia.com/wp-content/uploads/2018/11/'... | karjok/scpw | scpw.py | scpw.py | py | 956 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "requests.get",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "threading.Thread",
"l... |
27113750434 | import os
from pytube import YouTube
from tkinter import *
location = []
def download(youtube_link, download_folder):
YouTube(youtube_link).streams.get_highest_resolution().download(download_folder)
#yt.streams.filter(progressive=True, file_extension='mp4').order_by('resolution')[-1].download()
#yt = YouTub... | nextasliujun01/mingming | downloadvideo.py | downloadvideo.py | py | 1,547 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pytube.YouTube",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path.expanduser",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"lin... |
75023811559 | import pytest
from modbus_client.communication.serializer import *
protocol_code = '0000'
@pytest.mark.parametrize(['message', 'expected'],
[(bytes.fromhex('0005000000050201028002'), {'transaction_id': 5,
'unit_address': 2... | bronemos/modbus-client | test/communication_test/test_serializer.py | test_serializer.py | py | 5,826 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "pytest.mark.parametrize",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pytest.mark",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "pytest.mark.parametrize",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "pytest... |
28807328798 | import itertools
import sys
test_cases = open(sys.argv[1], 'r')
def permute(the_string):
# turn string into sorted array of chars
arr = [c for c in the_string]
arr.sort()
# then get all possible permutations, itertools implementation
# gives us the desired ordering, no more work to do
return [... | tnez/code-eval-submissions | string-permutations/submission.py3 | submission.py3 | py3 | 515 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "sys.argv",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "itertools.permutations",
"line_number": 12,
"usage_type": "call"
}
] |
27971599509 | import pandas as pd
from pathlib import Path
from docxtpl import DocxTemplate
from datetime import datetime
from PyPDF2 import PdfReader, PdfWriter
#Directory Paths for each file
binder_binder_fee = [ "Binder Fee Invoice - Cedar.pdf",
"Binder.docx"
]
cancel_letter = "Cancellat... | WebDevBernard/UsefulPythonScripts | api/3-Cancellation_Binder.py | 3-Cancellation_Binder.py | py | 3,759 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pathlib.Path",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pandas.read_excel",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.today",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "datetime.datet... |
13057023629 | from django.contrib import admin
from django.urls import path
from . import views
urlpatterns = [
path("",views.home,name="home"),
path("about",views.about,name="about"),
path("contact",views.contact,name="contact"),
path("onepiece",views.onepiece,name="onepiece"),
path("naruto",views.naruto,name="naruto"),
path("dem... | sailuffy/django-project | demonslayer/obito/urls.py | urls.py | py | 372 | python | en | code | 0 | github-code | 18 | [
{
"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",
... |
27301353650 | import time
from datetime import datetime
import psutil
from pyrogram import filters
from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup, Message
import config
from FallenMusic import BOT_NAME, StartTime, app
from FallenMusic.Helpers import get_readable_time
@app.on_message(filters.command("ping")... | PlutoOwner/PlutoMuzik | FallenMusic/Modules/ping.py | ping.py | py | 1,255 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "pyrogram.types.Message",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "config.PING_IMG",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "FallenMusic.BOT_NAME",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "time... |
7769489684 | import gym
import argparse
from stable_baselines3 import DQN
from stable_baselines3 import PPO
from gym import spaces
from stable_baselines3.common.env_checker import check_env
from stable_baselines3.common.callbacks import StopTrainingOnMaxEpisodes
from stable_baselines3.common.evaluation import evaluate_policy
impor... | yongzhe4869/Studienarbeit | src/proto_iface/env.py | env.py | py | 3,160 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "gym.core",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "host.ProtoHost",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "gym.spaces.Discrete",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "gym.spaces",
"li... |
71426755880 | import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
import cv2
import skimage
from skimage.filters import gaussian
import matplotlib.pyplot as plt
# Input data files are available in the "../input/" directory.
# For example, running this (by clicking run or ... | aorursy/new-nb-3 | gattacacat_read-and-display-images.py | gattacacat_read-and-display-images.py | py | 2,420 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pandas.read_csv",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "numpy.sum",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "subprocess.check_output",
"l... |
7492637674 | '''
Let's see how clunky it is to define and run ltspice simulations from python.
Will be possible to express much more complicated operations than in the spice language
As far as I know, we must communicate with ltspice via file io
Just need to translate python into spice language.
More often we will input existing ... | thennen/pyltspice | ltspice_control.py | ltspice_control.py | py | 18,780 | python | en | code | 4 | github-code | 18 | [
{
"api_name": "os.path.abspath",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 50,
"usage_type": "attribute"
},
{
"api_name": "os.path.isdir",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number... |
33805628388 | import json
import requests
subreddits = ['automation']
keywords = ['python', 'automation', 'scrape', 'automate']
headers = {"User-agent": "aws:com.sample:v0.1.4 by /u/someone"}
for sub in subreddits:
url = 'https://www.reddit.com/r/' + sub + '/new.json'
result = requests.get(url, headers = headers)
par... | stevehillin/reddit-python-iterate | reddit-bot.py | reddit-bot.py | py | 580 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "requests.get",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 13,
"usage_type": "call"
}
] |
3271476128 | import sqlite3, datetime, json
class db_sql(object):
def __init__(self):
self.connection = sqlite3.connect('dados.db')
self.c = self.connection.cursor()
def execute(self, sql):
self.c.execute(sql)
return self.connection.commit()
def return_data(self, sql):
sel... | JOAO322323232323/eliteconsignado | elite/old/sql.py | sql.py | py | 818 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "sqlite3.connect",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 19,
"usage_type": "call"
}
] |
24092627670 | from flask import Flask, request
from flask_jwt_extended import JWTManager
import re
from flask_cors import CORS
from ducttapp.helpers import init_data_db
jwt = JWTManager()
def _after_request(response):
allowed_origins = [
re.compile('https?://(.*\.)?localhost'),
# re.compile('https?://(.*\.)?te... | anhducc13/flask-app | ducttapp/__init__.py | __init__.py | py | 2,083 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "flask_jwt_extended.JWTManager",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "flask.request.headers.get",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "fla... |
34773848162 | # ------------------------------------------------------------------------------
# PBRT exporter - python plugin for Maya by Vladimir (Volodymyr) Kazantsev
# 2013
#
# Based on a Python LuxMaya translation by Doug Hammond, in turn base on translation of the c++ luxmaya exporter,
# in turn based on original maya-pbrt c... | Volodymyrk/pbrtMayaPy | pbrtMayaPy.py | pbrtMayaPy.py | py | 4,317 | python | en | code | 21 | github-code | 18 | [
{
"api_name": "PBRT.Commands.pbrtbatch.pbrtbatch",
"line_number": 38,
"usage_type": "name"
},
{
"api_name": "os.path.path.dirname",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "os.path.path",
"line_number": 42,
"usage_type": "attribute"
},
{
"api_name... |
6094787077 | from typing import List
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
from datetime import datetime, timedelta
class DistScorer():
'''
Simple distance scorer, approximates track to be linear (valid because short).
the prevlastpos attribute could be used to distiguish forward from backwards ... | JBarmentlo/Self-Aware-Driving-Patate | srcs/Scorer/SimpleScorer.py | SimpleScorer.py | py | 2,237 | python | en | code | 3 | github-code | 18 | [
{
"api_name": "numpy.ndarray",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "numpy.ndarray",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "datetime.datetime",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "numpy.array",... |
31386374274 | import numpy as np
import cv2
import matplotlib.pyplot as plt
original_image = cv2.imread("../spikes/portal.jpg")
img = original_image
edges = cv2.Canny(img,150,200)
figure_size=15
plt.figure(figsize=(figure_size,figure_size))
plt.subplot(1,2,1),plt.imshow(img)
plt.title('Original image'), plt.xticks([]), plt.yticks... | 1082sqnatc/missionspacelab2019 | src/portal.py | portal.py | py | 442 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "cv2.imread",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "cv2.Canny",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"... |
40504947033 | from nltk.corpus import reuters
from nltk.stem.snowball import SnowballStemmer
from nltk.corpus import stopwords
from scipy import spatial
from nltk import word_tokenize, sent_tokenize
from numpy import linalg as la
from numpy import mean as mn
from scipy import spatial
from copy import copy,deepcopy
import networkx as... | soares-ad/IA_AnaliseDeDiscurso | control.py | control.py | py | 7,800 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "nltk.stem.snowball.SnowballStemmer",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "nltk.word_tokenize",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "nltk.corpus.stopwords.words",
"line_number": 25,
"usage_type": "call"
},
{
... |
28585965841 | """
REM records classes and functions.
"""
from bs4 import BeautifulSoup
import datetime
import os
import sys
from random import randint
import re
import PySimpleGUI as sg
import dateutil
import numpy as np
import pandas as pd
import pdfkit
from jinja2 import Environment, FileSystemLoader
import REM.constants as mod... | cnthornton/REM | REM/records.py | records.py | py | 153,009 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "REM.client.logger.error",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "REM.client.logger",
"line_number": 56,
"usage_type": "name"
},
{
"api_name": "REM.secondary.popup_error",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "R... |
73899581480 | import numpy as np
from flask import Flask, request, jsonify, render_template
import pickle
import joblib
from catboost import CatBoostRegressor
from datetime import datetime
import pandas as pd
import sys # nopep8
sys.path.insert(1, './python') # nopep8
from data_storage import connection, create_connection
from fla... | Estreuselito/bikerus | flaskapp/views.py | views.py | py | 6,769 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "sys.path.insert",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "pandas.read_sql_query",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "data_storage.connec... |
3031207947 | from PyQt5.QtGui import QImage, QPixmap
from PyQt5.uic import loadUi
from PyQt5.QtCore import pyqtSlot, QTimer, QDate, Qt
from PyQt5.QtWidgets import QDialog,QMessageBox
from PyQt5.QtTextToSpeech import QTextToSpeech
import cv2
import face_recognition
import numpy as np
import datetime
import os
import csv
import mysql... | FahimAdnan2100/Automatic-Attendance-System | Face_Detection_PyQt_Final/out_window1.py | out_window1.py | py | 7,451 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "PyQt5.QtWidgets.QDialog",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "PyQt5.uic.loadUi",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "dateti... |
18967082749 | # -*- coding: utf-8 -*-
"""
Created on Fri Jan 11 09:32:47 2019
@author: wzy
"""
from keras.datasets import mnist
import numpy as np
from keras.models import Sequential
from keras.layers import Dense
from keras.layers import Dropout
from keras.layers import Flatten
from keras.layers.convolutional import Co... | wzy6642/Deep_Learning_Keras | CNN_mnist/code/mnist_classifier_CNN.py | mnist_classifier_CNN.py | py | 1,921 | python | en | code | 13 | github-code | 18 | [
{
"api_name": "keras.backend.set_image_data_format",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "keras.backend",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "numpy.random.seed",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "n... |
14145045166 | import logging
import os.path
import random
import time
from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException, StaleElementReferenceException, \
ElementNotInteractableException
from selenium.webdriver.support import expected_conditions
from selenium.webdriver.support.wait imp... | donthub/salty-sidekick | comm/better.py | better.py | py | 9,093 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "os.path.path.exists",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "os.path.path",
"line_number": 46,
"usage_type": "attribute"
},
{
"api_name": "os.path",
"line_number": 46,
"usage_type": "name"
},
{
"api_name": "selenium.webdriver.Chro... |
30188095045 | # -*- coding: utf-8 -*-
"""
Created on Tue May 18 22:16:23 2021
@author: vtac
"""
#Compare convexity of NNs
import pickle
import numpy as np
import matplotlib.pyplot as plt
model_name = 'P1C1_s'
fsize=10
pltparams = {'legend.fontsize': 'large',
'figure.figsize': (10,5),
'axes.la... | abuganza/NN_aniso_UMAT | helper_modules/compare_convexity.py | compare_convexity.py | py | 1,736 | python | en | code | 11 | github-code | 18 | [
{
"api_name": "matplotlib.pyplot.rcParams.update",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.rcParams",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 24,
"usage_type": "name"
},
{
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.