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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
40582183957 | import sys
sys.path.append('/Users/me/_Nutbox/UniversalMolecularSystem')
# The main function of this module, TopologyMatching, seeks to solve the problem of matching atoms between two
# identical molecules with different atom ordering.
from UniversalMolecularSystem import *
from collections import deque
class Solvi... | lr142/PythonUniversalMolecularSystem | TopologyMatching.py | TopologyMatching.py | py | 11,875 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "sys.path.append",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 2,
"usage_type": "attribute"
},
{
"api_name": "collections.deque",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "collections.deque",
... |
12230108418 | from PIL import Image
import re
import os
path = os.path.join(os.path.expanduser('~'),'images')
def img_fix(imglist):
for img in imglist:
savepath = os.path.join(os.path.expanduser('~'),'opt','icons')
fullpath = os.path.join(path, img)
open_image = Image.open(fullpath)
new_name = r... | KingUnknown15/Final-Course-IT-Automation-Python | Week-1/image-fixer-LINUX.py | image-fixer-LINUX.py | py | 735 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "os.path.join",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "os.path.expanduser",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_nu... |
12065854237 | import configparser, os
PATH = 'config.cfg'
DEFAULTS = {
'main': {
'debug': True,
'interpreter': False,
},
'graphics': {
'hwaccel': True,
}
}
skip_file = False
config = configparser.ConfigParser()
if os.path.isfile(PATH) and not skip_file:
config.read_file(open('co... | juliohq/PyNES | core/engine/settings.py | settings.py | py | 368 | python | fa | code | 0 | github-code | 71 | [
{
"api_name": "configparser.ConfigParser",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path.isfile",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 17,
"usage_type": "attribute"
}
] |
6136526827 | # coding=utf-8
import json
import re
import requests,os
# TODO 可以用
dir = "H:\\11-快手单个视频\\"
def get(url: str) -> dict:
"""
title、imgs、videos
"""
data = {}
failed = {'msg': 'failed...'}
headers = {
"User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 6_0 like Mac OS X) AppleWebKit/536.26 (K... | legolas-zeng/scripts | 爬虫/快手/kuaishou.py | kuaishou.py | py | 3,370 | python | en | code | 3 | github-code | 71 | [
{
"api_name": "re.findall",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "re.findall",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 33... |
40762438168 | import sys
from collections import deque
dx = [-1, 1, 0, 0]
dy = [0, 0, -1, 1]
input = sys.stdin.readline
n, m = map(int, input().split())
# 치즈가 있는 부분 1, 치즈가 없는 부분 0
map = [list(map(int, input().split())) for _ in range(n)]
def melted():
queue = deque()
visited = [[0] * m for _ in range(n)]
# 모눈종이의... | kimyubi/ps | BFS 복습/2638 치즈.py | 2638 치즈.py | py | 1,302 | python | ko | code | 0 | github-code | 71 | [
{
"api_name": "sys.stdin",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "collections.deque",
"line_number": 14,
"usage_type": "call"
}
] |
14193038987 | #!/usr/bin/python
from gi.repository import Gtk, GObject, Gdk
import sys
class CommonAPI(Gtk.Window):
def __init__ (self, Title, Length, Breadth):
Gtk.Window.__init__(self, title = Title )
self.set_size_request(Length, Breadth)
self.fixed = Gtk.Fixed()
self.grid = Gtk.Grid()
self.radioButton1 = None
#s... | shub16/silver-lining | Sem5/CSL306/P2010CS1036/P2010CS1018_Jaspreet/Assign4/OutputWindow.py | OutputWindow.py | py | 1,590 | python | en | code | 2 | github-code | 71 | [
{
"api_name": "gi.repository.Gtk.Window",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "gi.repository.Gtk",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "gi.repository.Gtk.Window.__init__",
"line_number": 9,
"usage_type": "call"
},
{
"ap... |
72062947109 | import graph_tool as gt
import json
from random import sample
net = gt.load_graph('citenet0.out.gt')
core_pmap = net.vp['core']
core = [vertex for vertex in net.vertices() if core_pmap[vertex]]
downstream = core_pmap.copy()
gt.infect_vertex_property(net, downstream, vals = [True])
boundary_pmap = net.new_vp('bool', ... | dhicks/cite-network | downstream/downstream.py | downstream.py | py | 1,362 | python | en | code | 1 | github-code | 71 | [
{
"api_name": "graph_tool.load_graph",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "graph_tool.infect_vertex_property",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "random.sample",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "... |
9423553322 | import sys
import numpy as np
import pandas as pd
import data
from analysis import full_entropy_calculation_bpw
if __name__ == '__main__':
if len(sys.argv) != 2:
print(f'USAGE: {sys.argv[0]} <filename>')
exit(-1)
# Variables related to the location of the data and the type of system
bibles... | PabloMosUU/BibleWordPasting | 12_entropy_bpw.py | 12_entropy_bpw.py | py | 2,695 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "sys.argv",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "data.parse_pbc_bible",
"... |
11221320665 | # 게리맨더링
import sys
sys.stdin = open('input.txt', 'r')
from collections import deque
def dfs(cnt, s, end):
global mn
# 종료조건
if cnt == end: # 재귀횟수가 목표횟수에 도달
group1, group2 = deque(), deque() # 그룹1, 2로 나누기
# 방문 한 지점 group1, # 방문 안 한 지점 group2
for i in range(1, N+1):
... | Al9-Mor9/Graphs | Code/17471/17471_K.py | 17471_K.py | py | 2,148 | python | ko | code | 0 | github-code | 71 | [
{
"api_name": "sys.stdin",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "collections.deque",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "collections.deque",
"line_number": 38,
"usage_type": "call"
}
] |
35715696801 | import pytest
from api.community import choices, factories, selectors
@pytest.mark.django_db
class TestCommunitySelectors:
def test_filter_company_hashtags(self):
h_1 = factories.HashtagFactory(slug="a")
h_2 = factories.HashtagFactory(slug="b")
_ = factories.CompanyFactory(slug="a", curr... | aecworks/aec.works-api | tests/test_communities/test_selectors.py | test_selectors.py | py | 1,116 | python | en | code | 5 | github-code | 71 | [
{
"api_name": "api.community.factories.HashtagFactory",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "api.community.factories",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "api.community.factories.HashtagFactory",
"line_number": 10,
"usage_type": "c... |
2232287548 | import numpy as np
import copy
from scipy import sparse
file = "day_12_input.txt"
# file = "day_12_input_test.txt"
with open(file) as f:
lines = f.readlines()
f.close()
lines_letters = [l.replace("\n", "") for l in lines]
lines_elevation = [
[ord(x) % 32 if x not in ["S", "E"] else 0 for x in l] for l in... | simon-hirsch/Advent-of-Code-2022 | day_12_solution.py | day_12_solution.py | py | 2,382 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "numpy.stack",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.stack",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": ... |
42177515179 | # do analysis on the layer
from fileIterables import allFilesInRecurseByType, getNameFromPath
from statistics import pstdev as stddev
from statistics import mean
Layer_DIR = "layerSampleSet"
LFILE_TYPE = "lyr"
class Stats:
def __init__(self):
self.segments = 0
self.pointsMean = 0
... | Gautreaux/CSCE-491H | pyLegacy/layerAnalysis.py | layerAnalysis.py | py | 2,518 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "fileIterables.allFilesInRecurseByType",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "statistics.mean",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "statistics.pstdev",
"line_number": 61,
"usage_type": "call"
},
{
"api_name"... |
74240913189 | import numpy as np
import cv2
import glob
import os
import PIL as Image
import os.path as osp
from tqdm import tqdm
current_dir = os.getcwd()
print("path", current_dir)
# path= ''.join([current_dir, folder])
count = 1
if __name__ == "__main__":
# path_an = sorted(glob.glob('/home/airlab/Desktop/New_training/01_Ann... | ThinhPham24/PRACTICE_ON_COMPUTER_VISION | WEEK5-ANNOTATION/background_txt.py | background_txt.py | py | 1,144 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "os.getcwd",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "glob.glob",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 20,
... |
17232166017 | from fabric.api import *
env.hosts = ['servername']
def _annotate_hosts_with_ssh_config_info():
from os.path import expanduser
from paramiko.config import SSHConfig
def hostinfo(host, config):
hive = config.lookup(host)
if 'hostname' in hive:
host = hive['hostname']
if ... | yekeqiang/fabric_project | learn/fabfile_ssh_config.py | fabfile_ssh_config.py | py | 1,072 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "os.path.expanduser",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "paramiko.config.SSHConfig",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "os.path.expanduser",
"line_number": 27,
"usage_type": "call"
}
] |
26454884817 | from flask import Flask, jsonify, request
from flask_sqlalchemy import SQLAlchemy
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///test.db'
db = SQLAlchemy(app)
class User(db.Model):
id = db.Column(db.Integer, primary_key=True)
firstname = db.Column(db.String(200), nullable=False)
... | juancitowillyr46/rest-api-flask-basic | app.py | app.py | py | 2,071 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "flask.Flask",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "flask_sqlalchemy.SQLAlchemy",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "flask.request.json",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "flask.r... |
18121679263 | import torch
import torch.nn as nn
from nets.vgg16 import decom_vgg16
from nets.resnet50 import resnet50
from nets.rpn import RegionProposalNetwork
from nets.classifier import VGG16RoIHead,Resnet50RoIHead
import time
import numpy as np
class FasterRCNN(nn.Module):
def __init__(self, num_classes,
m... | YhQIAO/LandSlide_Detection_Faster-RCNN | nets/frcnn.py | frcnn.py | py | 2,452 | python | en | code | 33 | github-code | 71 | [
{
"api_name": "torch.nn.Module",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "nets.vgg16.decom_vgg16",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "nets.rpn.RegionPro... |
73235965028 | import io
from google.oauth2 import service_account
from google.cloud import vision
from CREDENTIALS import VISION_KEY_PATH
credentials = service_account.Credentials.from_service_account_file(
VISION_KEY_PATH)
client = vision.ImageAnnotatorClient(credentials=credentials)
def read_image(filepath):
with io.ope... | gabrieltanhl/OCR-Telegram-Bot | visionocr.py | visionocr.py | py | 681 | python | en | code | 31 | github-code | 71 | [
{
"api_name": "google.oauth2.service_account.Credentials.from_service_account_file",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "CREDENTIALS.VISION_KEY_PATH",
"line_number": 7,
"usage_type": "argument"
},
{
"api_name": "google.oauth2.service_account.Credentials",
... |
28356227929 | from PyQt5.QtWidgets import QMainWindow, QApplication, QFileDialog, QMessageBox, QLabel, QDialog
from PyQt5 import uic
from PyQt5.QtGui import *
from PyQt5.QtCore import QRect, Qt, QPoint
import os, glob, cv2, sys
form_class = uic.loadUiType("Image_loader2.ui")[0]
class Label_Dialog(QDialog):
def __init__(self, ... | picardyee/PtQt_Project | ImageLoadProject_TestTest.py | ImageLoadProject_TestTest.py | py | 11,283 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "PyQt5.uic.loadUiType",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "PyQt5.uic",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtWidgets.QDialog",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "PyQt5.uic.loadUi... |
25434193910 | from __future__ import annotations
from typing import TYPE_CHECKING
from ..messaging.lazy_payload import VariablePayloadWID, vp_compile
from ..messaging.serialization import Payload
if TYPE_CHECKING:
from ..types import Address
def encode_connection_type(type: str) -> tuple[int, int]: # noqa: A002
"""
... | Tribler/py-ipv8 | ipv8/messaging/payload.py | payload.py | py | 15,518 | python | en | code | 214 | github-code | 71 | [
{
"api_name": "typing.TYPE_CHECKING",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "messaging.serialization.Payload",
"line_number": 37,
"usage_type": "name"
},
{
"api_name": "types.Address",
"line_number": 45,
"usage_type": "name"
},
{
"api_name": "typ... |
35293907399 | import logging
import subprocess
from pathlib import Path
log = logging.getLogger(__name__)
class PlexScanner:
"""
determines if plex should scan its libraries after a new download is completed
and issues plex scan command
"""
def __init__(self, config, qbitclient):
self.config = config
... | snazzypapa/qbitmgr | utils/plex_scanner.py | plex_scanner.py | py | 2,237 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "logging.getLogger",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "subprocess.check_output",
... |
12732689283 | import json
import logging
import re
import textwrap
import dateutil.parser
from dojo.models import Finding
logger = logging.getLogger(__name__)
CWE_REGEX = r'cwe-\d+$'
class SarifParser(object):
"""OASIS Static Analysis Results Interchange Format (SARIF) for version 2.1.0 only.
https://www.oasis-open.org/... | manu20202/test1 | dojo/tools/sarif/parser.py | parser.py | py | 6,196 | python | en | code | 1 | github-code | 71 | [
{
"api_name": "logging.getLogger",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "dateutil.parser.parser.isoparse",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "dateutil.p... |
33535561996 | from setuptools import find_packages, setup
from typing import List
HYPEN_E_DOT = '-e .'
def get_requirements(path:str)->List[str]:
requirements = []
with open(path, 'r') as f:
requirements = f.readlines()
requirements = [req.replace('\t','') for req in requirements]
if HYPEN_E_DOT in... | haotran0103/pass_fall | setup.py | setup.py | py | 621 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "typing.List",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "setuptools.setup",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "setuptools.find_packages",
"line_number": 22,
"usage_type": "call"
}
] |
42913114602 | from django.urls import path
from . import views
app_name = "comments"
urlpatterns = [
# POST comment
# Ex: /api/books/1/comments/
path("", views.comment_post_controller, name="comment_controller"),
# PUT and DELETE a comment
# Ex: /api/books/1/comments/1/
path(
"<int:comment_id>/"... | Tejas-117/Books-Club | api/comments/urls.py | urls.py | py | 414 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 12,
"usage_type": "call"
}
] |
8722886422 | # 資料來源 政府開放平台 https://data.gov.tw/dataset/151337
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
url = 'https://www.gender.ey.gov.tw/GecDB/Common/OpenXML.ashx?sn=6yrTVzOhjQtbqd8LlVgtKg@@'
df = pd.read_xml(url)
#年份處理
df['year'] = df["Period"].astype(str).str.rep... | WunCaioLiou/pythonAll | 台灣經常性薪資變化熱度圖.py | 台灣經常性薪資變化熱度圖.py | py | 2,158 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "pandas.read_xml",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure... |
35772458398 | #!/usr/bin/python3
#
#A function that creates a archive with a truncated directory tree
import os, glob, zipfile, shutil
def archiver(path):
'''Create a Zip archive, truncated to the basename of its path'''
archive_name = os.path.abspath(os.path.basename(path) + '.zip')
zf = zipfile.ZipFile(archi... | stophergu/Truncated-Archive-Function | my_zip_file.py | my_zip_file.py | py | 869 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "os.path.abspath",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "os.path.basename",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "zipfile.ZipFile",
"lin... |
8440250717 | import os
import subprocess
from General_Utilities.control_rutas import setting_routes
from modules.django_modifile import settings
from modules.django_rootes import project_settings
project_name = project_settings()['Project']
key = 'resources'
directorio = setting_routes(key)[0]
os.chdir(directorio)
print(os.getc... | hmartinez00/z_django_projects | scripts/new_project.py | new_project.py | py | 989 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "modules.django_rootes.project_settings",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "General_Utilities.control_rutas.setting_routes",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.chdir",
"line_number": 13,
"usage_type": "call"
... |
14343396625 | from django.urls import path
from . import views
from .views import CreateProfileView
urlpatterns=[
path('', views.index, name="index"),
path('register/', views.register, name="registeruser"),
path('login/', views.loginUser, name="loginuser"),
path('logout/', views.logoutUser, name="logout"),
path... | Alice-Githui/Rate-my-App | projects/urls.py | urls.py | py | 1,003 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "views.index",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "views.register",
... |
17623232835 | import asyncio
from concurrent.futures import TimeoutError
import json
import logging
from typing import Optional
import aiohttp
from aiohttp import web
from multidict import CIMultiDictProxy
logger = logging.getLogger(__name__)
DEFAULT_REMOVED_RESPONSE_HEADERS = {"Content-Length", "Content-Encoding", "Transfer-En... | vladvasiliu/aws-alb-oauth-proxy | aws_alb_oauth_proxy/helpers.py | helpers.py | py | 2,775 | python | en | code | 2 | github-code | 71 | [
{
"api_name": "logging.getLogger",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "aiohttp.web.Request",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "aiohttp.web",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "multidict.CIMu... |
21704355758 | from django.shortcuts import render, redirect, HttpResponseRedirect
from .forms import UserRegistrationForm, UserLoginForm
from subscription.models import UserSubscription, SubscriptionType
from django.contrib import messages, auth
from django.urls import reverse
from django.contrib.auth.decorators import login_require... | o-power/dashing-data | accounts/views.py | views.py | py | 3,910 | python | en | code | 1 | github-code | 71 | [
{
"api_name": "forms.UserRegistrationForm",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.authenticate",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth",
"line_number": 23,
"usage_type": "name"
},
{
"a... |
13642347753 | import sys
import zmq
context = zmq.Context()
socket1 = context.socket(zmq.SUB)
socket1.connect("tcp://172.16.36.110:19403")
socket1.setsockopt_string(zmq.SUBSCRIBE, "")
socket2 = context.socket(zmq.SUB)
socket2.connect("tcp://172.16.36.110:19603")
socket2.setsockopt_string(zmq.SUBSCRIBE, "")
poller = zmq.Poller()
p... | etoricky/ZeroMQCppPy | ZeroMQ/testing/01sub/23polling.py | 23polling.py | py | 755 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "zmq.Context",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "zmq.SUB",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "zmq.SUBSCRIBE",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "zmq.SUB",
"line_number":... |
21942393673 | import binascii
import calendar
import datetime
try:
import hashlib
_md5func = hashlib.md5
except ImportError: # for Python < 2.5
import md5
_md5func = md5.new
import os
import random
import socket
import struct
import threading
import time
from bson.errors import InvalidId
from bson.py3compat import ... | Georce/lepus | lepus/pymongo-2.7/bson/objectid.py | objectid.py | py | 8,391 | python | en | code | 333 | github-code | 71 | [
{
"api_name": "hashlib.md5",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "md5.new",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "bson.py3compat.b",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "bson.py3compat.b",
"... |
30413776736 | import subprocess as p
from multiprocessing.dummy import Pool as ThreadPool
def check_ip(ip):
ip = ip.strip()
w=p.Popen('ping -c 2 '+ip, shell=True, stdout=p.PIPE, stderr=p.PIPE)
out, err = w.communicate()
other_info = out.decode('utf-8')
if 'ttl' in other_info or 'TTL' in other_info:
pass... | paddy235/python_notes | network/host_ping_test.py | host_ping_test.py | py | 588 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "subprocess.Popen",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "subprocess.PIPE",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "multiprocessing.dummy.Pool",
"line_number": 19,
"usage_type": "call"
}
] |
11498011377 | import cv2
import logging, coloredlogs
face_cascade = cv2.CascadeClassifier('./classifiers/haarcascade_frontalface_default.xml')
eye_cascade = cv2.CascadeClassifier('./classifiers/haarcascade_eye.xml')
smile_cascade = cv2.CascadeClassifier('./classifiers/haarcascade_smile.xml')
def detect_n_plot(frame, detect_eyes=T... | redouane-dev/opencv-detection-test | app.py | app.py | py | 3,346 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "cv2.CascadeClassifier",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "cv2.CascadeClassifier",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "cv2.CascadeClassifier",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "cv2.cv... |
75065661350 | # Leaving this here for the future, but I learned that I have to be logged in
# to see the puzzle input, so I'll download it to a local file and read it in.
# import requests
#
# for line in requests.get("https://adventofcode.com/2022/day/1/input"):
# print(line)
import pathlib
# Reading in the file
f = open(path... | cedarwarman/advent_of_code_2022 | python/01.py | 01.py | py | 807 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "pathlib.Path",
"line_number": 11,
"usage_type": "call"
}
] |
71245454629 | # -*- coding: utf-8 -*-
"""some internal library functions"""
import datetime
import urllib
import unicodedata as ud
import logging
from functools import cmp_to_key
from bs4 import BeautifulSoup
# pylint: disable=E0402
from .consts import URL, alphabet_1, alphabet_2
from .db import dbconnect
def tpl_headers_symbol... | stanislavvv/fb2_srv_pg | app/internals.py | internals.py | py | 12,120 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "functools.cmp_to_key",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "unicodedata.normalize",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "consts.alphabet_1",
"line_number": 68,
"usage_type": "name"
},
{
"api_name": "consts.a... |
2471875177 | import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
from sklearn.model_selection import train_test_split as sp
from sklearn.tree import DecisionTreeClassifier as dtc
from sklearn.metrics import accuracy_score, confusion_matrix
np.random.seed(146)
df = pd.read_csv("... | Omer-KISAKOL/Machine-Learning | Sisa.py | Sisa.py | py | 864 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "numpy.random.seed",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "pandas.read_csv",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sklearn.model_sel... |
16123525742 | from sqlalchemy.ext.asyncio import AsyncSession
from sqlalchemy import select
from db_models import Question as DBQuestion
from schemas import QuestionCreate
import requests
import json
async def get_question(db: AsyncSession) -> DBQuestion:
query = (
select(DBQuestion)
.order_by(DBQuestion.create... | millevi/test1 | crud.py | crud.py | py | 953 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "sqlalchemy.ext.asyncio.AsyncSession",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.select",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "db_models.Question",
"line_number": 11,
"usage_type": "argument"
},
{
"api_n... |
22817563839 | # -*- coding: UTF-8 -*-
"""
Author: mathstao
Project: https://github.com/Mathstao/Chat-Cluster/
"""
import pandas as pd
import numpy as np
from sklearn.feature_extraction.text import TfidfTransformer
from sklearn.feature_extraction.text import CountVectorizer
# data为聚类结果表格的DataFrame,topN为每一类的关键词数量,name为l... | Mathstao/Chat-Cluster | src/cluster_second.py | cluster_second.py | py | 3,916 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "sklearn.feature_extraction.text.CountVectorizer",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "sklearn.feature_extraction.text.TfidfTransformer",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 52,
"usage_... |
33059956731 | import unittest
from django.conf import settings
from django.urls import reverse
from patchwork.models import Check
from patchwork.tests.api import utils
from patchwork.tests.utils import create_check
from patchwork.tests.utils import create_patch
from patchwork.tests.utils import create_maintainer
from patchwork.tes... | veruu/patchwork | patchwork/tests/api/test_check.py | test_check.py | py | 6,382 | python | en | code | null | github-code | 71 | [
{
"api_name": "django.conf.settings.ENABLE_REST_API",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "django.conf.settings",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "patchwork.tests.api.utils.APITestCase",
"line_number": 19,
"usage_type": "... |
24513404213 | from torch import nn
import torch.nn.functional as F
from torch.nn import Sequential
import torch
conv1 = lambda f_in, f_out: nn.Conv3d(f_in, f_out, kernel_size=(1,3,3), stride=1, padding=(0,1,1))
conv2 = lambda f_in, f_out: nn.Conv3d(f_in, f_out, kernel_size=(1,3,3), stride=1, padding=(0,0,0))
bn = lambda f: nn.Batch... | muffin-rice/Pad-Misc | Solver/DQN.py | DQN.py | py | 1,345 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "torch.nn.Conv3d",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "torch.nn.Conv3d",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number": 7... |
86284266969 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import re
from astropy import log
import bottleneck as bn
import numpy as np
from sofia_redux.instruments.exes.lincor import lincor
from sofia_redux.instruments.exes.get_badpix import get_badpix
from sofia_redux.instruments.exes.utils import get_reset_d... | SOFIA-USRA/sofia_redux | sofia_redux/instruments/exes/readraw.py | readraw.py | py | 21,238 | python | en | code | 9 | github-code | 71 | [
{
"api_name": "astropy.log.info",
"line_number": 101,
"usage_type": "call"
},
{
"api_name": "astropy.log",
"line_number": 101,
"usage_type": "name"
},
{
"api_name": "sofia_redux.instruments.exes.lincor.lincor",
"line_number": 102,
"usage_type": "call"
},
{
"api_na... |
20438003108 | # (C) 2022 GoodData Corporation
from __future__ import annotations
from pathlib import Path
from typing import Any, List, Optional, Type
import attr
from gooddata_metadata_client.model.declarative_workspace import DeclarativeWorkspace
from gooddata_metadata_client.model.declarative_workspace_data_filter import Decla... | lupko/gooddata-python-sdk | gooddata-sdk/gooddata_sdk/catalog/workspace/declarative_model/workspace/workspace.py | workspace.py | py | 9,909 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "gooddata_sdk.catalog.base.Base",
"line_number": 34,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 35,
"usage_type": "name"
},
{
"api_name": "gooddata_sdk.catalog.workspace.declarative_model.workspace.logical_model.ldm.CatalogDeclarativeLdm... |
70195281510 | import psycopg2 as bd
conexion = bd.connect(user='postgres',password='admin',host='127.0.0.1',port='5432',database='test_db')
try:
with conexion:
with conexion.cursor() as cursor:
query = 'INSERT INTO persona("Nombre", "Apellido", "Email") VALUES(%s, %s, %s)'
valores = ("Nicola", "... | GrowingPol/LearningPython | Practice1/BasesDeDatos/TransaccionesConWith.py | TransaccionesConWith.py | py | 1,133 | python | es | code | 0 | github-code | 71 | [
{
"api_name": "psycopg2.connect",
"line_number": 3,
"usage_type": "call"
}
] |
70263282791 | import logging
from pprint import pformat
class Service():
"""
Class that contains all informations about Services and corresponding funtions
"""
SERVICE_STATUS = {
"OK": 0,
"WARNING": 1,
"CRITICAL": 2,
"UNKNOWN": 3
}
unhandled = []
def __init__(self, con... | KevinHonka/Icinga2_Python_API | icinga2/lib/service.py | service.py | py | 8,121 | python | en | code | 5 | github-code | 71 | [
{
"api_name": "logging.getLogger",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "pprint.pformat",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "pprint.pformat",
"line_number": 110,
"usage_type": "call"
},
{
"api_name": "pprint.pformat",
... |
71942245990 | import pygame
import math
import sys
import serial as ser
import time
import numpy as np
from utilities import receive_bytes,max_difference_between_columns
from button import Button
WINDOW_WIDTH, WINDOW_HEIGHT = 1280, 600
#define coloures
WHITE = (255,255,255)
BLACK = (0,0,0)
RED = (255, 0, 0)
GR... | SignalDecomposition/DCSFinalProject | PC_side/LDR_GUI.py | LDR_GUI.py | py | 6,734 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "pygame.font.SysFont",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "pygame.font",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "pygame.draw.circle",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "pygame.draw",... |
74927187749 | import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
from matplotlib import ticker
plt.ylim(0, 20)
plt.xlim(0, 365)
data1 = np.random.random([6,50])
colors1 = ['C{}'.format(i) for i in range(6)]
lineoffsets1 = [-15, -3, 1, 1.5, 6, 10]
linelengths1 = [5, 2, 1, 1, 3, 1.5]
fig, axs = plt.subplo... | Hoperin/Book-Report | plot.py | plot.py | py | 446 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "matplotlib.pyplot.ylim",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.xlim",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "matplotl... |
2713057977 |
import json
class SatData:
def __init__(self, filename='sat.json'): #input file
with open(filename) as f: #open file and save as dictionary
self.data = json.load(f) #open JSON file
self.header = [h['name'] for h in self.data['meta']['view']['columns']][8:]
self.data = self.data['data'] #l... | ankitsumitg/random-python-programs | saving_data_to_csv.py | saving_data_to_csv.py | py | 794 | python | en | code | 1 | github-code | 71 | [
{
"api_name": "json.load",
"line_number": 7,
"usage_type": "call"
}
] |
70050479909 | import datetime
class Restaurant:
def __init__(self, restaurant_name, cuisine_type):
self.restaurant_name = restaurant_name
self.cuisine_type = cuisine_type
self.number_served = 0
def describe_restaurant(self):
print('------------------------------------------------')
... | diegoortizmatajira/python-learning | classes/20210728/Lesson_10-Practice.py | Lesson_10-Practice.py | py | 5,619 | python | en | code | 2 | github-code | 71 | [
{
"api_name": "datetime.date",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "datetime.date.today",
"line_number": 74,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"... |
23872118975 | # -*- coding:utf-8 -*-
# Author : MMagicLoren
# @Email : 993983320@qq.com
# @Time : 2019/10/13 15:59
# @File : 图像梯度计算.py
# @Project : Workspace
import cv2 as cv
import os
import sys
path = os.path.abspath(os.path.dirname(sys.argv[0]))
def sobel_demo(image):
grad_x = cv.Sobel(src, cv.CV_64F, 1, 0, ksize=3)
gr... | orange-eng/Image_enhancement | tools/Gredient/Gredient_example.py | Gredient_example.py | py | 1,123 | python | en | code | 3 | github-code | 71 | [
{
"api_name": "os.path.abspath",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_num... |
27256066347 | from datetime import datetime, timedelta
import os
from airflow import DAG
from airflow.operators.dummy_operator import DummyOperator
from airflow.operators.subdag_operator import SubDagOperator
from airflow.operators.postgres_operator import PostgresOperator
from operators.stage_redshift import StageToRedshiftOperator... | Karenzhang7717/airflow_data_pipelines | dags/etl.py | etl.py | py | 3,413 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "datetime.datetime",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "datetime.timedelta",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "airflow.DAG",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "airflow.operators.du... |
70990461669 | import random
import discord
import asyncio
from discord import colour
from discord import embeds
from discord.ext import commands
from discord.ext.commands.core import command
class helpCommand(commands.Cog):
def __init__(self, bot: commands.Bot):
self.bot = bot
@commands.group(... | CivoHD/Yumeko | yumekohelp.py | yumekohelp.py | py | 3,910 | python | en | code | 0 | github-code | 71 | [
{
"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": "discord.ext.commands.Bot",
"line_number": 13,
"usage_type": "attribute"
},
{
"... |
26032038424 | """Contains STIXToCollection class and entrypoint for stixToCollection_cli."""
import argparse
import copy
import json
import traceback
from uuid import uuid4
from datetime import datetime
from stix2elevator.stix_stepper import step_bundle
from stix2elevator.options import initialize_options, ElevatorOptions
# https:... | mitre-attack/mitreattack-python | mitreattack/collections/stix_to_collection.py | stix_to_collection.py | py | 6,247 | python | en | code | 293 | github-code | 71 | [
{
"api_name": "copy.deepcopy",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "stix2elevator.options.initialize_options",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "stix2elevator.options.ElevatorOptions",
"line_number": 41,
"usage_type": "call"
... |
18402098308 | import os
from flask import Flask, request
from qingstor.sdk.config import Config
from qingstor.sdk.request import Request
app = Flask(__name__)
# Get access_key_id and secret_access_key from system environment
access_key_id = os.environ.get('ACCESS_KEY_ID')
secret_access_key = os.environ.get('SECRET_ACCESS_KEY')
#... | yunify/qingstor-demo-signature-server-python | demo.py | demo.py | py | 1,470 | python | en | code | 1 | github-code | 71 | [
{
"api_name": "flask.Flask",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.environ.get",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "os.environ.get",
"line_... |
71479904549 | # -*- coding: utf-8 -*-
"""
Created on Sun Jan 27 19:13:39 2019
@author: asus
"""
from data import *
from collections import OrderedDict as od
from eacal import EACal, lang
import datetime as dt
import cv2
import numpy as np
from PIL import Image, ImageDraw, ImageFont
from lunardate import LunarDate
import math
c=E... | funfwo/Fengshui | paipan.py | paipan.py | py | 24,994 | python | en | code | 3 | github-code | 71 | [
{
"api_name": "eacal.EACal",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "collections.OrderedDict.fromkeys",
"line_number": 100,
"usage_type": "call"
},
{
"api_name": "collections.OrderedDict",
"line_number": 100,
"usage_type": "name"
},
{
"api_name":... |
30987951854 | import math
import cv2
import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
import torch.nn.init as init
from random import choices
from skimage.measure.simple_metrics import compare_psnr
def weights_init_kaiming(m):
classname = m.__class__.__name__
if classname.find('Conv') !... | jianzhangcs/SCI3D | sci_utilities.py | sci_utilities.py | py | 8,213 | python | en | code | 25 | github-code | 71 | [
{
"api_name": "torch.nn.init.kaiming_normal_",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "torch.nn.init",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "torch.nn.in... |
38382253446 | import tensorflow as tf
from tensorflow import keras
import random_manager as r
import numpy as np
import utils.data_utils as data
import utils.data_type_utils as data_type
import utils.file_utils as file
import constants as C
def create_variable(shape,name='var',dev=0.01,rgen=None):
seed = None
if rgen is n... | mihail-luchian/sophias_tulip | src/utils/nn_utils.py | nn_utils.py | py | 15,934 | python | en | code | 1 | github-code | 71 | [
{
"api_name": "random_manager.random_seed_from",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "tensorflow.Variable",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "tensorflow.random_normal",
"line_number": 17,
"usage_type": "call"
},
{
"api_... |
24824648067 | # -*- coding: utf-8 -*-
"""
Created on Tue Apr 19 06:27:59 2022
@author: hyc
"""
#应该扫描各个puzzle的csv文件,与benchmark1.csv作比较
#复合(多条件)筛选出对应puzzle_number、tag的某一行,然后将该行的ares换成比如
#new_rna_puzzle_10.csv里的pred
"""
import pandas as pd
import os
file_path="/fsa/home/ww_duyy/hyc/data/Townshend/augmented_puzzles/decoys/pred_outpu... | hycPEXM/ares_reproduction | code/benchmark1_data.py | benchmark1_data.py | py | 5,691 | python | en | code | 2 | github-code | 71 | [
{
"api_name": "pandas.read_csv",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "multiprocessing.Manager",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "pandas.read_... |
35084310763 | # -*- coding: utf-8 -*-
"""Main module."""
import csv
import datetime
import getpass
import glob
import hashlib
import io
import json
import logging
import os
import re
import sys
import typing
from collections import defaultdict
from pathlib import Path
from ruamel.yaml import YAML # type: ignore
from .computed_val... | aklajnert/changelogd | changelogd/changelogd.py | changelogd.py | py | 13,652 | python | en | code | 6 | github-code | 71 | [
{
"api_name": "ruamel.yaml.YAML",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "typing.Any",
"line_number": 36,
"usage_type": "attribute"
},
{
"api_name": "typing.Dict",
"line_number": 38,
"usage_type": "attribute"
},
{
"api_name": "typing.Any",
"l... |
1099372615 | # -*- coding: utf-8 -*-
"""The implementation of the Anki Assets plugin."""
import os
import os.path
import pathlib
from aqt import mw # type: ignore
addon_path = os.path.dirname(__file__)
def addons_assets_directory() -> pathlib.Path:
return pathlib.Path(addon_path) / 'assets'
def list_my_assets(dir: pathli... | gregorias/anki-assets | anki_assets/main.py | main.py | py | 2,060 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "os.path.dirname",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "pathlib.Path",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_numb... |
7403385024 | import os
import sys
import csv
import glob
import fiona
from shapely.geometry import shape
import psycopg2
import cadutils
def load_ddl(conn, ddlfile):
print("* Executing DDL %s" % os.path.basename(ddlfile))
with open(ddlfile, 'r', encoding='utf-8') as infile:
ddl_content = infile.read()
cur ... | IMIO/import_cadastre | seedPostgres2017.py | seedPostgres2017.py | py | 6,068 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "os.path.basename",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "os.path.basename",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_nu... |
34623024176 | import json
import uuid
from regression import test_utils as utils
from regression import parent_node_dict
from pgadmin.utils.route import BaseTestGenerator
from pgadmin.browser.server_groups.servers.databases.tests import utils as \
database_utils
from pgadmin.browser.server_groups.servers.databases.schemas.tests... | luvres/armhf | pgadmin/pgadmin4/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/tests/test_indexes_add.py | test_indexes_add.py | py | 2,748 | python | en | code | 8 | github-code | 71 | [
{
"api_name": "pgadmin.utils.route.BaseTestGenerator",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "regression.parent_node_dict",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "regression.parent_node_dict",
"line_number": 23,
"usage_type": "name"
... |
32045213317 | from pathlib import Path
import sys
parent_dir = Path(__file__).parent
file_name = Path(__file__).stem
sys.stdin = open(f"{parent_dir}\{file_name} input.txt")
input = sys.stdin.readline
def find_longest_palindrome_in_row(matrix):
# 가장 먼 곳에서부터 가까이 오면서 회문 판별하기
longest_len = 1
for row in range(N):
... | adiens916/NOTE-algorithm | problems/SW_Expert_Academy/0817 - String/회문2.py | 회문2.py | py | 2,812 | python | ko | code | 0 | github-code | 71 | [
{
"api_name": "pathlib.Path",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sys.stdin",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "sys.stdin",
"line_number": ... |
72959307751 | import pymysql # pip install pymysql
import re
import datetime
# DB
DBNAME = ''
PASSWORD = ''
TABLENAME = ''
# Others
TEXTPATH = ''
MYNAME = ''
YOURNAME = ''
def FindFirstMatch(str, c):
for i in range(len(str)):
if str[i] == c:
return i;
def ReadTalks(path):
f = open(path, 'r', encodi... | DaEunKim/KakaoTalkToMySQL | main.py | main.py | py | 2,012 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "pymysql.connect",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.strptime",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 41,
"usage_type": "attribute"
}
] |
23027585407 | import asyncio
import json
import re
import lxml.html
import pyppeteer
import pandas as pd
file_path = 'tmp.csv'
tmp = pd.read_csv(file_path, sep='\t')
URLS = ['http://'+ x[2:-1] for x in list(tmp['d1'].append(tmp['d2'].append(tmp['d3'])).dropna())]
async def get_metadata_from_url(browser, url):
page = await b... | GoryachevaT/newprolab-10.0 | my_solutions/project01/other_useful_shit/titles-pyppeteer.py | titles-pyppeteer.py | py | 2,207 | python | en | code | 3 | github-code | 71 | [
{
"api_name": "pandas.read_csv",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "lxml.html.html.fromstring",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "lxml.html.html",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "lxml.ht... |
34356490996 |
import os
import time
import torch
import datetime
import numpy as np
import torch.nn as nn
from torch.autograd import Variable
from torchvision.utils import save_image
from torchvision import transforms
import cv2
import PIL
from unet_encoder2 import unet
from utils import *
from PIL import Image
from iou import I... | tzofi/physically-disentangled-representations | segmentation/tester.py | tester.py | py | 8,516 | python | en | code | 3 | github-code | 71 | [
{
"api_name": "torch.bincount",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "torch.diag",
"line_number": 78,
"usage_type": "call"
},
{
"api_name": "numpy.asarray",
"line_number": 84,
"usage_type": "call"
},
{
"api_name": "numpy.uint8",
"line_numbe... |
13485240808 | # This is the main training setup for training a Pensieve model, but
# stopping at intervals to add new training data based on performance
# (increases generalizability, we hope!)
import sys
import subprocess
import numpy as np
import os
from bayes_opt import BayesianOptimization
# Inputs:
#
# - experiment results dire... | haitian2du/Pensieve-DR-copy | sim/train_pensieve_with_bo.py | train_pensieve_with_bo.py | py | 4,534 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "os.stat",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 49,
"usage_type": "attribute"
},
{
"api_name": "os.listdir",
"line_number": 50,... |
12898909574 | import numpy as np
import argparse
parser = argparse.ArgumentParser(description="Run pop_bias.")
parser.add_argument('--path', nargs='?', default="data/ml_10m/", # change by zyang
help='Input data path.')
parser.add_argument('--slot_count', type=int, default=13, # change by zyang
... | zyang1580/PDA | pop_pre.py | pop_pre.py | py | 2,000 | python | en | code | 93 | github-code | 71 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 37,
"usage_type": "call"
}
] |
75142051109 | """
Plot the monod function and holling tyoe II for growth and predation rates
"""
import numpy as np
import matplotlib.pyplot as plt
def f_monod(PO4,u_max,kP,color):
PO4 = np.array(PO4)
mu = (PO4/(PO4+kP))*u_max
plt.scatter(PO4,mu,5,color=color)
return mu
def f_hollingII(P,sum_P,g_max,kZ,color):
... | OmsLaurina/toolbox_growthadvection_Laurina | utils/f_monod_hollingII.py | f_monod_hollingII.py | py | 440 | python | en | code | 2 | github-code | 71 | [
{
"api_name": "numpy.array",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.scatter",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "numpy.array",
... |
23338457948 | import pymongo
from loguru import logger
from DB.db import client
db: pymongo.database.Database = client.session_url_tokens
def create_new_session(guild, url_token):
try:
db.session_url_tokens.replace_one({'_id': str(guild.id)}, {'_id': str(guild.id), 'url_token': str(url_token)})
logger.info(f"To... | denisyakimov07/EveKillBoardDiscordBoad | DB/create_session_url.py | create_session_url.py | py | 435 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "pymongo.database",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "DB.db.client.session_url_tokens",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "DB.db.client",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "... |
14203939050 | from sqlalchemy import Column, Integer, String
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
class World(Base):
__tablename__ = 'world'
id = Column(Integer, primary_key=True)
randomnumber = Column(Integer)
sa_worlds = World.__table__
class Fortune(Base):
__table... | TechEmpower/FrameworkBenchmarks | frameworks/Python/aiohttp/app/models.py | models.py | py | 444 | python | en | code | 7,193 | github-code | 71 | [
{
"api_name": "sqlalchemy.ext.declarative.declarative_base",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Integer",
"line_number": 9,
"usage_type": "argument"
},
{
... |
35349439936 | import bpy
import os
from . import helper as H
from . import logger as L
def print_node_inputs(node):
for i, node in enumerate(node.inputs):
print(i, node.name)
def print_node_outputs(node):
for i, node in enumerate(node.outupts):
print(i, node.name)
def feed_input_indices(context, input_indices):
channels = ... | Tilapiatsu/blender-lineup_maker | material.py | material.py | py | 5,284 | python | en | code | 1 | github-code | 71 | [
{
"api_name": "os.path.join",
"line_number": 68,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 68,
"usage_type": "attribute"
},
{
"api_name": "os.path.basename",
"line_number": 68,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"lin... |
24619748082 | from django import forms
from django.db.models import Q
from django.contrib.auth.models import User
from django.contrib.contenttypes.models import ContentType
import django_filters
from actstream.models import Action
from rest_framework import serializers, viewsets, permissions, mixins, status
from rest_framework.deco... | mozilla/kitsune | kitsune/notifications/api.py | api.py | py | 6,969 | python | en | code | 1,209 | github-code | 71 | [
{
"api_name": "rest_framework.permissions.BasePermission",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.permissions",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "rest_framework.serializers.ModelSerializer",
"line_number": 35,
... |
20254214329 | import os
import requests
from flask import Flask, render_template, request, jsonify
from flask_socketio import SocketIO, emit
def call(new):
newnew=""
for i in range (0,len(new)-1):
if (new[i]==" " and new[i+1]==" "):
newnew=newnew
else:
newnew=newnew+new[i]
if (new[... | joselxes/chatapp | application.py | application.py | py | 3,026 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "flask.Flask",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "flask_socketio.SocketIO",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "flask.render_template",... |
30393141751 | import datetime
import logging
import os
import time
from collections import namedtuple
from .milight import Mode, Off
from .colors import C_WARM_WHITE, WARM_WHITE, WHITE, ORANGE, RED
class Gradient:
def __init__(self, mode1: Mode, mode2: Mode):
self.mode1 = mode1
self.mode2 = mode2
def at(s... | jbchouinard/milightsdriver | milightsdriver/scheduler.py | scheduler.py | py | 4,781 | python | en | code | 1 | github-code | 71 | [
{
"api_name": "milight.Mode",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "colors.ORANGE._replace",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "colors.ORANGE",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "colors.WHITE",
... |
33852887843 | from rest_framework.test import APIClient
from testing.testcases import TestCase
from society_manage.models import CreditDistribution
from society.constants import SocietyStatus
class StudentTests(TestCase):
def test_get_student(self):
user = self.createUser(username='ncj')
student = self.createS... | JeekITClub/StudentPlatform | student/api/tests.py | tests.py | py | 5,107 | python | en | code | 6 | github-code | 71 | [
{
"api_name": "testing.testcases.TestCase",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "rest_framework.test.APIClient",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "rest_framework.test.APIClient",
"line_number": 26,
"usage_type": "call"
},
{
... |
18564243440 | from ics import Calendar
from shutil import copyfile
from app.excel_cells import EXCEL_KEYS
import datetime
import openpyxl
import requests
import os
dir_path = os.path.dirname(os.path.realpath(__file__))
def receive_file(url, user_id, semester):
if url[-4:] != '.ics':
return {'not_ics': True}
return ... | benzhang13/schedule-comparer | app/process_ical.py | process_ical.py | py | 1,787 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "os.path.dirname",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "os.path.realpath",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path.isfile",
"line... |
25869306788 | from multiagents.reasoning_algorithms.tree_of_thought.Tree.Tree import my_tree, tree_node
from copy import deepcopy
from multiagents.reasoning_algorithms import base_search_method
from prompt_templates.Tree_search_prompts import MAKE_REFLECTION_RPOMPT,DIVERSITY_PROMPT,VOTE_BEST_SYSTEM_PROMPT,VOTE_BEST_USER_PROMPT,DEFA... | TsinghuaDatabaseGroup/lmdb | multiagents/reasoning_algorithms/tree_of_thought/UCT_vote_function.py | UCT_vote_function.py | py | 30,745 | python | en | code | 3 | github-code | 71 | [
{
"api_name": "multiagents.reasoning_algorithms.base_search_method",
"line_number": 51,
"usage_type": "name"
},
{
"api_name": "multiagents.memory.BaseMemory",
"line_number": 54,
"usage_type": "name"
},
{
"api_name": "pydantic.Field",
"line_number": 54,
"usage_type": "name... |
33259099936 | from email.message import EmailMessage
import config
import validate_address
# ______________________________________________________________________________
# set mail server data
def BuildTable(info):
'''
Uses the information of a person to construct a table containing the
payments the person has to do... | lukasg96/payment_notifier | configure_massage.py | configure_massage.py | py | 2,163 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "email.message.EmailMessage",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "config.settings",
"line_number": 45,
"usage_type": "attribute"
},
{
"api_name": "config.settings",
"line_number": 49,
"usage_type": "attribute"
},
{
"api_name": "... |
35754543092 | import json
import logging
from unittest import mock
import olympia.core.logger
from olympia.amo.tests import TestCase
from olympia.users.models import UserProfile
class LoggerTests(TestCase):
def make_fake_record(self, msg='Some fake message', level=logging.NOTSET):
return logging.LogRecord(
... | mozilla/addons-server | src/olympia/core/tests/test_logger.py | test_logger.py | py | 4,710 | python | en | code | 844 | github-code | 71 | [
{
"api_name": "olympia.amo.tests.TestCase",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "logging.NOTSET",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "logging.LogRecord",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "olym... |
13288002123 | import pandas as pd
from nltk.tokenize import RegexpTokenizer
import nltk as nltk
from nltk.corpus import stopwords
from nltk.stem import PorterStemmer
nltk.download('stopwords')
nltk.download('punkt')
# federalist txt
authors = 'data/federalist.txt'
final_dataset = pd.DataFrame(columns=['author', 'body'])
f = open... | carcassonkp/NLP_Authorship | preprocessingtxt.py | preprocessingtxt.py | py | 2,977 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "nltk.download",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "nltk.download",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "nltk.tokenize.RegexpTokeni... |
11714989468 | import sys
from pathlib import Path
DIR = Path(__file__).resolve().parent
sys.path.insert(0, str(DIR.parent.parent.parent.parent))
__package__ = DIR.name
import django
django.setup()
from BaseClass import *
from scrapy import signals
store_url = sys.argv[4]
class PrettylittlethingScrapper(Spider_BaseClass):
@... | HaseebGull/Scrappers | spiders/prettylittlethingscrapper.py | prettylittlethingscrapper.py | py | 7,820 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "pathlib.Path",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "sys.path.insert",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "django.setup",
"line_numb... |
40336546423 | import numpy as np
import pandas as pd
import re
import matplotlib.pyplot as plt
import seaborn as sns
from nltk.corpus import stopwords
from nltk.stem.porter import PorterStemmer
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.model_selection import train_test_split
from sklearn.... | saket223/Fake_News_Detector | model.py | model.py | py | 3,335 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "nltk.download",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "nltk.corpus.stopwords.words",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "nltk.corpus.stopwords",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "panda... |
71142976230 | from collections import defaultdict
from math import sqrt
import sys
#AC
input = sys.stdin.readline
def check(c, i, m): #O(sqrt(n))
for j in range(1, int(sqrt(i))+1):
if i%j == 0 and j <= m:
c[i].add(j)
if i//j <= m:
c[i].add(i//j)
for _ in range(int(input(... | Azim-Islam/Problem-Solving-DSA | USACO.GUIDE/SILVER/CF_1777_C.py | CF_1777_C.py | py | 1,384 | python | en | code | 4 | github-code | 71 | [
{
"api_name": "sys.stdin",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "math.sqrt",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "collections.defaultdic... |
32045350507 | from pathlib import Path
import sys
parent_dir = Path(__file__).parent
file_name = Path(__file__).stem
sys.stdin = open(f"{parent_dir}\{file_name} input.txt")
input = sys.stdin.readline
from collections import deque
T = int(input())
for test_case in range(1, T + 1):
N, M = map(int, input().split())
Q = de... | adiens916/NOTE-algorithm | problems/SW_Expert_Academy/0826/11884. 회전.py | 11884. 회전.py | py | 481 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "pathlib.Path",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sys.stdin",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "sys.stdin",
"line_number": ... |
26383322836 | from abc import ABC, abstractmethod
from flask import request
import logging
import mlog
logger = logging.getLogger('endpoint')
class Endpoint(ABC):
def __init__(self, dbClient, mqClient, logger, env):
self.dbClient = dbClient
self.mqClient = mqClient
self.logger = logger
self.env ... | netSensTeam/netSens | center/app/web/endpoints/_endpoint.py | _endpoint.py | py | 1,631 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "logging.getLogger",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "abc.ABC",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "abc.abstractmethod",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "logging.getLogger",
"l... |
9277413874 | #!/usr/bin/python3
import sys
import enum
import math
import rospy
from nav_msgs.msg import Odometry
from sensor_msgs.msg import LaserScan
from geometry_msgs.msg import Twist
from argos_bridge.msg import ProximityList
from argos_bridge.msg import BaseGroundList
from argos_bridge.msg import MotoGroundList
from argos_b... | pepojs/Swarm_robots | ros_workspace/src/testBot/scripts/testBot_argos_node.py | testBot_argos_node.py | py | 35,194 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "enum.IntEnum",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "enum.Enum",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "enum.IntEnum",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "std_msgs.msg.Bool"... |
1573875074 | import re
from datetime import datetime
from urllib.parse import quote
import requests
from server.extensions import config
def get_twitter_user_details(url: str):
username = re.match(r"https://(www\.)?twitter\.com/([a-zA-Z0-9_]+)/?", url).group(2)
try:
response = requests.get(
f"{config... | HohShenYien/caringly-core | server/social_media/twitter.py | twitter.py | py | 1,265 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "re.match",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "server.extensions.config",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "requests.get",
"li... |
30010263292 | import json
import datetime
import RPi.GPIO as GPIO
from time import sleep
from flask import Flask
BIND_ADDRESS = '0.0.0.0'
PORT = 5001
GPIO.setmode(GPIO.BCM)
GPIO.setup(4,GPIO.IN)
# Date to string converter
def date_to_str(o):
if isinstance(o, datetime.datetime):
return o.__str__()
def get_data():
... | whoismikem/RaspberryPi_Environment_Sensor | microAPI_light-sensor/app.py | app.py | py | 975 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "RPi.GPIO.setmode",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "RPi.GPIO",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "RPi.GPIO.BCM",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "RPi.GPIO.setup",
"lin... |
40049969970 | from celery import shared_task
from celery.task import task
from django.contrib.auth.models import User
from celery import Celery
from django.core.mail import send_mail
from django_celery_beat.models import PeriodicTask
from django.core.exceptions import ValidationError
from datetime import timedelta
import datetime
im... | SigisM/todoapp | todo_app/todo_items/tasks.py | tasks.py | py | 5,008 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "celery.Celery",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "django.core.mail.send_mail",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "celery.shared_task",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "django.co... |
38228883099 | # Always prefer setuptools over distutils
from setuptools import setup, find_packages
# To use a consistent encoding
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
# Get the long description from the relevant file
with open(path.join(here, 'DESCRIPTION.rst'), encoding='utf-8')... | carrierx/carrierx-python | setup.py | setup.py | py | 1,338 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "os.path.abspath",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "os.path.dirname",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "codecs.open",
"line_number":... |
39039482319 | """"配置文件"""
import pickle
import torch
device=torch.device("cuda:0"if torch.cuda.is_available() else "cpu")
#############语料相关############
user_dict_path="corpus/user_dict/keyword.txt"
stopwords_path=r"corpus/user_dict/stopwords.txt"#"\corpus\user_dict\stopwords.txt"
classify_corpus_train_path="corpus/classif... | mazongpei/chartbot | chart_service/config.py | config.py | py | 2,991 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "torch.device",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "torch.cuda.is_available",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "pickle.load",
"... |
72901688231 | from datetime import datetime
from src.extension import db
from src.pbl5_ma import CheckInSchema
from src.model import CheckIn
from flask import jsonify, request, jsonify
check_in_schema = CheckInSchema()
check_ins_schema = CheckInSchema(many=True)
def get_all_check_ins_service():
check_ins = CheckIn.query.all()
... | LePhiDuy/PBL5_backend | src/service/check_in_service.py | check_in_service.py | py | 2,098 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "src.pbl5_ma.CheckInSchema",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "src.pbl5_ma.CheckInSchema",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "src.model.CheckIn.query.all",
"line_number": 11,
"usage_type": "call"
},
{
"api... |
43993536955 | # !/usr/bin/env python3
# -*- coding: utf-8 -*-
from Predictor import Predictor
from sklearn.neighbors import KNeighborsRegressor
#Used to get command line arguments
import sys
import os
#Used to check validity of date
from datetime import datetime, timedelta
from TFMLP import MLPR
import Utils
from Utils import fet... | cryptomon-io/mlrp-and-kneighborsregressor | main.py | main.py | py | 6,222 | python | en | code | 3 | github-code | 71 | [
{
"api_name": "datetime.datetime.now",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 46,
"usage_type": "name"
},
{
"api_name": "os.environ",
"line_number": 51,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
... |
4185130796 |
"""
Compuatational Physics II
Project 10
Lalit Chauhdary
l.chaudhary@jacobs-university.de
"""
import numpy as np
import matplotlib.pyplot as plt
#Discrete Fourier Transform
def DFT(ft):
N = len(ft)
fw= [] #to store result of DFT
for m in range(N):
sum = 0.0
for n in ran... | lalit3c/Computational_Physics | Project 10/DFT.py | DFT.py | py | 2,297 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "numpy.exp",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.pi",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "numpy.sqrt",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.exp",
"line_number": 29,... |
4221771384 | import hashlib
import sys
# your gen-py dir
sys.path.append('./gen-py')
from ril.ttypes import *
import json
class FileData():
def __init__(self, instanceName=None):
self.inputfilename=f"/var/lib/data-test/{instanceName}_inputs.json"
self.outputfilename=f"/var/lib/data-test/{instanceN... | RaspInLoop/ria-cosimulation-worker | tests/thrift_server_test/server/FileData.py | FileData.py | py | 1,396 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "sys.path.append",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "json.load",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": ... |
16556206773 | import torch
from transformers import (
DistilBertForSequenceClassification,
DistilBertForTokenClassification,
DistilBertTokenizer,
)
MODEL_SA = "./app/model/model_sa_v7"
MODEL_MLC = "./app/model/model_mlc_v7"
MODEL_NER = "./app/model/model_ner_v7"
MODEL_SA_OUT = "./out/sa/"
MODEL_MLC_OUT = "./out/mlc/"
M... | cqtan/ma-zdash-nlp | app/utils/generate_model_configs.py | generate_model_configs.py | py | 1,670 | python | en | code | 1 | github-code | 71 | [
{
"api_name": "transformers.DistilBertTokenizer.from_pretrained",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "transformers.DistilBertTokenizer",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "transformers.DistilBertForSequenceClassification.from_pretraine... |
36721049419 | from matplotlib import pyplot as plt
from collections import deque
from threading import Lock, Thread
import myo
import time
import numpy as np
import pandas as pd
from sklearn.discriminant_analysis import LinearDiscriminantAnalysis
from socket import socket, AF_INET, SOCK_DGRAM
from statistics import mode
... | koji0919/EMG_processing | EMG_ShowAndRec.py | EMG_ShowAndRec.py | py | 10,555 | python | ja | code | 0 | github-code | 71 | [
{
"api_name": "numpy.array",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "collections.deque",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "sklearn.discriminant_analysis.LinearDiscriminantAnalysis",
"line_number": 31,
"usage_type": "call"
},
{... |
74604799270 | """
We start with mnist, then do something else
"""
import numpy as np
import torch.optim
import torch
import torchvision.datasets as datasets
import pandas as pd
import sklearn.decomposition
import sklearn.metrics
from pathlib import Path
import torch
import torchvision
import torchvision.datasets as datasets
cla... | brandao-eduardo/ismynndrivenbymdl | mnist_like_data.py | mnist_like_data.py | py | 5,989 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "torchvision.datasets.MNIST",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "torchvision.datasets",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "numpy.random.seed",
"line_number": 44,
"usage_type": "call"
},
{
"api_name":... |
72767766951 | #!/usr/bin/env python
import numpy as np
import matplotlib.pyplot as plt
import matplotlib
import MITgcmutils as mit
plt.ion()
matplotlib.rcParams['ps.useafm'] = True
matplotlib.rcParams['pdf.use14corefonts'] = True
matplotlib.rcParams['text.usetex'] = True
dir0 = '../run/'
file1 = 'diagU*'
file2 = 'diagV*'
fil... | bderembl/mitgcm_configs | eddy_airsea/analysis/momentum_budget.py | momentum_budget.py | py | 2,957 | python | en | code | 2 | github-code | 71 | [
{
"api_name": "matplotlib.pyplot.ion",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "matplotlib.rcParams",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "matp... |
20085774600 | """
Create a CHATGPT chatbot that can perform Q&A over Joplin notes.
Created on Jun 2023
@author: Dina Berenbaum
"""
import os
import glob
import weaviate
from langchain.document_loaders import UnstructuredMarkdownLoader
from langchain.embeddings import OpenAIEmbeddings
from langchain.indexes import V... | dinaber/qa-docs-langchain | create_chatbot_over_joplin.py | create_chatbot_over_joplin.py | py | 5,050 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "langchain.embeddings.OpenAIEmbeddings",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "langchain.text_splitter.RecursiveCharacterTextSplitter",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "langchain.vectorstores.Weaviate",
"line_number":... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.