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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
17812259102 |
# coding: utf-8
# In[48]:
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
df = pd.read_table('realdata.txt')
#print(df.info)
data = np.array(df)
i = 0
X = np.array(df)
colors = 10 * ["y", "g", "b", "r"]
new_data = np.array(df)
# Plotting Original Data
for x in X:
new_data[i][0] = x[1]
... | arpitg1304/Artificial-Intelligence | KMeans.py | KMeans.py | py | 3,188 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pandas.read_table",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_num... |
22884751807 | import os
import cv2
import numpy as np
import os
from skimage.metrics import peak_signal_noise_ratio
from skimage.metrics import structural_similarity
import math
from PIL import Image
PATH = "gallary/eval_gallary/cost_spn_epoch2"
DRANGE = 2 ** 16 / 4000.0
def psnr(img1, img2):
mse = np.mean( (img1 - img2) ** 2 ... | qilinsun/CUHKSZ-Depth-Complete-RGBD- | data_preparation/test_mp.py | test_mp.py | py | 3,655 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "numpy.mean",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "math.log10",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "math.sqrt",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.mean",
"line_number": 21,
... |
71627373025 | from docx import Document
from docx.shared import Inches
import pandas as pd
import numpy as np
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from docx.enum.text import WD_ALIGN_PARAGRAPH
import os, glob
import os
from freq import *
from django.conf import settings
from django.core.files.stora... | jolarteu/DRIVETEST | map.py | map.py | py | 6,440 | python | es | code | 0 | github-code | 7 | [
{
"api_name": "matplotlib.use",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.conf.settings.STATIC_ROOT",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "django.conf.settings",
"line_number": 20,
"usage_type": "name"
},
{
"api_name... |
73984493982 | import os,glob
import wave
import numpy as np
from pydub import AudioSegment
file_path = "/home/gaoxiang/noise"
wav_file=glob.glob(os.path.join(file_path,"*.wav"))
wav_file.sort()
for wav in wav_file:
print(wav)
index=0
f=wave.open(wav,'rb')
params=f.getparams()
n_channels, samp_width, frame_rate, ... | gaoxiang45/wavPro | wavCut.py | wavCut.py | py | 653 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "glob.glob",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "wave.open",
"line_number": 12,
... |
70001092064 | from OpenGL.GL import *
import numpy as np
import glm
import sys;
import glfw
from pathlib import Path
class Shader:
def __init__(self, source, shader_type):
self._handle = glCreateShader(shader_type)
glShaderSource(self._handle, source)
glCompileShader(self._handle)
# check if compilation was successful
... | zalavariandris/editor | render/gloo/program.py | program.py | py | 3,653 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "sys.exit",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 75,
"usage_type": "call"
},
{
"api_name": "numpy.ndarray",
"line_number": 99,
... |
30084246286 | import couchdb
URL='http://localhost:5984'
DBNAME = 'tenant-data-despeelberg-childattendance'
server = couchdb.Server(URL)
db = server[DBNAME]
v1 = db.view('_design/childattendance/_view/all')
for row in v1.rows:
print(row.id)
doc = db[row.id]
if doc['kind'] == 'type/childattendance/v1':
print('... | inschrijven-cloud/couchdb-migrations | childattendance_v1_to_v2.py | childattendance_v1_to_v2.py | py | 634 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "couchdb.Server",
"line_number": 6,
"usage_type": "call"
}
] |
45509723195 | import pkg_resources
import sqlite3
import urllib
import gzip
import bz2
import logging
import sys
import os
import tempfile
from zipfile import ZipFile
from setuptools import setup
from setuptools.command.develop import develop
from setuptools.command.install import install
wof_data = "https://data.geocode.earth/wof/... | bgmartins/gazetteer-access | setup.py | setup.py | py | 3,511 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "logging.basicConfig",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "sys.stderr",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "logging.INFO",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogg... |
14386000721 | from decouple import config
import requests
from .models import River
def getLocationFromRequest(request):
longitute = request.query_params.get('longitude')
latitude = request.query_params.get('latitude')
return [latitude,longitute]
def getLocationPointFromGoogleApi(request):
request_url = "https://m... | tunjing998/CCCMI-TCA2 | Aquality_Two_Backend_Server/aquality_server/filter.py | filter.py | py | 1,685 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "decouple.config",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "models.River.objects.raw",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "models.River.ob... |
5380136327 | from sqlite3 import paramstyle
import discord
from discord.ext import commands
from discord import app_commands
import requests
import json
class Weather(commands.Cog):
bot = None
openweathermap_api_key: str = None
def _init_(self, bot):
self.bot = bot
def load_api_key_from_secrets(self) -... | Insilvon/CrowesAlley | cogs/weather.py | weather.py | py | 3,300 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "discord.ext.commands.Cog",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "discord.ext.commands",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "json.load",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "discord.... |
13095344251 | import redis
import datetime
UNVOTED = "unvoted_question_list"
QUESTION_SET = "question_set"
SCORED_QUESTION_SET = "scored_question_set"
MAX_UNVOTED_QUESTIONS = 100
def connect(host='localhost', port=6379, db=0):
return redis.StrictRedis(host, port, db)
def _next_id(connection):
return connection.incr("question_... | fourcube/gf-db-wrapper | db.py | db.py | py | 1,792 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "redis.StrictRedis",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 29,
"usage_type": "attribute"
}
] |
36377224213 | import requests
from dotenv import dotenv_values
import json
import glob
def get_numpy_doc_version(inPath: str) -> str:
"""
Gets the online numpy documentation version number accessible from inPath
Returns the version as a vx.xx string
"""
r = requests.get(inPath)
docVersion = r.text.split("... | guime7000/OneNoticeADay | src/Tools/oneNoticeTools.py | oneNoticeTools.py | py | 2,026 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "requests.get",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "glob.glob",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "dotenv.dotenv_values",
"line_number": 58,
"usage_type": "call"
}
] |
37604536655 | """Tests for attrs_utils."""
from typing import Any
import attrs
import numpy as np
from vizier.utils import attrs_utils
from absl.testing import absltest
from absl.testing import parameterized
class ValidatorsTest(parameterized.TestCase):
@parameterized.parameters(
(attrs_utils.assert_not_empty, [], Fals... | apollo65524532/CFU-Playground | third_party/python/vizier/vizier/utils/attrs_utils_test.py | attrs_utils_test.py | py | 2,130 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "absl.testing.parameterized.TestCase",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "absl.testing.parameterized",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "typing.Any",
"line_number": 24,
"usage_type": "name"
},
{
"ap... |
36737391007 | import traitlets.config as tlc
from collections import OrderedDict
import numpy as np
from typing import List, Union, Dict, Callable, Tuple, Optional, Any
import traitlets as tl
class Marker:
def __init__(self, pids: np.ndarray, cid: int ):
self.cid = cid
self.pids = np.unique( pids )
def isT... | nasa-nccs-cds/astrolab | astrolab/model/base.py | base.py | py | 2,717 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "numpy.ndarray",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "numpy.unique",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.ndarray",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "numpy.setdiff1d",
... |
39715444274 | from exceptions import OGCException, ServerConfigurationError
from mapnik import Map, Color, Envelope, render, Image, Layer, Style, Projection as MapnikProjection, Coord
from PIL.Image import new
from PIL.ImageDraw import Draw
from StringIO import StringIO
from copy import deepcopy
from traceback import format_exceptio... | roel-v/php_mapnik | mapnik-0.7.1/bindings/python/mapnik/ogcserver/common.py | common.py | py | 21,802 | python | en | code | 7 | github-code | 7 | [
{
"api_name": "exceptions.ServerConfigurationError",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "exceptions.ServerConfigurationError",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "exceptions.ServerConfigurationError",
"line_number": 61,
"usage_t... |
15387154214 | import json
import uuid
from typing import Dict, Tuple, Iterator
from django.conf import settings
from django.utils import timezone
from app_root.servers.models import RunVersion
from app_root.utils import get_curr_server_str_datetime_ms
from core.requests_helper import CrawlingHelper
from core.utils import Logger, c... | Gaolious/analysis-ts2-strategy | ts/app_root/mixins.py | mixins.py | py | 6,337 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "app_root.servers.models.RunVersion",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "app_root.servers.models.RunVersion",
"line_number": 37,
"usage_type": "name"
},
{
"api_name": "json.dumps",
"line_number": 43,
"usage_type": "call"
},
{
"... |
71164946783 | from selenium import webdriver
from selenium.webdriver.common.by import By
import cv2
import time
import os
from time import sleep
import smtplib
import ssl
from email.message import EmailMessage
import datetime
PATH="./chromedriver"
MAX_TRYS=10
# For saving captchas for training
dst_data="/media/asad/8800F79D00F79104... | Asad-Ismail/CaptchaRecognition | automated_captcha.py | automated_captcha.py | py | 4,016 | python | en | code | 3 | github-code | 7 | [
{
"api_name": "email.message.EmailMessage",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "ssl.create_default_context",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "smtplib.SMTP_SSL",
"line_number": 37,
"usage_type": "call"
},
{
"api_name":... |
15011232097 | import requests
from bs4 import BeautifulSoup
import csv
# Define the SteamDB Deals URL
steamdb_deals_url = 'https://steamdb.info/sales/'
# Send an HTTP GET request to the SteamDB Deals page
response = requests.get(steamdb_deals_url)
# Parse the HTML content
soup = BeautifulSoup(response.content, 'html.parser')
# F... | hwiseph/steamdealtracker | steamdealtracker.py | steamdealtracker.py | py | 1,826 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "requests.get",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "csv.DictWriter",
"line_number": 44,
"usage_type": "call"
}
] |
41203439292 | #!/usr/bin/env python
# coding: utf-8
# In[71]:
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
get_ipython().run_line_magic('matplotlib', 'inline')
# ## Uploading the data
# In[72]:
train_data=pd.read_csv(r"C:\Users\meena\Downloads\illegal_fishing_trn_data.csv")
tes... | ShubhaM7112/Classification-of-Illegal-Fishing | shubham_meena_code.py | shubham_meena_code.py | py | 7,354 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pandas.read_csv",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.fig... |
37635980216 | #!/usr/bin/env python
"""
ffdas.py
FFDAS preprocessing Python module
C. Martin - 3/2016
"""
import numpy as np
import sys, time
from netCDF4 import Dataset
def prep(infile,outfile):
"""
Function to preprocess FFDAS netCDF files
Converts from 24 hourly variables to one
flux variable varying in t dimension
"""... | IAP-spook/WRF-CO2 | src/wrfco2-python/wrfco2/ffdas.py | ffdas.py | py | 2,000 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "netCDF4.Dataset",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "netCDF4.Dataset",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_... |
38544810023 | from django.shortcuts import render
from django.views.generic import View
from goods.models import GoodsType, GoodsSKU, IndexGoodsBanner,IndexPromotionBanner,IndexTypeGoodsBanner
from django_redis import get_redis_connection
class IndexView(View):
def get(self, request):
'''显示首页'''
# 获取商品的种类信息
... | Removechroot/DjangoDemo | apps/goods/views.py | views.py | py | 1,769 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "django.views.generic.View",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "goods.models.GoodsType.objects.all",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "goods.models.GoodsType.objects",
"line_number": 9,
"usage_type": "attribute"
... |
11096311009 | # ----------------------------------------------------------------------------------------------------------------
# This program evaluates data stored a Stelar Data File (a sdf-file) into magnetization relaxation functions and
# then calls one of the parameterization routines: logmoments(), lmfit_kohlrausch(), or lmf... | cretudorin/LogarithmicMomentAnalysis | python_modules/evaluate_sdf.py | evaluate_sdf.py | py | 14,094 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 37,
"usage_type": "attribute"
},
{
"api_name": "os.getcwd",
"li... |
27113076669 | import matplotlib.cbook as mplbook
import matplotlib as mpl
import matplotlib.gridspec as gridspec
import matplotlib.pyplot as plt
import matplotlib.figure as fig
import matplotlib.cm as cm
import matplotlib.colors as colors
from mpl_toolkits import axes_grid1
from mpl_toolkits.mplot3d import Axes3D
# from mpl_tool... | trashpirate/py-research | py_research/plotting.py | plotting.py | py | 8,394 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "matplotlib.cbook.mplDeprecation",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.cbook",
"line_number": 29,
"usage_type": "name"
},
{
"api... |
1638217299 |
from main import settings
import requests
class Scrapper():
def __init__(self, site='yts', limit=2):
self.site = site
self.limit = limit
def get_torrents(self, name):
torrents = requests.request(
"GET", settings.TORRENT_SCRAPPER_URL + f"/api/v1/search?site={self.site... | Ermite28/torrent_handler | api/backend/apis/torrent_handler/scraping.py | scraping.py | py | 611 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "requests.request",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "main.settings.TORRENT_SCRAPPER_URL",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "main.settings",
"line_number": 13,
"usage_type": "name"
}
] |
14560116410 | import cv2
import fb_stitcher.config as config
from logging import getLogger
import math
import numpy as np
import os
import re
log = getLogger(__name__)
def lowe_ratio_test(matches, ratio=0.75):
"""Execute Lowe's ration test."""
good_matches = []
for m in matches:
if len(m) == 2 and m[0].distanc... | BioroboticsLab/bb_fb_stitcher | fb_stitcher/helpers.py | helpers.py | py | 7,063 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "logging.getLogger",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.float32",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "numpy.float32",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "fb_stitcher.config.SHIFT... |
29761338625 | import rdflib
def convertGraphToRDF(fileName):
graphFile = open(fileName, 'r')
graphFile.readline().split()
bNodeHash = {}
graph = rdflib.Graph()
for line in graphFile:
tripel = line.split()
tsubject = "_:" + tripel[1]
if(tsubject not in bNodeHash):
bNodeHash[ts... | Simaris/Atomic-Graph | benchmarks/graphconverter.py | graphconverter.py | py | 700 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "rdflib.Graph",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "rdflib.BNode",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "rdflib.URIRef",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "rdflib.BNode",
"line_numbe... |
19162281384 | from tkinter import *
from PIL import Image, ImageTk, ImageFont, ImageDraw
from tkinter import filedialog, simpledialog, messagebox
BACKGROUND_COLOR = "#303030"
FONT = ("Cantarell", 14, "normal")
def get_image():
global new_image, image, img_type, img_path
img_path = filedialog.askopenfilename()
img_file... | luiz26lcs/watermarker | main.py | main.py | py | 4,479 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "tkinter.filedialog.askopenfilename",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "tkinter.filedialog",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "PIL.Image.open",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "... |
7278740962 | """ Methods for local MIDI transmission and reception. """
__author__ = 'John Fu, 2014.'
import rtmidi
class LocalMidi:
def __init__(self):
self.ON_OFF = 'Note ON/OFF'
self.ON = 'Note ON'
self.OFF = 'Note OFF'
self.C_CHG = 'Control Change'
self.SUS = 'Sustain'
self... | Pikafu/duo-list | MidiHandler/KeyboardMidi.py | KeyboardMidi.py | py | 3,007 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "rtmidi.MidiOut",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "rtmidi.MidiIn",
"line_number": 29,
"usage_type": "call"
}
] |
20544632125 | from scipy import spatial
import operator
from tqdm import tqdm
from collections import Counter
from database import get_cursor, get_records
import pandas as pd
import numpy as np
def compute_dist(a, b, mode="item_based"):
if mode=="item_based":
genresA = a[1]
genresB = b[1]
genreDistance =... | signofthefour/knn_user_based_movies_rec | new_user_update.py | new_user_update.py | py | 8,028 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "scipy.spatial.distance.cosine",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "scipy.spatial.distance",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "scipy.spatial",
"line_number": 13,
"usage_type": "name"
},
{
"api_name"... |
4347014865 | import requests
import json
import urllib.request
from appscript import app, mactypes
def main():
response = requests.get(
"https://www.bing.com/HPImageArchive.aspx?format=js&idx=0&n=1&mkt=en-IN"
)
todos = json.loads(response.text)
baseurl = "https://www.bing.com"
url = baseurl + todos["im... | theutkarshjaiswal/Bing-wallpaper | index.py | index.py | py | 499 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "requests.get",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "urllib.request.request.urlretrieve",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "urllib.requ... |
42078063150 | import pandas as pd
import shapely.geometry
from ast import literal_eval
import xarray as xr
import tracpy
import matplotlib.pyplot as plt
import cartopy
from cartopy.mpl.gridliner import LONGITUDE_FORMATTER, LATITUDE_FORMATTER
import cmocean.cm as cmo
import matplotlib as mpl
import numpy as np
loc = 'http://terrebon... | kthyng/oem | plots.py | plots.py | py | 3,099 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "xarray.open_dataset",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "tracpy.tools.make_proj",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "tracpy.tools",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "tracpy.i... |
13053692291 | import os
import torch
import torch.nn as nn
import torch.optim
import torch.utils.data
import torchvision
import torchvision.transforms as transforms
import torchvision.datasets as datasets
from models.alexnet import our_alexnet
from util.utils import LogWriter, CIFAR10_MEAN, CIFAR10_STD
import socket
import numpy a... | Nebularaid2000/bottleneck | util/train_util.py | train_util.py | py | 4,562 | python | en | code | 35 | github-code | 7 | [
{
"api_name": "matplotlib.use",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path.basename",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "util.utils.LogWriter",
... |
18844393328 | import asyncio
from enum import Enum
from typing import Optional, AsyncGenerator
from ..nonebot_plugin_saa import MessageFactory, Text, Image
from pydantic import BaseModel
from ..type_store.web_config import common_config
from ..utils.pastebin import get_url
from ..utils.render import md_to_pic
from ..type_store.msg... | canxin121/Spark-GPT | nonebot_plugin_spark_gpt/chatbots/BaseChatBot.py | BaseChatBot.py | py | 4,304 | python | en | code | 62 | github-code | 7 | [
{
"api_name": "enum.Enum",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "pydantic.BaseModel",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "pydantic.BaseModel",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
... |
32171336675 | #!/usr/bin/env python
# coding: utf-8
import math, sys, time, argparse
import mirscanIO as msio
def train(forefile, backfile, criteriafile):
"""
For each criteria defined in criteriafile, for each possible output value,
a score is determined which is the base 2 log of the ratio of the frequency
of tha... | pkpinto/MiRscan4 | mirscanTrainer.py | mirscanTrainer.py | py | 5,061 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "mirscanIO.parse_fam",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "mirscanIO.parse_query",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "mirscanIO.parse_criteria",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "ti... |
2047847663 | import cherrypy
import json
import redis
import uuid
from redis.commands.json.path import Path
REDIS_HOST = "redis-18937.c72.eu-west-1-2.ec2.cloud.redislabs.com"
REDIS_PORT = 18937
REDIS_USER = "default"
REDIS_PASSWORD = "DlfmUPWr2iMKAbzvEiwzLCizwt2yjLkP"
# Connect to Redis server
redis_client = redis.Redis(host=RED... | dadodimauro/ML4IoT | lab05/lab5_ex4.1.py | lab5_ex4.1.py | py | 5,076 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "redis.Redis",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 75,
"usage_type": "call"
},
{
"api_name": "uuid.uuid4",
"line_number": 80,... |
41564743901 | from matplotlib.mlab import PCA
import matplotlib.pyplot as plt
import numpy as np
# Constants
DATA_LOC = "./"
PLOT_LOC = "./plots/"
def main():
data = load_data("data.txt")
data = np.array(data)
# Labels (every 1000 samples): 1, 3, 4, 7, 8, 9
# scale data with 0 mean
mu = data.mean(axis=0)
data = np.subtr... | gilmanjo/CS434 | assignment_4/pca.py | pca.py | py | 1,685 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "numpy.array",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.subtract",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.cov",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.linalg.eig",
"line_num... |
72869666462 | import typing
import fvcore
from fvcore.nn import activation_count, flop_count, parameter_count, parameter_count_table
from torch import nn
from detectron2.export import TracingAdapter
__all__ = [
"activation_count_operators",
"flop_count_operators",
"parameter_count_table",
"parameter_count",
"Fl... | Ascend/ModelZoo-PyTorch | PyTorch/dev/cv/image_classification/SlowFast_ID0646_for_PyTorch/detectron2/detectron2/utils/analysis.py | analysis.py | py | 5,038 | python | en | code | 31 | github-code | 7 | [
{
"api_name": "fvcore.nn",
"line_number": 50,
"usage_type": "attribute"
},
{
"api_name": "detectron2.export.TracingAdapter",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "torch.nn.Module",
"line_number": 66,
"usage_type": "attribute"
},
{
"api_name": "... |
12052390810 | import numpy as np
import matplotlib as mpl
mpl.use("TkAgg")
from matplotlib import pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.animation as animmation
"""
比iridiumConstellation2.py多了和左右卫星动态连接的过程
"""
def update(time):
global satellite, text, figure, line
for i in range(len(positio... | clearloveu/LEO_Mobility_NS-3 | helper/iridiumConstellation2-connection.py | iridiumConstellation2-connection.py | py | 7,932 | python | en | code | 10 | github-code | 7 | [
{
"api_name": "matplotlib.use",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "numpy.pi",
"line_number": 158,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 162,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyp... |
5496753301 | import torch.nn as nn
from ._partial_modules import *
from ops.partial_linear import PartialLinear
__all__ = [
'AutoEncoder',
'PartialAutoEncoder',
]
class AutoEncoder(nn.Module):
def __init__(self, in_channels, out_channels, num_joints=17, dropout=0.05):
super(AutoEncoder, self).__init__()
... | inspiros/nhat_challenge_2022 | models/ae.py | ae.py | py | 1,869 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "torch.nn.Module",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "torch.nn.Sequential",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"lin... |
32823739596 | import sys
import traceback
import logging
import uuid
import urllib
import datetime
import time
sys.path.insert(0, 'lib')
try:
import json
except ImportError:
import simplejson as json
import iso8601
from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app
from google... | sampsyo/alwaysreading2 | ar2.py | ar2.py | py | 8,981 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "sys.path.insert",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "datetime.datetime.fromtimestamp",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "datetime.... |
43245679167 | import shutil
from jaguar_backend.file import File
import os
from pathlib import Path
test_file = "test_file.txt"
json_test_file = "test_file.json"
try:
shutil.rmtree(test_file)
shutil.rmtree(json_test_file)
except FileNotFoundError:
pass
if __name__ == "__main__":
file = File(Path(test_file))
fi... | kesler20/jaguar_backend | tests/manual_test_file.py | manual_test_file.py | py | 823 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "shutil.rmtree",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "shutil.rmtree",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "jaguar_backend.file.File",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
... |
69976260382 | # -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html
import json
import os
import os.path
import urlparse
import urlparse
from scrapy import log
from scrapy.conf import settings
... | rcbuild-info/scrape | rcbi/rcbi/pipelines.py | pipelines.py | py | 4,419 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "os.path.realpath",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number... |
71187219425 | import os
from typing import ClassVar
import sqlalchemy as sa
from sqlalchemy.future import Engine, Connection
from . import model
def get_engine_url(default_url: str = None) -> str:
url = os.getenv("DATABASE_URL", default_url or "postgresql://localhost:5432/stv")
if not url:
raise ValueError("Datab... | clickonetwo/stv-services | stv_services/data_store/postgres_db.py | postgres_db.py | py | 1,588 | python | en | code | 3 | github-code | 7 | [
{
"api_name": "os.getenv",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "typing.ClassVar",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.future.Engine",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.create_... |
27121152110 | from django.conf.urls.static import static
from django.urls import path
from exam9_project import settings
from webapp.views.pictures import (
IndexView,
PictureView,
PictureCreateView,
PictureUpdateView,
PictureDeleteView, LinkGenerationView
)
from webapp.views.albums import (
AlbumDetailView... | mtashtanovski/Exam_9_project | source/webapp/urls.py | urls.py | py | 1,283 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "django.urls.path",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "webapp.views.pictures.IndexView.as_view",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "webapp.views.pictures.IndexView",
"line_number": 23,
"usage_type": "name"
},
... |
7307464928 | import redis
import sqlite3
import json
global found
# Connecting to database
conn = sqlite3.connect('Retailer.db')
conn.row_factory = sqlite3.Row
cursor = conn.cursor()
retailer = redis.Redis(host='localhost', port=6379, db=0)
retailer = retailer.pubsub()
retailer.subscribe('dwatson_f10-delayed')
retailer.subscribe(... | palwashakmalik/testingsample | Backend/retailer_pubsub_server.py | retailer_pubsub_server.py | py | 3,212 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "sqlite3.connect",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sqlite3.Row",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "redis.Redis",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_num... |
22662721892 | from os.path import dirname, join
from itertools import chain
from collections import Counter
from corpustools import extract_fields, ngrams
from corpustools.language_model import LanguageModel
top = join(dirname(__file__), "data")
DUMMY_CORPUS = join(top, "dummy_corpus.txt")
DUMMY_SPECS = {"tag_field": 2,... | kuchenrolle/corpustools | tests/test_language_model.py | test_language_model.py | py | 3,234 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "os.path.join",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "corpustools.extract_fields",
... |
23613346464 | #!/usr/bin/python3
import getopt
import os
import requests
import sys
import json
import time
from pyFMG import fortimgr
from tabulate import tabulate
def check(result):
if result[0] != 0:
raise TypeError('Status Code=' + str(result[1]['status']['code']) + ' Message=' + str(result[1]['status']['message'])... | nidica/monitor_ftnt | monitor_fmg_sdwan.py | monitor_fmg_sdwan.py | py | 13,292 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "sys.argv",
"line_number": 51,
"usage_type": "attribute"
},
{
"api_name": "getopt.getopt",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 55,
"usage_type": "attribute"
},
{
"api_name": "getopt.GetoptError",
"l... |
31178145485 | # -*- coding: utf-8 -*-
"""
Created on Tue Feb 19 13:05:56 2019
@author: RaeChen
"""
import numpy as np
from numpy import array
import matplotlib.pyplot as plt
from PIL import Image
import glob
def MakeChannelsFirst(ImArr):
ImArr=np.rollaxis(ImArr, 2, 0)
return ImArr
def ZeroPaddings(image, padding_si... | raechen1007/image_preprocessing | ImageProcess.py | ImageProcess.py | py | 3,428 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "numpy.rollaxis",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.vstack",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "numpy.hstack",
"line_numb... |
73200815902 | import itertools
from centrality_metrics.utils import filter_pos, preprocess
TEXT = "Cosmology (from the Greek κόσμος, kosmos 'world' and -λογία, " \
"-logia 'study of') is a branch of astronomy concerned with the " \
"studies of the origin and evolution of the universe, from the " \
"Big Bang t... | FyzHsn/graph-tools-api | centrality_metrics/tests/test_utils.py | test_utils.py | py | 1,776 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "centrality_metrics.utils.filter_pos",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "itertools.product",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "centrality_metrics.utils.preprocess",
"line_number": 22,
"usage_type": "call"
},
... |
37641672168 | __author__ = "Shane Drabing"
__license__ = "MIT"
__version__ = "0.2.0"
__email__ = "shane.drabing@gmail.com"
import os
import cv2
import numpy as np
def srt(prop):
def srtf(x):
return abs(x[0] - ROW_NUM * prop)
return srtf
def prod(itr):
n = 1
for x in itr:
n *= x
return n
de... | TrendingTechnology/polyfoto | polyfoto.py | polyfoto.py | py | 6,153 | python | en | code | null | github-code | 7 | [
{
"api_name": "cv2.imread",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "os.path.normpath",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "cv2.cvtColor",
"line_num... |
29911314202 | from datetime import datetime,timedelta
import os
import logging
import shutil
lista_dados = []
caminho = '/home/hitallo/valcann/backupsFrom'
lista_arquivos = os.listdir(caminho)
caminho_backup = '/home/hitallo/valcann/backupsTo'
caminho_log_backup = '/home/hitallo/valcann/'
caminho_log_To = '/home/hitallo/valcann/'
... | HitalloF/CodigoSimplesDeAutomocao | List_arq.py | List_arq.py | py | 1,724 | python | pt | code | 0 | github-code | 7 | [
{
"api_name": "os.listdir",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.stat",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path.getctime",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 19,
... |
70302845983 | import pygame
import math
from queue import PriorityQueue
WIDTH = 800
WIN = pygame.display.set_mode((WIDTH, WIDTH))
pygame.display.set_caption("A* Path Finding Algorithm")
RED = (255, 0, 0)
GREEN = (0, 255, 0)
BLUE = (0, 255, 0)
YELLOW = (255, 255, 0)
WHITE = (255, 255, 255)
BLACK = (0, 0, 0)
PURPLE = (... | anthonyjara7/Astar-Pathfinder | astar.py | astar.py | py | 6,934 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pygame.display.set_mode",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "pygame.display.set_caption",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "p... |
32389046443 | # -*- coding: utf-8 -*-
"""
Created on Wed Jun 29 13:50:25 2022S
@author: chggo
"""
# Get .h5 files from all the zip files given in the "path"
import os
from zipfile import ZipFile
from modules.logger import logger
from .H5Reader import H5Reader
class dump_helper_with_labels():
def __init__(self,path):
... | geeta395/bystronic | src/topics/loc/common/modules/dump_helper_with_labels.py | dump_helper_with_labels.py | py | 4,505 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "os.listdir",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number"... |
44618235673 | # ---
# jupyter:
# jupytext:
# formats: ipynb,py:percent
# text_representation:
# extension: .py
# format_name: percent
# format_version: '1.3'
# jupytext_version: 1.10.2
# kernelspec:
# display_name: Python 3
# language: python
# name: python3
# ---
# %% [markdown]
# ##... | econ-ark/BayerLuetticke | notebooks/DCT.py | DCT.py | py | 8,085 | python | en | code | 10 | github-code | 7 | [
{
"api_name": "matplotlib.pyplot.ion",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "numpy.linspace",
"line_number": 59,
"usage_type": "call"
},
{
"api_name": "numpy.cos",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "numpy.pi",
"line_n... |
21127175833 | # 트럭 n개 지나감 순서 변경 x
# 다리의 길이는 w 단위 길이 이며, 단위 시간에 하나의 단위길이만큼 이동 가능.
# 동시에 올라가있는 트럭은 최대 하중인 L보다 작을 것.
# 큐로 풀 수 있는데 배열? 을 두개 만들어야함.
# 1. 입력된 배열
# 2. 다리 길이만한 배열
# 도착하면 0으로 바꾸고 배열에 있는 숫자와 더해서 몇인지 판별 후 하중 아래면 넣는다.
# 그리고 다음 배열로 고고
from collections import deque
N, W, L = map(int, input().split())
# N : 다리를 건너는 트럭 수
# W : ... | Hhaeum/9mi_algo_study | mina/9회차/truck.py | truck.py | py | 882 | python | ko | code | 0 | github-code | 7 | [
{
"api_name": "collections.deque",
"line_number": 20,
"usage_type": "call"
}
] |
22231001053 | # utf-8
import numpy as np
from random import shuffle
import matplotlib.ticker as ticker
import matplotlib.pyplot as plt
def testAndTrain(iteration, trainingData, testingData, shuffleVal):
global onevsTwo, twoVsThree, oneVsThree
print("\n\n" + "Binary classifier" + "\n\n")
# Declare variables to store the... | Liangyuefeng/Data-Mining | perceptron/binaryperceptron.py | binaryperceptron.py | py | 8,273 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "numpy.dot",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "numpy.dot",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "numpy.dot",
"line_number": 70,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 124,
... |
41246465936 | from time import sleep
import tweepy
from config import auth
from get_city_csv import get_city
api = tweepy.API(auth)
try:
api.verify_credentials()
print("Authentication OK")
while True:
tweet = get_city()
print(tweet)
api.update_status(tweet)
sleep(3600)
except:
prin... | coizioc/RealSoundingCities | bot.py | bot.py | py | 353 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "tweepy.API",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "config.auth",
"line_number": 8,
"usage_type": "argument"
},
{
"api_name": "get_city_csv.get_city",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line... |
70777756065 | import itertools
import sys
from collections import deque
from heapq import heappush, heappop
from math import sqrt
input = sys.stdin
def bfs():
while q:
x, y, cost = q.popleft()
for dx, dy in (-1, 0), (1, 0), (0, -1), (0, 1):
nx, ny = x + dx, y + dy
if nx < ... | goodgood619/Problem-Solving | BOJ(Python 공부용)/14940.py | 14940.py | py | 1,255 | python | en | code | 3 | github-code | 7 | [
{
"api_name": "sys.stdin",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "collections.deque",
"line_number": 24,
"usage_type": "call"
}
] |
21560456829 | from typing import Awaitable
from aiogram import Router, Bot, types, F
from aiogram.filters import Command
from aiogram.fsm.context import FSMContext
from aiogram.utils.keyboard import ReplyKeyboardBuilder
from utils.texts import TranslationTexts as texts
from tgtypes.db_user import DbUser
router = Router()
... | 4u-org/easy-stats-bot | bot/pm/start.py | start.py | py | 1,022 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "aiogram.Router",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "aiogram.utils.keyboard.ReplyKeyboardBuilder",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "utils.texts.TranslationTexts.HELLO_ADD_BOT_BUTTON",
"line_number": 14,
"usage_... |
10516992551 | from pathlib import Path
def RfileSearch(pathlist):
if len(pathlist) == 0:
return []
else:
if pathlist[0].is_file():
return [pathlist[0]] + RfileSearch(pathlist[1:])
else:
return RfileSearch(list(pathlist[0].iterdir())) + RfileSearch(pathlist[1:])
def getSearch... | devkapupara/File-Search | FileSearch.py | FileSearch.py | py | 4,078 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pathlib.Path",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 144,
"usage_type": "call"
}
] |
30971572469 | """ Definitions of blocks, and the genesis block. """
from datetime import datetime
from binascii import hexlify, unhexlify
import json
import logging
import src.utils as utils
from .config import *
from .merkle import merkle_tree
from .crypto import get_hasher
__all__ = ['Block']
class Block:
"""
A block... | ChaAC-FAU/labchain | src/block.py | block.py | py | 9,415 | python | en | code | 11 | github-code | 7 | [
{
"api_name": "binascii.hexlify",
"line_number": 73,
"usage_type": "call"
},
{
"api_name": "binascii.hexlify",
"line_number": 74,
"usage_type": "call"
},
{
"api_name": "binascii.hexlify",
"line_number": 75,
"usage_type": "call"
},
{
"api_name": "binascii.unhexlify... |
21408969475 | from __future__ import division
import ipywidgets as ipw
import ase
from ase.units import *
def get_start_widget(appbase, jupbase):
def on_drop_changed(c):
global factor
lu, ru = drop.value.split(" <=> ")
left.description = lu
right.description = ru
factor = eval("(%s)... | aiidalab/aiidalab-units | start.py | start.py | py | 923 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "ipywidgets.FloatText",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "ipywidgets.FloatText",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "ipywidgets.Dropdown",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "ipywidg... |
4536600689 | import pygame
import sys
from map import Map
from settings import AMOUNT_OF_ROWS, AMOUNT_OF_COLUMNS, BACKGROUND_COLOR, SCREEN_WIDTH, SCREEN_HEIGHT, FPS
clock = pygame.time.Clock()
screen = pygame.display.set_mode((SCREEN_WIDTH, SCREEN_HEIGHT))
game_map = Map(AMOUNT_OF_ROWS, AMOUNT_OF_COLUMNS)
game_map.draw(screen)
... | KomorowskiKuba/parallel-game-of-life | main.py | main.py | py | 562 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pygame.time.Clock",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pygame.time",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pygame.displa... |
15150867399 | """
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Coset Enumeration using Todd-Coxeter Algorithm
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Reference:
[1] "Handbook of Computational Group Theory", Holt, D., Eick, B., O'Brien, E.
[2] "Computation with finitely presented groups", Charles C.Sims.
[3] GAP... | neozhaoliang/pywonderland | src/polytopes/polytopes/todd_coxeter.py | todd_coxeter.py | py | 12,145 | python | en | code | 4,155 | github-code | 7 | [
{
"api_name": "collections.deque",
"line_number": 309,
"usage_type": "call"
}
] |
41303025876 | import json
from socket import timeout
class Point:
def __init__(self, row, column):
self._row = row
self._column = column
@property
def row(self):
return self._row
@property
def column(self):
return self._column
def serialize(self):
return {"row": se... | mohsendb7008/IE-Game | server/Classes.py | Classes.py | py | 6,998 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "json.dumps",
"line_number": 154,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 165,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 220,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 2... |
74795643423 | from datetime import datetime
import pandas as pd
from nltk.sentiment.vader import SentimentIntensityAnalyzer as SIA
import re
import matplotlib.pyplot as plt
import seaborn as sns
import nltk
nltk.download('vader_lexicon')
def date_time(df):
df['tweet_date'] = df['tweet_dt'].apply(lambda x: datetime.strptime(x,'... | StefaniaSferragatta/Twitter_Indicators | dde/time_series/sentiment_analysis.py | sentiment_analysis.py | py | 3,337 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "nltk.download",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.strptime",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "pandas.to_d... |
24229700699 | from PyQt5.QtWidgets import (
QWidget, QGridLayout, QHBoxLayout, QVBoxLayout,
QPushButton, QLabel, QLineEdit, QCheckBox, QSizePolicy
)
from PyQt5.QtCore import QThread, pyqtSignal
import xml.etree.ElementTree as ET
from time import sleep
import os
from TraditionalParamTuning.myPackage.func import mkdir
from Tra... | YuTing-Fang1999/FIH-tool | TraditionalParamTuning/UI/ParamPage/PushAndSaveBlock.py | PushAndSaveBlock.py | py | 4,781 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "PyQt5.QtWidgets.QWidget",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtCore.pyqtSignal",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtCore.pyqtSignal",
"line_number": 14,
"usage_type": "call"
},
{
"api_name"... |
18327929469 | from datetime import datetime
from app import app
from flask_sqlalchemy import SQLAlchemy
db = SQLAlchemy(app)
class Storm(db.Model):
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(100), nullable=False)
description = db.Column(db.Text)
created = db.Column(db.DateTime, default... | platonlukyanov/BrainStormed | models.py | models.py | py | 868 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "flask_sqlalchemy.SQLAlchemy",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "app.app",
"line_number": 5,
"usage_type": "argument"
},
{
"api_name": "datetime.datetime.now",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "date... |
30584895640 |
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
def main():
df = {'Protein':[],
'Score':[],
'Position':[]}
h = open('Grich_and_QNrich_LCD-Sup35_Fusion_Sequences_PAPA_RESULTS.tsv')
header = h.readline()
for line in h:
prot, h... | RossLabCSU/IJMS_2021 | plot_PAPA_results.py | plot_PAPA_results.py | py | 2,081 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pandas.DataFrame.from_dict",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 33,
"usage_type": "attribute"
},
{
"api_name": "seaborn.lineplot",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "mat... |
46095962817 |
from flask_restless import APIManager
from app import db
from app import app
from flask import Blueprint,json,request
import base64
class Produto(db.Model):
id = db.Column(db.Integer, primary_key = True)
nome = db.Column(db.String(200))
descricao = db.Column(db.String(400))
imagem = db.Column(db.BLOB)... | sillaslima/apiEcommerce | app/produtos/cadastro_produtos.py | cadastro_produtos.py | py | 2,007 | python | pt | code | 0 | github-code | 7 | [
{
"api_name": "app.db.Model",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "app.db",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "app.db.Column",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "app.db",
"line_number": 9,
... |
71402088864 | import cv2
def main():
img = cv2.imread("img.jpg", cv2.IMREAD_GRAYSCALE)
height, width = img.shape[:2]
histogram = [0] * 256
for i in range(height):
for j in range(width):
# Piksel değerini histograma ekle
histogram[img[i, j]] += 1
for i in range(256):
... | huseyincevik46/image_processing | histogram_graylevel_calculate.py | histogram_graylevel_calculate.py | py | 451 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "cv2.imread",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "cv2.IMREAD_GRAYSCALE",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "cv2.line",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "cv2.imshow",
"line_nu... |
43431025545 | from typing import List
class Solution:
@staticmethod
def rle(lst: List[int]) -> List[int]:
prev = None
length = 0
result = list()
for current in lst:
if current == prev:
length += 1
else:
result.append(length)
... | dmittov/leetcode | 413.arithmetic-slices/task.py | task.py | py | 818 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "typing.List",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 26,
"usage_type": "name"
}
] |
6339401028 | #!/usr/bin/env python
import tweepy, time, os, sys, yaml
PROJDIR = sys.path[0]
# Load twitter credentials for this bot from config file
BOTCRED_FILE = '%s/.twurlrc' % os.path.expanduser('~')
with open(BOTCRED_FILE, 'r') as credfile:
full_config = yaml.load(credfile)
api_key = api_key = full_config['profiles']['clo... | ianfitzpatrick/cloudeverynoun | tweet.py | tweet.py | py | 965 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "sys.path",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "os.path.expanduser",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "yaml.load",
"line_numb... |
38991258616 | #! /usr/bin/python3
import rospy
from shared_msgs.msg import auto_control_msg, final_thrust_msg, thrust_status_msg, thrust_command_msg, controller_msg
from sensor_msgs.msg import Imu
from std_msgs.msg import Float32, String
import numpy as np
import Complex_1
import thrust_mapping
import json
from dynamic_reconfigure.s... | purduerov/X13-Core | ros/src/control/scripts/thrust_control.py | thrust_control.py | py | 4,640 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "json.loads",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "shared_msgs.msg.final_thrust_msg",
"line_number": 74,
"usage_type": "call"
},
{
"api_name": "shared_msgs.msg.thrust_status_msg",
"line_number": 91,
"usage_type": "call"
},
{
"api... |
6787482548 | import httplib
import logging
from utils.exceptions import HttpRequestException
LOG = logging.getLogger(__name__)
class HttpRequestHandler(object):
def __init__(self, url, auth_token):
""" Initialize the Http Request Handler.
:param url: url of the request recipient
:param auth_token: au... | Phoenix1708/OpenAcademy_OpenStack_Flyway | flyway/utils/http_client.py | http_client.py | py | 2,058 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "logging.getLogger",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "httplib.HTTPConnection",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "httplib.responses",
"line_number": 45,
"usage_type": "attribute"
},
{
"api_name": "loggin... |
74751951583 | from django.urls import include, path
from rest_framework.routers import DefaultRouter
from . import views
v1_router = DefaultRouter()
v1_router.register('users', views.UserViewSet, 'users')
urlpatterns = [
path('v1/', include(v1_router.urls)),
path('v1/auth/email/', views.get_confirmation_code),
path('v... | kotofey97/api_yamdb | users/urls.py | urls.py | py | 356 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "rest_framework.routers.DefaultRouter",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.urls.include",
"line_number": 10,
"usage_type": "call"
},
{
"api_name... |
29320170560 | import os
import shutil
import pwd
import grp
import sys
import errno
import shutil
from config_common import file_utils, utils, cfg_exceptions
from config_common.rhn_log import log_debug
from spacewalk.common.usix import raise_with_tb
class TargetNotFile(Exception): pass
class DuplicateDeployment(Exception): pass
cl... | spacewalkproject/spacewalk | client/tools/rhncfg/config_common/transactions.py | transactions.py | py | 16,646 | python | en | code | 640 | github-code | 7 | [
{
"api_name": "os.path.exists",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 60,
"usage_type": "attribute"
},
{
"api_name": "os.path.isfile",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number... |
39506404470 | from collections import deque
dh, dw = [0, 0, -1, 1], [-1, 1, 0, 0]
N, M = map(int, input().split())
S = [input() for _ in range(N)]
W, r = sum([S[i][j] == '.' for i in range(N) for j in range(M)]), 0
for i in range(N):
for j in range(M):
if S[i][j] == '.':
continue
s, d, c = {(i, j)... | n-yU/AtCoder | PAST/202010/G.py | G.py | py | 787 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "collections.deque",
"line_number": 14,
"usage_type": "call"
}
] |
37668187440 | import numpy as np
import matplotlib.pyplot as plt
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("--n", help="radial order",
type=int, default=0)
parser.add_argument("--ell", help="angular degree",
type=int, default=200)
ARGS = parser.parse_args()
compa... | srijaniiserprinceton/get-solar-eigs | plotter/plot_compare.py | plot_compare.py | py | 1,815 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "numpy.loadtxt",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.loadtxt",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.loadtxt",
... |
70080643102 | import os
from time import sleep
import pandas as pd
import paramiko
import pymysql
from loguru import logger
from sshtunnel import SSHTunnelForwarder
def query_data(queries, config):
"""
query_data queries data from MySQL remote and save the data in a dataframe.
Input queries should be a list of dictio... | emptymalei/diet | dietbox/lab/data/extraction/sql.py | sql.py | py | 3,858 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "loguru.logger.warning",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "loguru.logger",
"line_number": 58,
"usage_type": "name"
},
{
"api_name": "os.path.expanduser",
"line_number": 59,
"usage_type": "call"
},
{
"api_name": "os.path",
... |
15259048342 | import discord
from discord.ext import commands
from discord.ext.commands import CommandNotFound
#assegno alla variabile bot il bot
bot = commands.Bot(command_prefix = "-")
bot.remove_command("help")
@bot.event
async def on_ready():
print("Bot is Online")
@bot.command()
async def ciao(ctx):
await ctx.messag... | Giacomo-SP/Main | Discord Bot/bot.py | bot.py | py | 3,824 | python | it | code | 1 | github-code | 7 | [
{
"api_name": "discord.ext.commands.Bot",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "discord.ext.commands",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "discord.utils.get",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "discord... |
1469556838 | #!/usr/bin/env python3
import asyncio
import time
import logging
import yaml
import sys
import traceback
from os.path import exists
import cryptocom.exchange as cro
from cryptocom.exchange.structs import Pair
from cryptocom.exchange.structs import PrivateTrade
import krakenex
from binance.client import Clie... | tapisky/arbitrito | arbitrito.py | arbitrito.py | py | 17,502 | python | en | code | 4 | github-code | 7 | [
{
"api_name": "binance.client.Client",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "cryptocom.exchange.Exchange... |
74253757662 | # See http://overview.cc/RockPaperScissors for more information about rock, paper, scissors
# Extension to bayes13: Use also the csc function for singleopp and singlemy
from collections import defaultdict
import operator
import random
if input == "":
score = {'RR': 0, 'PP': 0, 'SS': 0, 'PR': 1, 'RS': 1, 'SP': 1,'RP... | jay20162016/rps | bots/bayes14.py | bayes14.py | py | 13,114 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "operator.itemgetter",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "c... |
40626549911 | import logging
log = logging.getLogger(__name__)
from rhombus.views.fso import save_file
from rhombus.lib.utils import get_dbhandler, get_dbhandler_notsafe, silent_rmdir
from rhombus.lib.roles import SYSADM, DATAADM
from rhombus.lib.tags import *
from genaf.views import *
from genaf.lib.procmgmt import subproc, getp... | trmznt/genaf | genaf/views/task.py | task.py | py | 1,440 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "logging.getLogger",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "genaf.lib.procmgmt.get_queue",
"line_number": 17,
"usage_type": "call"
}
] |
34382618900 | import sys
import time
from .util import execute, easyCommand, toStr, DEVSException, getProxy, EPSILON
from math import floor
### VCD helper class (actually more of a struct)
class VCDRecord(object):
"""
A data class to keep information about VCD variables
"""
def __init__(self, identifierNr, modelNa... | capocchi/DEVSimPy | DEVSKernel/PyPDEVS/old/tracers.py | tracers.py | py | 22,042 | python | en | code | 41 | github-code | 7 | [
{
"api_name": "sys.stdout",
"line_number": 143,
"usage_type": "attribute"
},
{
"api_name": "util.execute",
"line_number": 180,
"usage_type": "call"
},
{
"api_name": "util.easyCommand",
"line_number": 180,
"usage_type": "call"
},
{
"api_name": "util.execute",
"... |
30042661580 | import netCDF4 as nc
from model_info_2d import *
# 2022-08-21 11:16:44 Sola 修改读取地理信息时不用给定时间
# 2022-08-21 20:35:35 Sola 增加读取地形时的timestamp(还是至少得给定一个的)
# 2022-08-21 20:40:58 Sola 修正读取数据时读数的错误(将取余写成了整除)
# 2022-08-21 20:55:13 Sola 将其垂直高度插值到模式网格正中央
class CT2019B(model_info_2d):
"""
model_info_2d的一个子类, 用于读取CarbonTrack... | SolaProject/wrfchem_ghg_bc | model.py | model.py | py | 1,677 | python | zh | code | 0 | github-code | 7 | [
{
"api_name": "netCDF4.Dataset",
"line_number": 23,
"usage_type": "call"
}
] |
30269971951 | '''
Comparing single layer MLP with deep MLP (using TensorFlow)
'''
import numpy as np
import pickle
from scipy.optimize import minimize
from math import sqrt
import time
# Do not change this
def initializeWeights(n_in,n_out):
"""
# initializeWeights return the random weights for Neural Network given the
... | shivangi88/Machine-Learning-and-OpenCV-Projects | Machine Learning Projects/MultiLayer Perceptron Neural Network/facennScript.py | facennScript.py | py | 6,555 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "math.sqrt",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "numpy.random.rand",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "numpy.exp",
"line_n... |
44430753288 | """Import Dewey Levels
Revision ID: f36bc9474f9a
Revises: 80b0ea80d3c8
Create Date: 2023-04-11 14:37:09.442839
"""
import csv
import sqlalchemy as sa
from sqlalchemy import text
from alembic import op
from models import DeweyDecimalSystem, DeweyLevel_1, DeweyLevel_2, DeweyLevel_3
from db import db
# revision identi... | tas09009/Wrec-API | migrations/versions/f36bc9474f9a_import_dewey_levels.py | f36bc9474f9a_import_dewey_levels.py | py | 3,854 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "alembic.op.batch_alter_table",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "models.DeweyDecimalSystem",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "db.... |
21316159096 | import os
import sys
from cx_Freeze import setup, Executable
sys.path.append(os.path.abspath('./'))
# 目标文件
target_file = 'bzxgt/main.py'
build_exe_options = {
'packages': ['os', 'sys', 'requests', 'bs4', 'threading', 'shutil', 'time', 'utils'],
'include_files': [],
}
base = None
# 打包成exe
setup(name='MyScript',... | jeffery-zhang/spiders | bzxgt/setup_win.py | setup_win.py | py | 516 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "sys.path.append",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number... |
42074205833 | from django.contrib.auth.base_user import AbstractBaseUser, BaseUserManager
from django.contrib.auth import models as auth_models
from django.core.validators import FileExtensionValidator
from django.db import models
class CustomUserManager(BaseUserManager):
def create_user(self, username, email, password=None, *... | azashev/django-project-collection | book_app_final/book_app_final/users_app/models.py | models.py | py | 2,939 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "django.contrib.auth.base_user.BaseUserManager",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.contrib.auth.base_user.AbstractBaseUser",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "django.contrib.auth.models.PermissionsMixin",
"li... |
74148745183 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# CDICALC: calculator for coherent X-ray diffraction imaging experiments
# authors:
# Jerome Carnis, carnis_jerome@yahoo.fr
from setuptools import setup, find_packages
from os import path
from io import open
from cdicalc import __version__
here = path.absp... | carnisj/cdicalc | setup.py | setup.py | py | 2,758 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "os.path.abspath",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "os.path.dirname",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "io.open",
"line_number": ... |
40191525851 |
from __future__ import print_function
import scipy.ndimage
from astropy.io import fits
import numpy
import megaradrp.datamodel as dm
from .getspaxdim import getspaxdim
def convert(infile,arcsec_per_pixel=0.2,sigma_conv=1.,expansion_factor=5,writeout=None,overwrite=False,keep_units=False):
"""
Convert a MEG... | javierzaragoza/megararss2cube | megararss2cube/convert.py | convert.py | py | 7,843 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "astropy.io.fits.open",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "astropy.io.fits",
"line_number": 40,
"usage_type": "name"
},
{
"api_name": "megaradrp.datamodel.read_fibers_extension",
"line_number": 45,
"usage_type": "call"
},
{
"ap... |
11405122945 | from msgpack import packb, unpackb
from collections import namedtuple
from zlib import compress, decompress
from struct import pack, unpack
import asyncio
from nectar.utils import logger
from concurrent.futures import ThreadPoolExecutor
Ack = namedtuple('Ack', ('value',))
PubKeyReply = namedtuple('PubKeyReply', ('key'... | ramaro/pomares | nectar/proto.py | proto.py | py | 5,923 | python | en | code | 5 | github-code | 7 | [
{
"api_name": "collections.namedtuple",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "collections.namedtuple",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "collections.namedtuple",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "c... |
41070012695 | # Module : TaskModule.py
# This module reads tasks from a text file and stores them in an array
# Task Format : #{TASK_NAME},{TASK_PERIOD},{TASK_EFFORT},{TASK_LAST_DONE_DATE}
from enum import Enum
import datetime
taskFileHeader = "#{TASK_NAME},{TASK_PERIOD},{TASK_EFFORT},{TASK_LAST_DONE_DATE}"
### Enum for task info ... | talhagulbudak/TaskHunter | taskHunter_v0.0/TaskModule.py | TaskModule.py | py | 4,393 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "enum.Enum",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.strptime",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "datetime.... |
40629005880 | import sys
import numpy as np
from collections import deque
def do_empty(dir):
if dir == 'r':
return 0, 1, 'r'
elif dir == 'l':
return 0, -1, 'l'
elif dir == 'u':
return -1, 0, 'u'
elif dir == 'd':
return 1, 0, 'd'
def do_slash(dir): # /
if dir == 'r':
retur... | waltman/advent-of-code-2023 | day16/lava.py | lava.py | py | 2,834 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "collections.deque",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 103,
"usage_type": "attribute"
},
{
"api_name": "numpy.array",
"line_number": 104,
"usage_type": "call"
}
] |
42642740028 | import datetime
from typing import TYPE_CHECKING, Any, Dict, Type, TypeVar, Union
import attr
from dateutil.parser import isoparse
from ..types import UNSET, Unset
if TYPE_CHECKING:
from ..models.codat_data_contracts_datasets_report_line import CodatDataContractsDatasetsReportLine
T = TypeVar("T", bound="Codat... | levrofin/levro-codat | codat_api_client/models/codat_data_contracts_datasets_cash_flow_statement.py | codat_data_contracts_datasets_cash_flow_statement.py | py | 3,689 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "typing.TYPE_CHECKING",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "typing.TypeVar",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "typing.Union",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "types.Unset",
"li... |
41050711949 | import base64
import hashlib
import json
import random
import re
import time
import requests
from redis import StrictRedis
from requests.exceptions import RequestException
from .config import (ACCOUNT_SID,
APP_ID,
AUTH_TOKEN,
BASE_URL,
... | yiyuhao/FukuanUnion | payserver/common/msg_service/sms_send.py | sms_send.py | py | 5,109 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "redis.StrictRedis",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "config.redis_pool",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "config.ERROR_MSG",
"line_number": 36,
"usage_type": "name"
},
{
"api_name": "config.ERROR_MSG... |
23816193898 | import psycopg2
import sqlalchemy as db
from sqlalchemy.orm import sessionmaker
def connect():
try:
engine = db.create_engine("postgresql://postgres:777999Pg@localhost:5432/postgres")
# engine.echo = True # We want to see the SQL we're creating
# connection = engine.connect()
... | TKuzola/pgsandbox | try_sqlalchemy.py | try_sqlalchemy.py | py | 1,038 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "sqlalchemy.create_engine",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.MetaData",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Table",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "sqlalche... |
25598628186 | from bs4 import BeautifulSoup
import requests
from urllib.parse import urlparse
from os import path
import os
import json
import pandas as pd
class Crawler:
def __init__(self, crawler_config):
self.crawler_config = crawler_config
def crawl(self):
crawl_list = self.create_list_crawler(
... | tobiasoberrauch/website-crawler | lib.py | lib.py | py | 3,317 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "json.dump",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "urllib.parse.urlparse",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
... |
20383132504 | from xl_tensorflow.models.vision.detection.inference.yolo_inference import *
from xl_tensorflow.models.vision.detection.inference.efficientdet_inference import *
import base64
from xl_tool.xl_io import file_scanning
def test_yolo():
# model = yolo_inference_model("yolov3", "", 20, inference_mode="base64",
# ... | Lannister-Xiaolin/xl_tensorflow | scripts/test/test_inference_serving.py | test_inference_serving.py | py | 2,255 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pathlib.Path",
"line_number": 40,
"usage_type": "call"
}
] |
42103373503 | from config import SQLITE_DB, SAS_LIBREF
import saspy
import sqlite3
import pandas as pd
import time
con = sqlite3.connect(SQLITE_DB)
tabelas = {
'pregao': 'BASE_PREGAO',
'item': 'BASE_PREGAO_ITEM',
'proposta': 'BASE_PREGAO_PROPOSTA',
'adjudicacao': 'BASE_PREGAO_ADJUDICACAO'
}
def de_sqlite():
"... | flavoso/comprasnet_data | carrega_sas.py | carrega_sas.py | py | 1,712 | python | pt | code | 0 | github-code | 7 | [
{
"api_name": "sqlite3.connect",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "config.SQLITE_DB",
"line_number": 7,
"usage_type": "argument"
},
{
"api_name": "config.SQLITE_DB",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "pandas.read_sql",... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.