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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3919612930 | #!/usr/bin/python3
# Gtk.CellRendererSpin renders text in a cell like Gtk.CellRendererText from which it is derived. But
# while the latter offers a simple entry to edit the text, Gtk.CellRendererSpin offers a Gtk.SpinButton
# widget (and not a Gkt.Spinner() !). Of course, that means that the text has to be parseable ... | A-star-ayush/PyGobject | cell_Spin.py | cell_Spin.py | py | 2,072 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "gi.repository.Gtk.Window",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "gi.repository.Gtk",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "gi.repository.Gtk.Window.__init__",
"line_number": 16,
"usage_type": "call"
},
{
... |
31459152366 | from itertools import permutations
print('Теперь уже не совсем понятно, что за идеи у Санты в голове.\n' +
'но раз сказали, надо делать... Нужно найти самый длинный путь!\n')
with open('input.txt', 'r') as INPUT:
lines = INPUT.readlines()
#Инициализация списка мест
array = []
for line in lines:
line = ... | Joseph200210/homework2022 | day9/part2.py | part2.py | py | 1,749 | python | ru | code | 1 | github-code | 21 | [
{
"api_name": "itertools.permutations",
"line_number": 26,
"usage_type": "call"
}
] |
19351833490 | import cv2 as cv
import os
import numpy as np
class ModuleCalibration:
r"""
Class Module Calibration.
"""
def __init__(self, obj_p, criteria, size_chessboard=(9, 6)):
self.frame = []
self.criteria = criteria
self.size = size_chessboard
# Arrays to store object point... | lollopagno/VehicleSpeedEstimation | Calibration/ModuleCalibration.py | ModuleCalibration.py | py | 2,678 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "os.mkdir",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2GRAY",
"line_number": 33,
"usage_type": "attribute"
},
{
"api_name": "cv2.findChessboardCorne... |
18522829385 | from django.core.exceptions import ValidationError
from django.shortcuts import render
from django.contrib import auth, messages
from django.core.serializers import serialize
from django.core.urlresolvers import reverse_lazy
from django.views import generic
from django.conf import settings
from braces import views
fr... | azz/clicker | creator/views.py | views.py | py | 5,368 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "api.models.ClickerClass.objects.filter",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "api.models.ClickerClass",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "api.models",
"line_number": 24,
"usage_type": "name"
},
{
"ap... |
14032398932 | #! /usr/bin/env python
from ppclass import pp
from ppplot import plot2d
import numpy as np
import scipy.stats
import matplotlib.pyplot as plt
import math as m
# arguments
from optparse import OptionParser ### TBR by argparse
parser = OptionParser()
parser.add_option('-t','--time',action='append',dest='t',type="string"... | jbmadeleine/eduearth | TOOLS/plt_histwinds.py | plt_histwinds.py | py | 1,501 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "optparse.OptionParser",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "ppclass.pp",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "ppclass.pp",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "ppclass.pp",
"line_nu... |
17956172724 | """
логика приложения здесь. Каждое представление(view) получает HTTP-запрос, обрабатывает его и возвращает ответ
"""
import os
import time
import pytz
import sys
import json
import httplib2 # pip3.6 install httplib2 --upgrade
from django.shortcuts import render, redirect, get_object_or_404, HttpResponseRedirect, rev... | WhiteLedAnn/MGPUFitTrack | fit/fitapp/views.py | views.py | py | 18,280 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "oauth2client.client.OAuth2WebServerFlow",
"line_number": 187,
"usage_type": "call"
},
{
"api_name": "oauth2client.client",
"line_number": 187,
"usage_type": "name"
},
{
"api_name": "django.http.HttpResponse",
"line_number": 191,
"usage_type": "call"
},
... |
40641588324 | import logging
import os
import gzip
import boto3
from botocore.client import Config
s3resource = boto3.resource('s3', config=Config(signature_version='s3v4'))
s3client = boto3.client('s3', config=Config(signature_version='s3v4'))
logger = logging.getLogger(__name__)
def get_object(bucket, key):
"Download S3 obje... | bobcolner/s3rap | s3rap/s3rap.py | s3rap.py | py | 4,014 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "boto3.resource",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "botocore.client.Config",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "boto3.client",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "botocore.client.Confi... |
13453478484 | import tensorflow as tf
import numpy as np
import time
from IPython import display
import pandas as pd
import matplotlib.pyplot as plt
from sklearn import preprocessing
class LSTM(tf.keras.Model):
def __init__(self, timesteps, hiddenunits):
self.timesteps = timesteps
self.hidden = hiddenunits
... | Liangkang19/PyCharmFile | Cluster/Clusters/LSTM/source/lstm.py | lstm.py | py | 8,424 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "tensorflow.keras",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.keras.Sequential",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "tensorflow.keras",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name"... |
40022635464 |
'''
Document: a computer file containing information input by a computer user and usually created with an application
'''
import bz2
import gzip
from io import BytesIO
import re
import os
import logging
from sys import path
import tarfile
from zipfile import ZipFile
from shutil import copyfileobj, copyfile
from... | muskenna/pcoip-log-analyzer | library/content.py | content.py | py | 17,578 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "logging.getLogger",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "re.match",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "re.match",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "re.match",
"line_number": 47,... |
34293489608 | import numpy as np
import cv2
import math
class Transform():
def __init__(self,poly):
self.src = poly # Expected something like srcPol = [[pt1],[pt2],[pt3],[pt4]]
print(self.src)
x1=self.src[0][0]
y1=self.src[0][1]
x2=self.src[1][0]
y2=self.src[1][1]
x3=self.... | SummerMTech/warpImage | ownLibraries/cutImage.py | cutImage.py | py | 8,094 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "math.atan",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "math.pi",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "math.sqrt",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "math.cos",
"line_number": 26,
... |
34836361113 | from urllib.parse import quote
from unittest.mock import patch, MagicMock
from django.contrib.admin.sites import AdminSite
from django.contrib.auth.models import Group
from django.test import TestCase, RequestFactory, Client
from allianceauth.authentication.models import (
CharacterOwnership, State, OwnershipReco... | staropera/allianceauth | allianceauth/authentication/tests/test_admin.py | test_admin.py | py | 18,714 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django.test.TestCase",
"line_number": 44,
"usage_type": "name"
},
{
"api_name": "allianceauth.eveonline.models.EveAllianceInfo",
"line_number": 51,
"usage_type": "name"
},
{
"api_name": "allianceauth.eveonline.models.EveCorporationInfo",
"line_number": 51,
... |
34843521893 | from functools import partial
from django.contrib.auth.models import Permission, User
from allianceauth.notifications import notify
from allianceauth.views import NightModeRedirectView
from ._app_settings import APP_UTILS_NOTIFY_THROTTLED_TIMEOUT
from .django import users_with_permission
from .helpers import throttl... | staropera/allianceauth-app-utils | app_utils/allianceauth.py | allianceauth.py | py | 3,112 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django.contrib.auth.models.Permission.objects.get",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.models.Permission.objects",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.auth.models.Permission",
... |
24763796070 | from flask import Flask, render_template, request, redirect
from flask_sqlalchemy import SQLAlchemy
from datetime import datetime
app = Flask(__name__)
db = SQLAlchemy()
app.config["SQLALCHEMY_DATABASE_URI"] = "sqlite:///project.db"
db.init_app(app)
class Todo(db.Model):
id = db.Column(db.Integer, primary_key=Tr... | Vishakh2012/svelte2-flask | app.py | app.py | py | 1,004 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "flask.Flask",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "flask_sqlalchemy.SQLAlchemy",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "flask.ren... |
37533667232 | """Functions to be utilised within manage.py shell"""
from QuarenPlanner.models import Event
import datetime
def delete_all(model):
model.objects.all().delete()
def create_example_event():
"""
Create an example event with id of 0 in database
"""
event = Event()
event.id = 0
event.name = ... | D-DePablos/QuaranPlanner | backend_django/helpers.py | helpers.py | py | 1,776 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "QuarenPlanner.models.Event",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "datetime.timezone",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "d... |
23175208590 | import os
from Bio.Seq import Seq
__location__ = os.path.realpath(
os.path.join(os.getcwd(), os.path.dirname(__file__)))
file = open(os.path.join(__location__,"rosalind_prot.txt"), "r")
dnastr = file.read()
dnaseq = Seq(dnastr)
print(dnaseq.translate(to_stop=True, cds = False)) | qedrohenrique/exercises | Rosalind/PROT.py | PROT.py | py | 286 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "os.path.realpath",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": ... |
40887376225 | from flask import Flask, render_template, request
import pandas as pd
import cufflinks as cf
import plotly as py
import plotly.graph_objs as go
from pyecharts import options as opts
from pyecharts.charts import Line
df1 = pd.read_csv("canhui.csv",encoding = 'gbk')
app = Flask(__name__)
# 准备工作
region... | DLIERBA/Interactive-data-visualization | dash/form.py | form.py | py | 2,058 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pandas.read_csv",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "flask.Flask",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "flask.request.form",... |
2485329057 | from tkinter import*
import time
from PIL import ImageTk , Image
window = Tk()
window.geometry("560x420")
window.title("Coffee Simulator")
Title = Label(window,text='COFFEE SIMULATOR - SPD',font=('Lucida Console',20,'bold','italic'))
Title.place(x=90,y=0)
base = ImageTk.PhotoImage(Image.open("G:... | Sharvil-Dhage/Coffee-Simulator-wid-tkinter-Python- | coffeesim.py | coffeesim.py | py | 1,382 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "PIL.ImageTk.PhotoImage",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "PIL.ImageTk",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "PIL.Image.open",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"li... |
74648240371 | import serial,time
import re
import termios, sys, os
try:
arduino = serial.Serial("/dev/ttyACM0", 57600, timeout=1)
time.sleep(5)
except:
print ('cannot open serial port. check serialport in above command')
sys.exit()
def getkey():
term = open("/dev/tty", "r")
fd = term.fileno()
old = termios.tcgetatt... | athulvijayan6/eeg-neurosky-arduino | brainWave101/pythonScripts/serialRead57600.py | serialRead57600.py | py | 1,032 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "serial.Serial",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "termios.tcgetattr",
"line_number"... |
25486120254 | from datetime import datetime
from django.urls import reverse
from rest_framework import status
from rest_framework.test import APITestCase, APIClient
from payments.models import TransactionLocal
from channelstate.models import Channel, Ledger
from users.models import Account
import json
import requests
from requests.e... | zhuohang2001/flashbloc_orbital | flashbloc/flashblocproject/payments/tests/test_executeTxlocal_api.py | test_executeTxlocal_api.py | py | 4,772 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "rest_framework.test.APITestCase",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "rest_framework.test.APIClient",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "users.models.Account.objects.create",
"line_number": 20,
"usage_type": "cal... |
73695047731 | from flask import Flask, render_template, request, session, flash, redirect
from mysqlconnection import connectToMySQL
app = Flask(__name__)
app.secret_key = 'supersecretkey'
@app.route('/')
def index():
mysql = connectToMySQL("lead_gen_business")
all_customers = mysql.query_db("SELECT clients.first_name,clie... | jawang94/python_repo | flask_MySQL/leads_and_clients/server.py | server.py | py | 1,195 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "flask.Flask",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "mysqlconnection.connectToMySQL",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "mysqlc... |
31450918180 | from threading import Thread
import yaml
import os
import re
class ErrorWatcher(Thread):
def __init__(self):
super(ErrorWatcher, self).__init__()
self.completed = False
self.result = None
def extract_error_info(self):
error_info = []
result = []
pattern = r'^\[\d{2}-\d{2}-\d{4} \d{2}:\d{2}:\d{2}\].*\n$... | av3r6un/wavebox | main/functions/core.py | core.py | py | 1,364 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "threading.Thread",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "re.match",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "re.match",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number":... |
20364099327 | from starry_process import StarryProcess
import numpy as np
import pytest
starry = pytest.importorskip("starry")
def test_sample_conditional():
# Sample the flux from the prior
sp = StarryProcess(normalized=False, marginalize_over_inclination=False)
t = np.linspace(0, 2, 300)
flux = sp.sample(t, p=1... | rodluger/starry_process | tests/test_sample.py | test_sample.py | py | 756 | python | en | code | 13 | github-code | 21 | [
{
"api_name": "pytest.importorskip",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "starry_process.StarryProcess",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.linspace",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.... |
37943496895 | from fastapi import FastAPI
from nonebot import get_app
app: FastAPI = get_app()
keys = ["eya46_proxy_school"]
@app.post("/proxy_http")
async def get_proxy(data: dict):
key = data.get("key")
if not key:
return {"success": -1, "msg": "缺少参数"}
if key not in keys:
return {"success": -2, "msg... | njpica/DlsBot | src/plugins/aProxy/__init__.py | __init__.py | py | 576 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "fastapi.FastAPI",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "nonebot.get_app",
"line_number": 4,
"usage_type": "call"
}
] |
43863514221 | from nanotune.tuningstages.settings import Classifiers
import pytest
import nanotune as nt
from nanotune.device_tuner.tuner import TuningHistory
from nanotune.device_tuner.dottuner import (DotTuner, VoltageChangeDirection,
DeviceState, check_new_voltage, RangeChangeSetting)
from nanotune.device_tuner.tuningresult i... | microsoft/nanotune | nanotune/tests/tuning/test_dottuner.py | test_dottuner.py | py | 31,551 | python | en | code | 9 | github-code | 21 | [
{
"api_name": "nanotune.device_tuner.dottuner.DeviceState.pinchedoff",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "nanotune.device_tuner.dottuner.DeviceState",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "nanotune.device_tuner.dottuner.DeviceState.... |
37573594991 | from sklearn.decomposition import PCA
from FileIO import FileIO
import numpy as np
from sklearn.metrics import mutual_info_score
from sklearn.decomposition import FastICA
from statsmodels.stats.diagnostic import acorr_ljungbox
from signal_utilities import custom_norm
import mne
def get_mutual_information(x,y):
bin... | madwilliam/GravesCode | scripts/dimension_magic.py | dimension_magic.py | py | 4,255 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "numpy.linspace",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.histogram2d",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sklearn.metrics.mutual_info_score",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "nu... |
8689421233 | # -*- coding: utf-8 -*-
"""
Created on Thu Sep 23 13:22:04 2021
@author: Banani Fatima-Zahra
"""
from collections import OrderedDict
import random
class MinCut:
def __init__(self,filename,debug):
file = open(filename, 'r')
adjacency_dict = OrderedDict()
number_edges = 0
self.number... | fatimazahraBanani/Algorithm-Specialization-Stanford-Coursera | Course1_week4/assignment.py | assignment.py | py | 4,264 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "collections.OrderedDict",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "collections.OrderedDict",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "random.seed",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "random.ra... |
9533131658 | import numpy as np
from itertools import product
from game_generators.functions.interpolate import interpolate_table
from game_generators.utils.transforms import scale_array
def concave_table(dim, batch_size=1, min_y=0, max_y=10, num_points=10, rng=None, seed=None):
"""Generate a random concave, monotonically inc... | wilrop/game-generators | game_generators/functions/concave.py | concave.py | py | 4,562 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "numpy.random.default_rng",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "numpy.zeros",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "numpy.array",
... |
15935928841 |
import gast
from tensorflow.python.autograph.core import converter
from tensorflow.python.autograph.pyct import parser
from tensorflow.python.autograph.pyct import templates
SAFE_BOOLEAN_OPERAND = 'SAFE_BOOLEAN_OPERAND'
LOGICAL_OPERATORS = {
gast.And: 'ag__.and_',
gast.Not: 'ag__.not_',
gast.Or: 'ag__.or_'... | Mockingbird01001/NLG-code-generator-LSTM | work/data/data_model/batch_2/logical_expressions.py.transformed.py | logical_expressions.py.transformed.py | py | 2,972 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "gast.And",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "gast.Not",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "gast.Or",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "gast.Eq",
"line_number": 1... |
39851712775 | # 네이버 검색 API예제는 블로그를 비롯 전문자료까지 호출방법이 동일하므로 blog검색만 대표로 예제를 올렸습니다.
# 네이버 검색 Open API 예제 - 블로그 검색
import os
import sys
import urllib.request
import requests
from bs4 import BeautifulSoup
client_id = "f4fbpPBChc_CAKtroyjS"
client_secret = "d37hKYSHdx"
encText = urllib.parse.quote("치킨")
url = "https://openapi.naver.com/v1... | shfkd123/Python | day05/mycrawl02naver.py | mycrawl02naver.py | py | 1,142 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "urllib.request.parse.quote",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "urllib.request.parse",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "urllib.request",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "u... |
7574787627 | import pandas as pd
import datetime
import numpy as np
from sklearn.ensemble import RandomForestClassifier
from sklearn.model_selection import StratifiedKFold
import warnings
with warnings.catch_warnings():
warnings.filterwarnings("ignore", category=DeprecationWarning)
from imblearn.over_sampling import SMOTE
... | RafailSkoulos17/cyber_data_analytics | streams/classification.py | classification.py | py | 6,230 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "warnings.catch_warnings",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "warnings.filterwarnings",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "dateti... |
3312571394 | from functools import partial
import numpy as np
import numpy.typing as npt
import sympy as sp
import pytest as pt
from polynomials import (
IntegrationTypes,
get_points_weights,
get_points_weights_degree,
lagrange_poli,
d_lagrange_poli,
)
@pt.mark.parametrize(
"alfa, beta, intorder, type_int,... | ruy-sevalho/im382 | test/test_polynomials.py | test_polynomials.py | py | 4,543 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "polynomials.IntegrationTypes",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "numpy.typing.NDArray",
"line_number": 35,
"usage_type": "attribute"
},
{
"api_name": "numpy.typing",
"line_number": 35,
"usage_type": "name"
},
{
"api_name": "n... |
23543768181 | import os
import sys
#Make sure the path to the root directory of the project is in the system path
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
import matplotlib.pyplot as plt
from matplotlib import pyplot as plt
from matplotlib import cm
from matplotlib import colors
import numpy as ... | IvanOleksiyuk/jet_cluster_scanning | preproc/data_plotting.py | data_plotting.py | py | 7,053 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "sys.path.append",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number... |
32361240998 | import yaml
from typing import Dict, List
def _convert_covenant_to_empire(covenant_dict: Dict, file_path: str):
return {
'name': covenant_dict['Name'],
'authors': [covenant_dict['Author']['Handle']],
'description': covenant_dict['Description'],
'language': covenant_dict['Language']... | ryanmrestivo/red-team | Command-Control-Exfiltration-&-Persistance/Empire/Empire/empire/server/common/converter/load_covenant.py | load_covenant.py | py | 1,675 | python | en | code | 91 | github-code | 21 | [
{
"api_name": "typing.Dict",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "yaml.dump",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "typing.List",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "typing.Dict",
"line_number": 18,... |
35946919535 | from dataclasses import dataclass, field
from typing import List, Optional
from pprint import pprint
import math
@dataclass
class Monkey:
items: Optional[List[str]] = field(default_factory=list)
operator: Optional[str] = '+'
operation_operand: Optional[str] = '0'
test_operand: Optional[int] = 0
tar... | nadege/advent-of-code | src/year_2022/day_11/day_11.py | day_11.py | py | 2,975 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "typing.Optional",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "dataclasses.field",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "typing.Optional",
"lin... |
11876874856 | # -*- coding: utf-8 -*-
# @Time : 2018/4/17 15:26
# @Author : 'Robin Li
# @Email : liqinjia372135@163.com
# @File : 14、高亮显示正在操作的页面元素.py
# @Software: PyCharm
from selenium import webdriver
import unittest
import time
import traceback
def highLightElement(driver,element):
driver.execute_script("arguments[0... | johnsonliu33/SeleniumAuto | 三、WebDriver高级应用/14、高亮显示正在操作的页面元素.py | 14、高亮显示正在操作的页面元素.py | py | 1,156 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "unittest.TestCase",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "t... |
31581286259 | import requests
import dotenv
import os
# Load .env and set API keys
dotenv.load_dotenv()
ELEVENLABS_API = os.getenv("ELEVENLABS_API")
print(ELEVENLABS_API)
CHUNK_SIZE = 1024
url = "https://api.elevenlabs.io/v1/text-to-speech/batman"
headers = {
"Accept": "audio/mpeg",
"Content-Type": "application/json",
"xi-a... | asapsav/skull-gpt | helper scripts/simple-request-11labs.py | simple-request-11labs.py | py | 600 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "dotenv.load_dotenv",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number": 28,
"usage_type": "call"
}
] |
2763459004 | import pygame
from pygame.locals import *
import myutil
class Thing(pygame.Rect):
def __init__(self, location, size,
image, tag, is_blocker):
super().__init__(location, size)
self.image = image
self.tag = tag #what kind of object is it?
self.is_blocker = is_blocker #can it block play... | sallywag/super-bro-dog | Game/extra/1/master.py | master.py | py | 4,523 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pygame.Rect",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "pygame.Rect",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "myutil.LEFT",
"line_number": 45,
"usage_type": "attribute"
},
{
"api_name": "myutil.RIGHT",
... |
45670026755 | from rich.table import Table
import time
from rich.progress import track
from time import sleep
from rich.console import Console
from rich.prompt import Prompt
from rich import print
# Print coloured text and include emojis
print("[red underline]:thumbs_up: hello world")
# Request feedback from the user and only all... | mattmole/LXF303-304-Python-Rich | richTutorial.py | richTutorial.py | py | 1,582 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "rich.print",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "rich.prompt.Prompt.ask",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "rich.prompt.Prompt",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "rich.print",
... |
71125470134 | # -*- coding: utf-8 -*-
from django.shortcuts import get_object_or_404, render
from django.http import HttpResponseRedirect, HttpResponse
from django.core.urlresolvers import reverse
from django.views import generic
from django.shortcuts import redirect
from models import Test, Question, Answer, TestUser, UserAnswer
fr... | braytner/site2 | testmaker/views.py | views.py | py | 3,761 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django.views.generic.ListView",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "django.views.generic",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "models.Test.objects.all",
"line_number": 16,
"usage_type": "call"
},
{
"a... |
32295753034 | import cv2
import numpy as np
img = cv2.imread('mudo.jpg')
hsv = cv2.cvtColor(img, cv2.COLOR_BGR2HSV)
lower_red = np.array([30, 150, 50])
upper_red = np.array([255, 255, 180])
mask = cv2.inRange(hsv, lower_red, upper_red)
res = cv2.bitwise_and(img, img, mask=mask)
kernel = np.ones((15,15),np.float32)/225
smoothed =... | PhuongThao09/GR1_imageProcessing | low_pass.py | low_pass.py | py | 503 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "cv2.imread",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2HSV",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "numpy.array",
"line_n... |
13022882105 | from abc import ABCMeta, abstractmethod
from json import dumps as json_dumps, loads as json_loads
from typing import Any
from aioredis import Redis
from cachetools import Cache as CTCache, LRUCache
class Cache(metaclass=ABCMeta):
@abstractmethod
async def get(self, url: str) -> Any:
...
@abstra... | ZipFile/duplicatebooru | duplicatebooru/cache.py | cache.py | py | 1,292 | python | en | code | 7 | github-code | 21 | [
{
"api_name": "abc.ABCMeta",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "abc.abstractmethod",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "typing.Any",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "typing.Any",
"line_numb... |
29471696883 | import requests, datetime, time, json, os
from pyspark import SparkContext
from pyspark.streaming import StreamingContext
from pyspark.sql import SQLContext, SparkSession
from kafka import KafkaConsumer
# Config
KAFKA_HOST, KAFKA_PORT = 'localhost', '9092'
#os.environ['PYSPARK_SUBMIT_ARGS'] = '--packages org.apache.sp... | YutingYao/YutingDB | GeoBigData/SPARK/Spark_Kafka_RDD_Humidity/02 - kafka2spark_02.py | 02 - kafka2spark_02.py | py | 1,274 | python | en | code | 4 | github-code | 21 | [
{
"api_name": "pyspark.SparkContext",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pyspark.streaming.StreamingContext",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pyspark.sql.SQLContext",
"line_number": 13,
"usage_type": "call"
},
{
"ap... |
16060007782 | # -*- coding: utf-8 -*-
"""
Created on Thu Oct 7 12:40:05 2021
@author: José Miguel Algarín Guisado
MRILAB @ I3M
"""
import sys
# marcos_client path for linux
sys.path.append('../marcos_client')
# marcos_client and PhysioMRI_GUI for Windows
sys.path.append('D:\CSIC\REPOSITORIOS\marcos_client')
sys.path.append('D:\CS... | yvives/PhysioMRI_GUI | seq_standalone/mse_standalone.py | mse_standalone.py | py | 15,829 | python | en | code | 7 | github-code | 21 | [
{
"api_name": "sys.path.append",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "sys.path.append",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_nu... |
8803157123 | import common
from config import data_not_deleted
class Base:
es = None
def __init__(self):
self.es = common.get_es_social()
@staticmethod
def get_total_counts(es_query_result):
"""
根据es的查询结果,获取符合条件的总条数,主要用于分页的总页数
:param es_query_result:
:return:
"""
... | BackEnd-Project/reading-pro-system-py | storage/es/Base.py | Base.py | py | 1,556 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "common.get_es_social",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "config.data_not_deleted",
"line_number": 27,
"usage_type": "name"
}
] |
74967333491 | from tencentcloud.common import credential
from tencentcloud.common.profile.client_profile import ClientProfile
from tencentcloud.common.profile.http_profile import HttpProfile
from tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKException
from tencentcloud.asr.v20190614 import asr_clien... | yexia553/originbot_home_assistant | backend/voice_control/views.py | views.py | py | 3,475 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "logging.basicConfig",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.views.APIView",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "re... |
33897863153 | from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union
import attr
from ..types import UNSET, Unset
if TYPE_CHECKING:
from ..models.dimensions import Dimensions
from ..models.weight import Weight
T = TypeVar("T", bound="Pallet")
@attr.s(auto_attribs=True)
class Pallet:
r"""Pallet inf... | milyord/sp-api | sp/fulfillment_inbound_v0/models/pallet.py | pallet.py | py | 2,596 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "typing.TYPE_CHECKING",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "typing.TypeVar",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "typing.Union",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "types.Unset",
"li... |
41330943953 |
# coding: utf-8
# ## Predicting text by learning from Quran corpus
# In[1]:
import numpy
from keras.models import Sequential
from keras.layers import Dense
from keras.layers import Dropout
from keras.layers import LSTM, SimpleRNN, GRU
from keras.callbacks import ModelCheckpoint
from keras.utils import np_utils
#... | elmkarim/NLP_on_Arabic_text | Udacity_capstone_gru.py | Udacity_capstone_gru.py | py | 5,341 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "keras.preprocessing.text.Tokenizer",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "numpy.reshape",
"line_number": 135,
"usage_type": "call"
},
{
"api_name": "keras.utils.np_utils.to_categorical",
"line_number": 140,
"usage_type": "call"
},
{... |
70365806454 | # take a look at sus-analyzer?
import os, string, re, dataclasses, typing
from typing import Callable, Dict, List
tick_per_beat = 480
bpm_def_pattern = re.compile('BPM(\\d{2}):\\s*(\\d+(\\.\\d+)?)')
bpm_apply_pattern = re.compile('(\\d{3})08:\\s*(\\d{2})')
beat_unit_pattern = re.compile('(\\d{3})02:\\s*(\\d+)')
note_... | cvrunmin/YARGChartGen | sus_score.py | sus_score.py | py | 6,962 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "re.compile",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 10,
... |
23432856620 | from datetime import datetime
from django.contrib.auth.models import User
from django.contrib.auth.hashers import make_password
from django.db import transaction
from django.http import JsonResponse
from rest_framework.decorators import api_view, permission_classes
from rest_framework.permissions import IsAuthenticated... | horizonltd/salesblinkpost | core/views.py | views.py | py | 4,915 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "rest_framework_simplejwt.serializers.TokenObtainPairSerializer",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "core.serializers.UserSerializerWithToken",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "rest_framework_simplejwt.views.TokenObtai... |
34160851080 | import os
import numpy as np
from torch.utils.data import Dataset
from datetime import datetime
class TemporalKGDataset(Dataset):
ent2id = dict()
rel2id = dict()
date2id = dict()
def __init__(self, kg_root, mode, neg_ratio):
super(TemporalKGDataset, self).__init__()
self.kg_root = ... | heiung2001/TKGC | dataset.py | dataset.py | py | 3,346 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "torch.utils.data.Dataset",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "os.path.join",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 48,
"usage_type": "attribute"
},
{
"api_name": "datetime.datetime.s... |
13069607408 | import pymysql
import json
import sys
cnx = pymysql.connect(host='localhost',
user='dbuser',
password='dbuser',
db='lahman2017raw',
charset='utf8mb4',
cursorclass=pymy... | lt616/web_back-end_MySQL_flask | FlaskSimple/SimpleBO.py | SimpleBO.py | py | 12,948 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pymysql.connect",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pymysql.cursors",
"line_number": 10,
"usage_type": "attribute"
}
] |
30550015577 | # Print a date in a the following format
# Day_name Day_number Month_name Year
# Given:
# given_date = datetime(2020, 2, 25)
from datetime import datetime
# Given date
given_date = datetime(2020, 2, 25)
# Format the date as "Day_name Day_number Month_name Year"
formatted_date = given_date.strftime("%A %d %B %Y")
... | Ayoeunice/python_training | date_and_time_exercise/exercise_4.py | exercise_4.py | py | 388 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "datetime.datetime",
"line_number": 8,
"usage_type": "call"
}
] |
72472200692 | import os
import logging.config
from rec_to_nwb.processing.nwb.components.position.time.valid.fl_pos_valid_time_manager import FlPosValidTimeManager
from rec_to_nwb.processing.nwb.components.position.time.valid.pos_valid_time_injector import PosValidTimeInjector
path = os.path.dirname(os.path.abspath(__file__))
loggi... | NovelaNeuro/rec_to_nwb | rec_to_nwb/processing/builder/originators/pos_valid_time_originator.py | pos_valid_time_originator.py | py | 960 | python | en | code | 8 | github-code | 21 | [
{
"api_name": "os.path.dirname",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "logging.config.config.fileC... |
13961019699 | from django.shortcuts import render_to_response
from django.contrib.contenttypes.models import ContentType
from read_statistics.utils import get_seven_days_read_data, get_today_hot_data, get_yesterday_hot_data, get_7_days_hot_data
from blog.models import Blog
from django.utils import timezone
import datetime
from dja... | RainLeave/RainBlog | read_statistics/views.py | views.py | py | 1,735 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django.utils.timezone.now",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.utils.timezone",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "datetime.timedelta",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "bl... |
9160970164 | from django import forms
from .models import Contact
class ContactForm(forms.ModelForm):
class Meta:
model = Contact
fields = ('name', 'email', 'message')
def __init__(self, *args, **kwargs):
"""
Add placeholders and classes, remove auto-generated
labels and set autofo... | Henriqueperoni/henrique-peroni | contact/forms.py | forms.py | py | 1,003 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django.forms.ModelForm",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "models.Contact",
"line_number": 7,
"usage_type": "name"
}
] |
12536201930 | import numpy as np
import scipy.linalg
import matplotlib.pyplot as plt
import matplotlib
import scipy.special
import scipy.sparse
import math
matplotlib.rcParams['figure.figsize'] = (15, 10)
matplotlib.rcParams.update({'font.size': 22})
# ---------- numerical -------------------
def tridiagonal_matrix(x, Ec=0.214, Ej=... | louisemccann/final_project | individual graph.py | individual graph.py | py | 1,381 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "matplotlib.rcParams",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.rcParams.update",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "matplotlib.rcParams",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_nam... |
36869549362 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.Create... | coveter/portforest | api/migrations/0001_initial.py | 0001_initial.py | py | 1,108 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.swappable_dependency",
"line_number": 11,
"usage_type": "call... |
36201544266 | from app.api.helpers import Service
from app.models import AuditEvent
from enum import Enum
import rollbar
class AuditService(Service):
__model__ = AuditEvent
def __init__(self, *args, **kwargs):
super(AuditService, self).__init__(*args, **kwargs)
def log_audit_event(self, **kwargs):
try... | shanec1802/orams | backend/app/api/services/audit.py | audit.py | py | 989 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "app.api.helpers.Service",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "app.models.AuditEvent",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "app.models.AuditEvent",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "rol... |
1876202682 | #!/usr/bin/env python
HELP = """
Run all of the scripts relevant to eagle in the correct order.
"""
import glob
import os
import platform
import distro
import sys
# Get all of the tricky packages out of the way
try:
import sh
except:
print("You need to install the sh module.")
print("https://github.com/a... | lab11/eagle | scripts/eagle.py | eagle.py | py | 2,588 | python | en | code | 61 | github-code | 21 | [
{
"api_name": "sys.exit",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "platform.system",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "glob.glob",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": ... |
14932696115 | from datetime import datetime
import os
import requests
import gzip
import shutil
import send2trash
from lxml import etree
def get_valid_filenames():
FILENAME = "justice_files.txt"
my_file = download_list_filenames()
save_file(my_file, FILENAME)
valid_files = get_files_list(FILENAME)
return valid_... | SveterCZE/justice | download_files.py | download_files.py | py | 4,019 | python | en | code | 7 | github-code | 21 | [
{
"api_name": "requests.get",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 47,
"usage_type": "name"
},
{
"api_name": "os.path.join",
... |
22339810177 | import requests
from bs4 import BeautifulSoup as BS
from core.constants import FILE_PATH, UNSCRAPPED_DATA
def read_file_content(filepath: str):
file_content=""
with open(filepath,"r") as f:
file_content=f.read()
return file_content
def extract_all_listings_elements(page_html):
section_divs = p... | Vbehal01/acres-scraping | data_scraping/core/web_scraping.py | web_scraping.py | py | 4,569 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "core.constants.UNSCRAPPED_DATA",
"line_number": 77,
"usage_type": "name"
},
{
"api_name": "core.constants.FILE_PATH",
"line_number": 78,
"usage_type": "argument"
},
{
"api_name": "requests.get",
"line_number": 82,
"usage_type": "call"
},
{
"api_name... |
27512209427 | """ Module Marvin """
import pyttsx3
import datetime
import wikipedia
import webbrowser
import speech_recognition as sr
from utils import *
speaker = Speaker()
def wish_me():
hour = int(datetime.datetime.now().hour)
if hour >= 0 and hour < 12:
speaker.speak('Good morning, Sir!')
elif hour >= 12 ... | cshintov/marvin | marvin.py | marvin.py | py | 2,205 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "datetime.datetime.now",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "speech_recognition.Recognizer",
"line_number": 27,
"usage_type": "call"
},
{
"api_na... |
41760340496 | import math
from . import spk_utils as snn
import torch
import torch.nn as nn
import torch.nn.functional as F
from .spk_utils.neighbors import atom_distances
from typing import Union, Callable
class BesselBasis(nn.Module):
"""
Sine for radial basis expansion with coulomb decay. (0th order Bessel from DimeNet)
... | Matgen-project/MOFNet | baselines/painn.py | painn.py | py | 9,504 | python | en | code | 8 | github-code | 21 | [
{
"api_name": "torch.nn.Module",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "torch.arange",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "math.pi",
"line_number":... |
38426220085 |
from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$', views.index, name='index'),
url(r'sms', views.sms, name='sms'),
url(r'add_cases', views.add_cases, name='add_cases'),
url(r'add_cases_refresh', views.add_cases_refresh, name='add_cases_refresh'),
u... | daseinkapital/didactic-enigma | Scripts/predictive/demo/urls.py | urls.py | py | 477 | python | en | code | 0 | github-code | 21 | [
{
"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.conf.urls.url",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.co... |
28952634483 | import cv2
import glob
import os
if __name__ == '__main__':
i = 3
j = 0
for k in range(11):
if k < 10:
str_k = '0'+str(k)
else:
str_k = str(k)
file_name1 = r"image_ori\Lane01\Cyc0{}".format(str_k)
file_name2 = glob.glob(file_name1+"\*.tif")
f... | pksolar/sailus | pythonProject/Laplace.py | Laplace.py | py | 1,294 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "glob.glob",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "cv2.Laplacian",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "cv2.CV_64F",
"line_number": 25... |
42547254182 | from django.contrib.auth.models import User
from rest_framework import serializers
from .models import Shop, Schedule, TimeRange
class TimeRangeSerializer(serializers.ModelSerializer):
from_t = serializers.TimeField(format='%H:%M')
to_t = serializers.TimeField(format='%H:%M')
schedule = serializers.Prima... | lootaz/dh_shop_backend | dh/dh_shop/serializers.py | serializers.py | py | 2,892 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "rest_framework.serializers.ModelSerializer",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.serializers",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "rest_framework.serializers.TimeField",
"line_number": 8,
"usage_... |
6501735690 | from abc import ABCMeta, abstractmethod
from typing import Tuple, Any
from .interface import Interface
class IPointingHelioprojective(Interface, metaclass=ABCMeta):
"""The module can move to Mu/Psi coordinates, usually combined with :class:`~pyobs.interfaces.ITelescope`."""
__module__ = "pyobs.interfaces"
... | pyobs/pyobs-core | pyobs/interfaces/IPointingHelioprojective.py | IPointingHelioprojective.py | py | 946 | python | en | code | 8 | github-code | 21 | [
{
"api_name": "interface.Interface",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "abc.ABCMeta",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "typing.Any",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "abc.abstractmethod",
"li... |
33909750341 | #Name: Anik Singha
#Email: anik.singha68@myhunter.cuny.edu
#Date: September 12, 2021
#Folium
import folium
map = folium.Map(location=[40.75, -74.125], zoom_start=10)
folium.Marker(location = [40.7420577, -74.0101494], popup = "Little Island").add_to(map)
map.save("nycMap.html")
| AnikSingha/CS127 | 42.py | 42.py | py | 283 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "folium.Map",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "folium.Marker",
"line_number": 10,
"usage_type": "call"
}
] |
23303634573 | import pygame
from data.scripts.helper.level_handler import LevelHandler
from data.scripts.scenes.main_menu import MainMenu
from data.scripts.ui.gui import GUI
from data.scripts.ui.user_input import InputManager
from data.scripts.entities.entity_manager import EntityManager
from data.scripts.vfx.reconnect_controller ... | MonkeyWaffle0/theDescent | game.py | game.py | py | 1,643 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pygame.time.Clock",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pygame.time",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "pygame.init",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_cap... |
75027441333 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
# If facing an error like "Fatal error condition occurred in aws-c-io",
# see https://github.com/huggingface/datasets/issues/3310#issuecomment-1291628759
# Until a proper fix is in place, the workaround is to install the newest pyarrow
# !pip install --extra-index-url http... | EleutherAI/polyglot-data | romance/download_wikipedia.py | download_wikipedia.py | py | 1,689 | python | en | code | 19 | github-code | 21 | [
{
"api_name": "pathlib.Path",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "datasets.load_dataset",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 25,
"usage_type": "call"
}
] |
29427731615 | """piece builders for blender 2.8"""
import bpy
from math import tan, sqrt, floor
from helper_functions import *
import numpy as np
from itertools import product
INF = [100, -100]
INF_POS = [100, 0]
INF_NEG = [0, -100]
# __all__ = [
# "HeadMount",
# "HeadMount2",
# "Chamber"
# ]
class HeadMount2:
... | esutlie/blender_creations | blender/builds.py | builds.py | py | 134,793 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "math.tan",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "math.sqrt",
"line_number": 168,
"usage_type": "call"
},
{
"api_name": "math.sqrt",
"line_number": 169,
"usage_type": "call"
},
{
"api_name": "bpy.ops.mesh.bevel",
"line_number"... |
73980992694 | from datetime import datetime
from django.db import models
from django.conf import settings
from django.contrib.auth.models import User
from django.utils.translation import ugettext_lazy as _
from tagging.fields import TagField
from tagging.models import Tag
if "notification" in settings.INSTALLED_APPS:
from not... | j2labs/wikitrans | wt-app/apps/wt_languages/models.py | models.py | py | 2,126 | python | en | code | 17 | github-code | 21 | [
{
"api_name": "django.conf.settings.INSTALLED_APPS",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "django.conf.settings",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "notification.models",
"line_number": 14,
"usage_type": "name"
},
{
... |
36062414687 | import itertools
import json
from datetime import date, datetime
from AccessControl import getSecurityManager
from AccessControl import Unauthorized
import Missing
from plone.app.layout.navigation.root import getNavigationRootObject
from plone.app.uuid.utils import uuidToObject
from Products.CMFCore.permissions import... | mostscript/uu.formlibrary | uu/formlibrary/browser/jsonlisting.py | jsonlisting.py | py | 4,915 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "Products.ZCatalog.Lazy.LazyCat",
"line_number": 38,
"usage_type": "argument"
},
{
"api_name": "itertools.imap",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "Products.ZCatalog.Lazy.LazyCat",
"line_number": 50,
"usage_type": "argument"
},
{
... |
24361049276 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Test custom loading"""
import numpy as np
from .utils import DATA_DIR
from tdsr.loading import CustomLoading
from tests.test_fig5bc import compute_groningen_stress_loading
def test_custom_loading_file_and_data(fs):
fs.add_real_directory(DATA_DIR)
dsig = 1.0... | torstendahm/tdsr | tests/test_custom_loading.py | test_custom_loading.py | py | 1,557 | python | en | code | 3 | github-code | 21 | [
{
"api_name": "utils.DATA_DIR",
"line_number": 14,
"usage_type": "argument"
},
{
"api_name": "tests.test_fig5bc.compute_groningen_stress_loading",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.savetxt",
"line_number": 38,
"usage_type": "call"
},
{
... |
36032294842 | import os
import django_heroku
from pathlib import Path
from django.contrib.messages import constants as messages
# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent
TEMPLATE_DIR = os.path.join(BASE_DIR, 'templates')
# Quick-start development settings - ... | berylvirgo/mg03-project | gcp_mws_project/settings.py | settings.py | py | 5,309 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pathlib.Path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number":... |
8013593782 | from sklearn import datasets
class Dataset:
def __init__(self, mode='train'):
self.iris = datasets.load_iris()
self.mode = mode
pass
def getInputs(self):
inputs = self.iris.data
if self.mode == 'train':
return inputs[::2] #I use every even recor... | StrangeAlex/Neural-network-python | Project A/datasetPreparation.py | datasetPreparation.py | py | 1,045 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "sklearn.datasets.load_iris",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sklearn.datasets",
"line_number": 6,
"usage_type": "name"
}
] |
74097204534 | import os
import json
import subprocess
import conf
import check_series
import write_data as wd
linux_src = conf.LINUX_SRC
list_jobs = './jobs.txt'
res_loc = conf.BUILD_DIR + '../results/'
list_done = res_loc + 'done.json'
if not os.path.isdir(res_loc):
os.makedirs(res_loc)
def read_tags(fname):
f = open(fna... | FYNQ/PIT | src/python/gen_report.py | gen_report.py | py | 1,735 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "conf.LINUX_SRC",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "conf.BUILD_DIR",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "os.path.isdir",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path",
"l... |
73346361011 | import Models.kernelFunctions as kernelFunctions
import numpy as np
from datetime import datetime
import pickle
import time
class KernelPerceptron():
def __init__(self, class_label, kernel, hyperparameters=None):
self.kernel = kernel
self.class_label = class_label
self.hyperparameters = hyp... | simonEllershaw/KernelPerceptron | Models/kernelPerceptron.py | kernelPerceptron.py | py | 4,310 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "numpy.zeros",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "Models.kernelFunctions.calc_kernel_matrix",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "Models.kernelFunctions",
"line_number": 26,
"usage_type": "name"
},
{
"api_... |
30243662237 | __author__ = 'artanis'
import os
import sys
import tables
import cv2
import numpy as N
from math import floor, ceil, log
from scipy.ndimage.morphology import distance_transform_edt
from .BaseStructuredForests import BaseStructuredForests
from .RandomForests import RandomForests
from .RobustPCA import robust_pca
from .... | nameless-Chatoyant/Flow-Estimation | Flow-Estimation/models/InterpoNet/SED/StructuredForests.py | StructuredForests.py | py | 5,834 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pyximport.install",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.get_include",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "BaseStructuredForests.BaseStructuredForests",
"line_number": 21,
"usage_type": "name"
},
{
"a... |
27226394233 | # This module contains functions for registering changes of properties and context within Blender to trigger updates of properties in this add-on.
import bpy
from ..core import material_layers
from ..core import layer_masks
from ..core import mesh_map_baking
from ..core import debug_logging
#------------------------... | LoganFairbairn/matlayer | core/subscription_update_handler.py | subscription_update_handler.py | py | 7,985 | python | en | code | 66 | github-code | 21 | [
{
"api_name": "bpy.types",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "bpy.msgbus.clear_by_owner",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "bpy.msgbus",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "bpy.types",
... |
26956162218 | import numpy as np
import cv2
import math
import utils
SYMLEN = 30
SYMNUM = 16
def genpos(radius,scale,theta = 0):
sympos = list(map(lambda x: (
radius * math.cos(x * np.pi / SYMLEN + theta),
radius * math.sin(x * np.pi / SYMLEN + theta)
),range(SYMLEN)))
sympos += list(map(lambda x: (... | lsc36/wn-15spring | final/draftcode/fft.py | fft.py | py | 4,090 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "math.cos",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.pi",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "math.sin",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.pi",
"line_number": 12,
... |
41377537357 | import cv2
import numpy as np
"""
REFER: https://hub.packtpub.com/opencv-detecting-edges-lines-shapes/
"""
def draw_contours(img, cnts): # conts = contours
img = np.copy(img)
img = cv2.drawContours(img, cnts, -1, (0, 255, 0), 2)
return img
def draw_min_rect_circle(img, cnts): # conts = contours
i... | hzt314/butterfly_project | contour_extraction_demo.py | contour_extraction_demo.py | py | 3,285 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "numpy.copy",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "cv2.drawContours",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.copy",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "cv2.boundingRect",
"line_n... |
18153599896 | import pygame, sys , random
#creat 2 floor and make a continue move at the bottom
def draw_floor():
screen.blit(floor_surface,(floor_x_pos,800))
screen.blit(floor_surface,(floor_x_pos + 576,800))
def create_pipe():
random_pipe_pos = random.choice(pipe_height)
bottom_pipe = pipe_surface.get_rect(... | GerryChai/python | FlapBird_Python/FBird.py | FBird.py | py | 6,637 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "random.choice",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pygame.transform.flip",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "pygame.transform",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "pygame.tran... |
74828231091 | import os
import time
import unittest
import ament_index_python
import launch
import launch.actions
import launch_testing
import launch_testing.actions
from launch_testing.asserts import assertSequentialStdout
from launch_ros.actions import Node
import pytest
import rclpy
import yaml
config_bridge = os.path.join(... | PLCnext/PLCnext-ROS-bridge | phoenix_bridge/test/launch_test_bridge.test.py | launch_test_bridge.test.py | py | 2,607 | python | en | code | 6 | github-code | 21 | [
{
"api_name": "os.path.join",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "ament_index_python.get_package_prefix",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "launc... |
71126907892 | """Simple extraction of afqmc rdms."""
import h5py
import numpy
import scipy.stats
def extract_qmc_dm(filename, dm_name='Mixed'):
"""Extract AFQMC 1RDM from file.
Parameters
----------
filename : string
QMCPACK output containing density matrix (*.h5 file).
dm_name: string
Estimator... | QMCPACK/qmcpack | utils/afqmctools/afqmctools/analysis/new_rdm.py | new_rdm.py | py | 6,714 | python | en | code | 261 | github-code | 21 | [
{
"api_name": "h5py.File",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "numpy.complex128",
"line_number": 33,
"usage_type": "attribute"
},
{
"api_name": "numpy.complex128",
"line_number": 36,
"usage_type": "attribute"
},
{
"api_name": "numpy.array",
... |
23735298786 | import requests
import os
from requests_toolbelt.multipart.encoder import MultipartEncoder
class PetFriends:
def __init__(self):
self.base_url = "https://petfriends.skillfactory.ru/"
def get_api_key(self, email, password):
headers = {
'email': email,
'password': passwo... | HelenHausser/PetFrinds | api.py | api.py | py | 3,155 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "requests.get",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "os.path.abspath",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number"... |
2724295207 | import numpy
import logging
import optparse
import time
import pickle
from collections import OrderedDict
import theano
import theano.tensor as T
from theano.sandbox.rng_mrg import MRG_RandomStreams as RandomStreams
from pylearn2.utils import serial
from pylearn2.datasets import mnist
floatX = theano.config.floatX
lo... | gdesjardins/MFNG | scripts/likelihood/ais.py | ais.py | py | 15,156 | python | en | code | 5 | github-code | 21 | [
{
"api_name": "theano.config",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "logging.basicConfig",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "theano.tenso... |
9787944771 | """
Shorting Product(Ürün sıralaması)
- Sorting by Rating
- Sorting by Comment Count or Purchase Count
- Sorting by Rating, Comment and Purchase Count
- Sorthing by Bayesian Average Rating Score (Sorting Product with 5 Star Rated)
- Hybrid Sorting: BAR_SCORE + Diğer faktörler
Mesela: Bir mülakat sürecimiz olsun, bu sü... | busranurok/MeasurementProblems | OlcumlemeProblemleri/urun_siralama.py | urun_siralama.py | py | 8,912 | python | tr | code | 0 | github-code | 21 | [
{
"api_name": "pandas.set_option",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "pandas.set_option",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "pandas.set_option",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "pandas.set_opti... |
15127096950 | #!/usr/bin/env python3
"""
caffeine -- A Budgie applet to toggle screen dimming temporarily.
"""
import gi.repository
gi.require_version('Budgie', '1.0')
gi.require_version('Wnck', '3.0')
from gi.repository import Budgie, GObject, Gtk, Gio
class CaffeinePlugin(GObject.GObject, Budgie.Plugin):
""" A wrapper for ... | jonathan-j-lee/budgie-applet-extra | caffeine/caffeine.py | caffeine.py | py | 3,330 | python | en | code | 4 | github-code | 21 | [
{
"api_name": "gi.repository.require_version",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "gi.repository",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "gi.repository.require_version",
"line_number": 9,
"usage_type": "call"
},
{
"api_name":... |
3462858917 | import gi
try:
gi.require_version('Gtk', '3.0')
except Exception as e:
print(e)
exit(1)
from gi.repository import Gtk
from .configurator import Configuration
from . import comun
from .comun import _
class PreferencesDialog(Gtk.Dialog):
"""docstring for PreferencesDialog"""
def __init__(self, windo... | atareao/yoaup | src/yoaup/preferencesdialog.py | preferencesdialog.py | py | 2,668 | python | en | code | 16 | github-code | 21 | [
{
"api_name": "gi.require_version",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "gi.repository.Gtk.Dialog",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "gi.repository.Gtk",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "gi.... |
27088512819 | """Formatted output of a .nc file.
This script takes in as input with the `-i` `--input` flag a `.nc` file
and by default truncates the output if a lot of data exist,
so the most important information is presented.
The flag `-l` `--long` will override the truncation and print a long
output with all information contai... | engeir/ncdump-rich | src/ncdump_rich/ncdump.py | ncdump.py | py | 6,436 | python | en | code | 3 | github-code | 21 | [
{
"api_name": "netCDF4.Dataset",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "rich.console.Console",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "rich.console.Console",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "textwrap.fi... |
4627125973 | import copy
from logging import getLogger
import multiprocessing as mp
import chainer
from chainer import functions as F
import numpy as np
from chainerrl.agent import AsyncAgent
from chainerrl.agent import AttributeSavingMixin
from chainerrl.misc import async_
from chainerrl.misc.batch_states import batch_states
fro... | chainer/chainerrl | chainerrl/agents/nsq.py | nsq.py | py | 6,636 | python | en | code | 1,134 | github-code | 21 | [
{
"api_name": "chainerrl.agent.AttributeSavingMixin",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "chainerrl.agent.AsyncAgent",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "logging.getLogger",
"line_number": 43,
"usage_type": "call"
},
{
... |
39903452324 | import datetime
import time
from typing import Dict, List, Tuple
import casymda.visualization.state_icons.state_icons_pathfinder as state_icon_pathfinder
from casymda.blocks.block_components import VisualizableBlock
from casymda.blocks.block_components.state import States
from casymda.blocks.block_components.visualize... | fladdimir/casymda | src/casymda/visualization/process_visualizer.py | process_visualizer.py | py | 8,512 | python | en | code | 39 | github-code | 21 | [
{
"api_name": "casymda.visualization.entity_visualizer.EntityVisualizer",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "casymda.blocks.block_components.visualizer_interface.BlockVisualizer",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "casymda.visualizati... |
29983154566 | import torch
import numpy as np
from torch.utils.data import DataLoader, Dataset
from argparse import ArgumentParser
__all__ = ['BaseDataset', 'collate_fn', 'print_data_structure', 'add_base_dataset_args']
def collate_fn(data):
"""
collate data points as a batch.
"""
xs = [item["x_source"] for item i... | wutong8023/CoLL | coll/dataset/base_dataset.py | base_dataset.py | py | 4,374 | python | en | code | 8 | github-code | 21 | [
{
"api_name": "torch.cat",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "torch.cat",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "torch.cat",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "torch.cat",
"line_number": 20,
... |
10322549991 | # This is a template for a Python scraper on morph.io (https://morph.io)
# including some code snippets below that you should find helpful
import scraperwiki
from bs4 import BeautifulSoup
import json
# import lxml.html
#
# # Read in a page
result = {}
html = scraperwiki.scrape("http://www.gat.no/nyheter/tok-ni-for-fa... | torhagl/doin_the_do_on_gat | scraper.py | scraper.py | py | 1,962 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "scraperwiki.scrape",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "scraperwiki.sqlite.sa... |
18404426259 | import itertools; import math; import operator; import random; from bisect import *; from collections import deque, defaultdict, Counter, OrderedDict; from heapq import *; import unittest; from typing import List;
def get_sol(): return Solution()
class Solution:
def alertNames(self, keyName: List[str], keyTime: Lis... | afzalsiddique/problem-solving | Problem_Solving_Python/leetcode/lc1604.py | lc1604.py | py | 2,649 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "typing.List",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "collections.defaultdict",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "unittest.TestCase",
... |
2920116361 | # -*- coding: utf-8 -*-
"""
Created on Sat Nov 30 23:33:04 2019
@author: fany
"""
import json
from BerryField import berryfield
from Bear import bear
from Tourist import tourist
if __name__ == "__main__":
file = input('Enter the json file name for the simulation => ')
print(file)
print()
... | IANFAN9976/Python | hw8_part2.py | hw8_part2.py | py | 5,610 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "json.loads",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "BerryField.berryfield",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "Bear.bear",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "Tourist.tourist",
"lin... |
40127470057 | """empty message
Revision ID: ff6127b7e211
Revises: effb0b0d6e97
Create Date: 2022-01-18 18:53:10.452421
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'ff6127b7e211'
down_revision = 'effb0b0d6e97'
branch_labels = None
depends_on = None
def upgrade():
# ... | royalsaltmerchant/salt_server | migrations/versions/ff6127b7e211_.py | ff6127b7e211_.py | py | 795 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "alembic.op.add_column",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Integer... |
22808956847 | from __future__ import print_function
import cv2 as cv, cv2
import argparse
import imutils
import numpy as np
from imutils.video import FPS
from pythonosc import udp_client
max_value = 255
low_H = 217
high_H = max_value
cal_x = 0
cal_y = 0
window_capture_name = 'Video Capture'
window_detection_name = 'Object Detect... | damiannogueiras/Detection | canny.py | canny.py | py | 7,059 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "cv2.setTrackbarPos",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "cv2.setTrackbarPos",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "cv2.Vid... |
30212014476 | from util import *
from models_v2 import *
import torch
torch.backends.cuda.matmul.allow_tf32 = True
torch.backends.cudnn.allow_tf32 = True
batch_size = 16
latent_size = 512
input_channels = 13
output_channels = 7
resolution = 8
device = torch.device('cuda:0' if torch.cuda.is_available() else 'cpu')
x = (torch.ones(ba... | brian-loos/Intership-Projects | styleGAN/test.py | test.py | py | 1,245 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "torch.backends",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "torch.backends",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "torch.device",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "torch.cuda.is_avai... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.