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
36191816908
from aiohttp import web from chessviz import main async def handle(request): gid = request.match_info.get("gid") ans = main(gid) return web.Response(body=ans, content_type="image/svg+xml") async def make_app(): app = web.Application(client_max_size=10 * 1024**2) app.add_routes([web.get("/{gid}"...
louisabraham/chessviz
api.py
api.py
py
418
python
en
code
1
github-code
1
[ { "api_name": "chessviz.main", "line_number": 8, "usage_type": "call" }, { "api_name": "aiohttp.web.Response", "line_number": 9, "usage_type": "call" }, { "api_name": "aiohttp.web", "line_number": 9, "usage_type": "name" }, { "api_name": "aiohttp.web.Application",...
20800064791
from selenium import webdriver from time import sleep import os from selenium.webdriver.common.keys import Keys from selenium.webdriver.common.by import By from bs4 import BeautifulSoup import urllib.request import random import pandas as pd browser = webdriver.Chrome(executable_path="./chromedriver.exe") browser.m...
hongha0111/CS232_LAB1_Crawler_Text
crawl_image.py
crawl_image.py
py
1,789
python
en
code
0
github-code
1
[ { "api_name": "selenium.webdriver.Chrome", "line_number": 12, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 12, "usage_type": "name" }, { "api_name": "time.sleep", "line_number": 14, "usage_type": "call" }, { "api_name": "time.sleep", ...
71679994274
import re import json from lib.configLoader import config from lib.xlsGetter import request_table template = { 'weeks': config['weeks'], 'lessons': config['lessons'], 'blank': config['blank'], 'time': config['time'], 'courses': config['courses'] } footer_match_list = [ '(体育).+?◇(.+?)◇(\\d+-\\...
Chenrt-ggx/CTWC
public/lib/xlsParser.py
xlsParser.py
py
3,864
python
en
code
1
github-code
1
[ { "api_name": "lib.configLoader.config", "line_number": 8, "usage_type": "name" }, { "api_name": "lib.configLoader.config", "line_number": 9, "usage_type": "name" }, { "api_name": "lib.configLoader.config", "line_number": 10, "usage_type": "name" }, { "api_name": ...
36224236886
#Author-Peter Ludikar, Gary Singer #Description-An Add-In for making dog-bone fillets. # Peter completely revamped the dogbone add-in by Casey Rogers and Patrick Rainsberry and David Liu # Some of the original utilities have remained, but a lot of the other functionality has changed. # The original add-in was based o...
pludikar/dogbone2
DogBone2.py
DogBone2.py
py
60,061
python
en
code
7
github-code
1
[ { "api_name": "logging.NOTSET", "line_number": 34, "usage_type": "attribute" }, { "api_name": "adsk.core.fusion", "line_number": 41, "usage_type": "attribute" }, { "api_name": "adsk.core", "line_number": 41, "usage_type": "name" }, { "api_name": "adsk.core.core", ...
10579008900
import logging import json from application.service import ClubService from flask import Blueprint from flask import request, Response from application.auth.google_auth import auth_required, get_token_info log = logging.getLogger('werkzeug') log.setLevel(logging.ERROR) # Variable declaration application_json = "appl...
SoamyaAgrawal17/SAVS
application/controller/ClubsController.py
ClubsController.py
py
3,734
python
en
code
0
github-code
1
[ { "api_name": "logging.getLogger", "line_number": 9, "usage_type": "call" }, { "api_name": "logging.ERROR", "line_number": 10, "usage_type": "attribute" }, { "api_name": "flask.Blueprint", "line_number": 17, "usage_type": "call" }, { "api_name": "application.servi...
41973501255
from musikla.core.events.transformers.transformer import Transformer from musikla.core.events.transformers.balance_notes import BalanceNotesTransformer from musikla.core.events.transformers.compose_notes import ComposeNotesTransformer from musikla.audio.player import PlayerLike from musikla.audio.interactive_player imp...
pedromsilvapt/miei-dissertation
code/musikla/musikla/libraries/keyboard/buffer.py
buffer.py
py
7,137
python
en
code
0
github-code
1
[ { "api_name": "musikla.core.context.Context", "line_number": 14, "usage_type": "name" }, { "api_name": "musikla.parser.abstract_syntax_tree.statements.StatementsListNode", "line_number": 21, "usage_type": "call" }, { "api_name": "musikla.parser.abstract_syntax_tree.statements", ...
31461333551
# Get the PIDs of datasets in a given dataverse (and optionally any dataverses in that dataverse). # Includes deaccessioned datasets. Excludes harvested and linked datasets. import csv import glob import json import os import requests import sys import time from tkinter import filedialog from tkinter import ttk from t...
jggautier/dataverse-scripts
other_scripts/get_dataset_PIDs.py
get_dataset_PIDs.py
py
15,027
python
en
code
5
github-code
1
[ { "api_name": "tkinter.filedialog.askdirectory", "line_number": 30, "usage_type": "call" }, { "api_name": "tkinter.filedialog", "line_number": 30, "usage_type": "name" }, { "api_name": "tkinter.ttk.Button", "line_number": 120, "usage_type": "call" }, { "api_name":...
37402723277
from warnings import warn from statsmodels.sandbox.distributions.extras import ACSkewT_gen from .check_nd_array_for_bad import check_nd_array_for_bad def fit_skew_t_pdf( _1d_array, fit_fixed_location=None, fit_fixed_scale=None, fit_initial_location=None, fit_initial_scale=None, ): _1d_array...
UCSD-CCAL/ccal
ccal/fit_skew_t_pdf.py
fit_skew_t_pdf.py
py
1,775
python
en
code
0
github-code
1
[ { "api_name": "check_nd_array_for_bad.check_nd_array_for_bad", "line_number": 16, "usage_type": "call" }, { "api_name": "statsmodels.sandbox.distributions.extras.ACSkewT_gen", "line_number": 48, "usage_type": "call" }, { "api_name": "warnings.warn", "line_number": 56, "us...
28919536409
import matplotlib.pyplot as plt f = open("biggest_cities.txt", "r") plt.plot([int(x.split(",")[3]) for x in f.readlines()][:15]) plt.ylabel("City size") plt.xlabel("City rank") plt.show() f.close()
nicholasz2510/zipf-from-text
just_list.py
just_list.py
py
201
python
en
code
0
github-code
1
[ { "api_name": "matplotlib.pyplot.plot", "line_number": 5, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 5, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.ylabel", "line_number": 6, "usage_type": "call" }, { "api_name": "matplo...
70137787875
import asyncio class CommentExecutor: def __init__(self): self.work_queue = asyncio.Queue() async def add_video(self, new_vids): for vid in new_vids: await self.work_queue.put(vid) async def execute(self, task, num_workers=5): tasks = [asyncio.create_task(task(sel...
ZutrixPog/youtube-comments-extractor
comments/executor.py
executor.py
py
402
python
en
code
6
github-code
1
[ { "api_name": "asyncio.Queue", "line_number": 6, "usage_type": "call" }, { "api_name": "asyncio.create_task", "line_number": 13, "usage_type": "call" }, { "api_name": "asyncio.gather", "line_number": 15, "usage_type": "call" } ]
27867302737
"""Prepare entry and gone transactions from comparing local hierarchy with proxy data.""" import datetime as dti import pathlib import random from typing import Union from kiertotie import ( BASE_URL, DASH, EASING, ENCODING, ESP, HTTP_404_BYTES_TOKEN, HTTP_404_BYTES_TOKEN_LENGTH, HTTP_4...
sthagen/kiertotie
kiertotie/update.py
update.py
py
10,067
python
en
code
3
github-code
1
[ { "api_name": "typing.Union", "line_number": 30, "usage_type": "name" }, { "api_name": "pathlib.Path", "line_number": 30, "usage_type": "attribute" }, { "api_name": "kiertotie.ENCODING", "line_number": 32, "usage_type": "name" }, { "api_name": "kiertotie.NL.join",...
9557658847
import ssl import re import json import requests import csv import urllib3 import argparse import sys urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) STR_POST_SERVICE_TEMPLATE_OK = '[->] service %s for template %s was created with status code %s' STR_POST_SERVICE_TEMPLATE_NOK ...
versa-networks/devops
python/VOS Framework/object-create/service-create.py
service-create.py
py
5,606
python
en
code
6
github-code
1
[ { "api_name": "urllib3.disable_warnings", "line_number": 10, "usage_type": "call" }, { "api_name": "urllib3.exceptions", "line_number": 10, "usage_type": "attribute" }, { "api_name": "requests.get", "line_number": 30, "usage_type": "call" }, { "api_name": "re.matc...
33926594806
import subprocess import argparse import os from time import * parser = argparse.ArgumentParser() parser.add_argument("--dataset_path", type=str) parser.add_argument("--scene_path", type=str) parser.add_argument("--pair_file", type=str) parser.add_argument("--kernel_path", type=str) parser.add_argument("--img_path", t...
shaochangxu/DenseReconstruction-CMD
Kernel/colmap_script.py
colmap_script.py
py
4,934
python
en
code
0
github-code
1
[ { "api_name": "argparse.ArgumentParser", "line_number": 6, "usage_type": "call" }, { "api_name": "os.system", "line_number": 34, "usage_type": "call" }, { "api_name": "os.popen", "line_number": 36, "usage_type": "call" }, { "api_name": "os.popen", "line_number...
21173485215
import matplotlib.pyplot as plt x_values = list(range(1, 1001)) y_values = [x**2 for x in x_values] plt.scatter(x_values, y_values, c=y_values, s=40) # plt.scatter(x_values, y_values, c=y_values, cmap=plt.cm.Blues, edgecolor='nome', s=40) # Definindo o titulo do gráfico e nomeia os eixos x e y plt.title("Square Num...
martinssantoscristiano/Gerando_Dados
scatter_squares.py
scatter_squares.py
py
741
python
pt
code
1
github-code
1
[ { "api_name": "matplotlib.pyplot.scatter", "line_number": 7, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 7, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.title", "line_number": 11, "usage_type": "call" }, { "api_name": "mat...
34214467939
import torch import torch.nn as nn import pdb import logging class rnn_net(nn.Module): def __init__(self, dim_embeddings, num_classes, similarity="inner_product", hidden_size=128, num_layers=1, rnn_dropout=0.2, clf_dropout=0.3, bidirectional=False): super(rnn_net, self).__init__() self...
hsinlichu/Customer-Service-Data-Analysis-with-Machine-Learning-Technique
src/modules/net.py
net.py
py
1,528
python
en
code
1
github-code
1
[ { "api_name": "torch.nn.Module", "line_number": 6, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 6, "usage_type": "name" }, { "api_name": "torch.nn.LSTM", "line_number": 18, "usage_type": "call" }, { "api_name": "torch.nn", "line_number...
18323419280
import itertools def combsum(thelist,serchednum): res = 0 for n in range(2,len(thelist),1): for eachcomb in itertools.combinations(thelist,n): if round(sum(eachcomb),2) == round(serchednum,2): res = eachcomb break # # ...
costiagur/comsum
combsum.py
combsum.py
py
429
python
en
code
0
github-code
1
[ { "api_name": "itertools.combinations", "line_number": 6, "usage_type": "call" } ]
38094427184
import pytest from tests.utils import assertDictContainsKeyWithValue from wiremock.resources.mappings import ( AllMappings, BasicAuthCredentials, DelayDistribution, DelayDistributionMethods, Mapping, MappingMeta, MappingRequest, MappingResponse, ) @pytest.mark.unit @pytest.mark.serial...
wiremock/python-wiremock
tests/test_resources/test_mapping/test_mapping_serialization.py
test_mapping_serialization.py
py
12,311
python
en
code
44
github-code
1
[ { "api_name": "wiremock.resources.mappings.BasicAuthCredentials", "line_number": 20, "usage_type": "call" }, { "api_name": "pytest.mark", "line_number": 16, "usage_type": "attribute" }, { "api_name": "pytest.mark", "line_number": 17, "usage_type": "attribute" }, { ...
73510344352
from argparse import ArgumentParser from Common.HttpFileManager.webApplication import app as application def parse_args(): parser = ArgumentParser() parser.add_argument( "-i", "--hostname", dest="HOSTNAME", default='localhost', help="ip of server host.") parser.add_argument( "-p", "--port", dest="PORT", def...
msm3858/Bottle
Common/HttpFileManager/httpFileManager.py
httpFileManager.py
py
523
python
en
code
0
github-code
1
[ { "api_name": "argparse.ArgumentParser", "line_number": 7, "usage_type": "call" }, { "api_name": "Common.HttpFileManager.webApplication.app.run", "line_number": 20, "usage_type": "call" }, { "api_name": "Common.HttpFileManager.webApplication.app", "line_number": 20, "usag...
73501756834
""" Author: Brian Mascitello Date: 12/15/2017 Websites: http://adventofcode.com/2017/day/14 Info: --- Day 14: Disk Defragmentation --- """ import copy from functools import reduce def construct_dense_hash(sparse_hash): constructed_hash = list() groups_of_sixteen = [sparse_hash[index:index +...
Brian-Mascitello/Advent-of-Code
Advent of Code 2017/Day 14 2017/Day14Q1 2017.py
Day14Q1 2017.py
py
3,327
python
en
code
0
github-code
1
[ { "api_name": "functools.reduce", "line_number": 16, "usage_type": "call" }, { "api_name": "copy.copy", "line_number": 40, "usage_type": "call" } ]
33092721708
import solution class Solution(solution.Solution): def solve(self, test_input=None): source, target, allowedSwaps = test_input return self.minimumHammingDistance(list(source), list(target), [x[:] for x in allowedSwaps]) def minimumHammingDistance(self, source, target, allowedSwaps): "...
QuBenhao/LeetCode
problems/1722/solution.py
solution.py
py
2,350
python
en
code
8
github-code
1
[ { "api_name": "solution.Solution", "line_number": 4, "usage_type": "attribute" }, { "api_name": "collections.defaultdict", "line_number": 26, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 27, "usage_type": "call" }, { "api_name": ...
43534691253
import requests from bs4 import BeautifulSoup import sys import re import numpy as np import sys import urllib3 urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) ## 找出表特版2017第一篇文的文章列表url (2017/12/31) def find_first_url(start_date, start_year, url): ''' input: start_date: 1/01 (str), ...
30stomercury/ptt_crawler
ptt_crawler.py
ptt_crawler.py
py
10,538
python
en
code
0
github-code
1
[ { "api_name": "urllib3.disable_warnings", "line_number": 8, "usage_type": "call" }, { "api_name": "urllib3.exceptions", "line_number": 8, "usage_type": "attribute" }, { "api_name": "requests.session", "line_number": 23, "usage_type": "call" }, { "api_name": "bs4.B...
28410209117
from typing import Optional import unittest class TreeNode: def __init__(self, val=0, left=None, right=None): self.val = val self.left = left self.right = right class Solution: def isValidBSTHelper( self, root: Optional[TreeNode], min=float("-inf"), max=float("inf") ) -> ...
teimurjan/leetcode
is-valid-bst.py
is-valid-bst.py
py
1,783
python
en
code
0
github-code
1
[ { "api_name": "typing.Optional", "line_number": 14, "usage_type": "name" }, { "api_name": "unittest.TestCase", "line_number": 30, "usage_type": "attribute" }, { "api_name": "unittest.main", "line_number": 67, "usage_type": "call" } ]
16557291805
# https://www.acmicpc.net/problem/2529 # Solved Date: 20.05.02. import sys import itertools read = sys.stdin.readline def check_inequality(sign, ans_num, select_num): if (sign == '<' and ans_num < select_num) or \ (sign == '>' and ans_num > select_num): return True else: return F...
imn00133/algorithm
BaekJoonOnlineJudge/CodePlus/500BruteForce/PermutationPractice/baekjoon_2529.py
baekjoon_2529.py
py
2,251
python
en
code
0
github-code
1
[ { "api_name": "sys.stdin", "line_number": 7, "usage_type": "attribute" }, { "api_name": "itertools.permutations", "line_number": 44, "usage_type": "call" } ]
24752099819
# -*- coding: utf-8 -*- import scrapy from scrapy.spiders import Spider from justiaspider.items import JustiaItem from scrapy import Request from time import sleep class ToScrapeSpiderXPath(scrapy.Spider): name = 'justia' headers = { 'User-Agent': 'Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N...
oerdem19/justiaspider
spider/justiaspider/justiaspider/spiders/justia.py
justia.py
py
3,902
python
en
code
0
github-code
1
[ { "api_name": "scrapy.Spider", "line_number": 9, "usage_type": "attribute" }, { "api_name": "scrapy.Request", "line_number": 37, "usage_type": "call" }, { "api_name": "scrapy.Request", "line_number": 46, "usage_type": "call" }, { "api_name": "scrapy.Request", ...
15305050980
# features.py import glob, os, sys, math, warnings, copy, time, glob, logging import numpy as np from scipy.optimize import linear_sum_assignment from scipy.spatial import distance import pandas as pd from scipy.stats import multivariate_normal from hmmlearn import hmm logging.basicConfig(format='%(asctime)s | %(level...
samshipengs/Coordinated-Multi-Agent-Imitation-Learning
code/hidden_role_learning.py
hidden_role_learning.py
py
7,125
python
en
code
37
github-code
1
[ { "api_name": "logging.basicConfig", "line_number": 10, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 11, "usage_type": "attribute" }, { "api_name": "sys.stdout", "line_number": 11, "usage_type": "attribute" }, { "api_name": "numpy.array", ...
23551628136
# General references: # 0. https://github.com/lttkgp/youtube_title_parse # 1. https://tinyurl.com/y5pewlw3 # 2. https://developers.google.com/youtube/v3/getting-started # 3. https://developers.google.com/youtube/v3/quickstart/python # 4. https://github.com/TheComeUpCode/SpotifyGeneratePlaylist/blob/master/create_playli...
LongPhan1912/Youtube-Playlist-Extractor
main-extractor.py
main-extractor.py
py
9,415
python
en
code
0
github-code
1
[ { "api_name": "googleapiclient.discovery.build", "line_number": 42, "usage_type": "call" }, { "api_name": "youtube_title_parse.get_artist_title", "line_number": 145, "usage_type": "call" }, { "api_name": "json.dump", "line_number": 177, "usage_type": "call" }, { "...
38937917036
import errno import os import socket from typing import AnyStr, cast, Dict, List, Optional, Tuple, Union from six import ensure_str import cmk.utils.debug import cmk.utils.paths import cmk.utils.store as store from cmk.utils.exceptions import MKTerminate, MKTimeout, MKIPAddressLookupError from cmk.utils.log import co...
superbjorn09/checkmk
cmk/base/ip_lookup.py
ip_lookup.py
py
11,074
python
en
code
null
github-code
1
[ { "api_name": "typing.Tuple", "line_number": 19, "usage_type": "name" }, { "api_name": "cmk.utils.type_defs.HostName", "line_number": 19, "usage_type": "name" }, { "api_name": "typing.Dict", "line_number": 20, "usage_type": "name" }, { "api_name": "typing.Dict", ...
31050124182
"""rank_text.py For a given document, process and prepare scoring. """ import pandas as pd import matplotlib.pyplot as plt import os import re from snownlp import SnowNLP from string import punctuation, whitespace from os import path class Snippet: def __init__(self, text, meta): # meta includes author, t...
jyesawtellrickson/mandarin
app/snippet.py
snippet.py
py
5,631
python
en
code
2
github-code
1
[ { "api_name": "pandas.read_csv", "line_number": 50, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 50, "usage_type": "call" }, { "api_name": "os.path", "line_number": 50, "usage_type": "name" }, { "api_name": "os.path.dirname", "line_numb...
11324370328
from __future__ import annotations from typing import List, TYPE_CHECKING, Optional from . import utils from .asset import Asset from .flags import ApplicationFlags from .permissions import Permissions if TYPE_CHECKING: from .guild import Guild from .types.appinfo import ( AppInfo as AppInfoPayload, ...
Rapptz/discord.py
discord/appinfo.py
appinfo.py
py
11,623
python
en
code
13,719
github-code
1
[ { "api_name": "typing.TYPE_CHECKING", "line_number": 10, "usage_type": "name" }, { "api_name": "state.ConnectionState", "line_number": 137, "usage_type": "name" }, { "api_name": "types.appinfo.AppInfo", "line_number": 137, "usage_type": "name" }, { "api_name": "st...
15702759585
import collections tasks = collections.OrderedDict() tasks[8031] = "Backup" tasks[4027] = "Scan email" tasks[5733] = "Build system" tasks[8031] = "Denni zaloha" print(list(tasks.keys())) unsorted = dict() unsorted[8031] = "Backup" unsorted[4027] = "Scan email" unsorted[5733] = "Build system" unsorted[8031] = "Denni za...
zabojnikp/study
Python_Projects/python3_selfstudy/lekce_3/usporadany_slovnik.py
usporadany_slovnik.py
py
355
python
en
code
0
github-code
1
[ { "api_name": "collections.OrderedDict", "line_number": 2, "usage_type": "call" } ]
41054476106
""" Unit tests for config_rules.py. """ import boto3 from botocore.exceptions import ClientError import pytest from config_rules import ConfigWrapper @pytest.mark.parametrize("error_code", [None, "TestException"]) def test_put_config_rule(make_stubber, error_code): config_client = boto3.client("config") con...
awsdocs/aws-doc-sdk-examples
python/example_code/config/test/test_config_rules.py
test_config_rules.py
py
2,567
python
en
code
8,378
github-code
1
[ { "api_name": "boto3.client", "line_number": 14, "usage_type": "call" }, { "api_name": "config_rules.ConfigWrapper", "line_number": 16, "usage_type": "call" }, { "api_name": "pytest.raises", "line_number": 35, "usage_type": "call" }, { "api_name": "botocore.except...
69905459873
"""Support for myUplink sensors.""" from __future__ import annotations import logging from homeassistant.components.number import ( NumberEntity, NumberDeviceClass, ) from homeassistant.config_entries import ConfigEntry from homeassistant.core import HomeAssistant from homeassistant.helpers.entity_platform im...
jaroschek/home-assistant-myuplink
custom_components/myuplink/number.py
number.py
py
2,209
python
en
code
11
github-code
1
[ { "api_name": "logging.getLogger", "line_number": 19, "usage_type": "call" }, { "api_name": "homeassistant.core.HomeAssistant", "line_number": 23, "usage_type": "name" }, { "api_name": "homeassistant.config_entries.ConfigEntry", "line_number": 23, "usage_type": "name" }...
74738491234
"""Add multimention table Revision ID: 003 Revises: 002 Create Date: 2016-04-08 10:53:44.115348 """ # revision identifiers, used by Alembic. revision = '003' down_revision = '002' branch_labels = None depends_on = None from alembic import op import sqlalchemy as sa def upgrade(): ### commands auto generated b...
belak/python-seabird
migrations/versions/003_add_multimention_table.py
003_add_multimention_table.py
py
859
python
en
code
0
github-code
1
[ { "api_name": "alembic.op.create_table", "line_number": 21, "usage_type": "call" }, { "api_name": "alembic.op", "line_number": 21, "usage_type": "name" }, { "api_name": "sqlalchemy.Column", "line_number": 22, "usage_type": "call" }, { "api_name": "sqlalchemy.Integ...
39998651204
import copy from links import Links from distance import distance from ROOT import TVector3 def merge_clusters(elements, layer): merged = [] elem_in_layer = [] elem_other = [] for elem in elements: if elem.layer == layer: elem_in_layer.append(elem) else: elem_ot...
cbernet/heppy
heppy/papas/pfalgo/merger.py
merger.py
py
828
python
en
code
9
github-code
1
[ { "api_name": "links.Links", "line_number": 16, "usage_type": "call" }, { "api_name": "distance.distance", "line_number": 16, "usage_type": "argument" }, { "api_name": "links.groups.values", "line_number": 17, "usage_type": "call" }, { "api_name": "links.groups", ...
71435223394
import requests api_url = 'http://3.109.224.64:8080' def turn_motor_off(): try: data = {'status': 'off'} response = requests.post(f'{api_url}/motor/update', json=data) response_data = response.json() return response_data except Exception as e: return {'...
yascio/sih-prototype
motor_off.py
motor_off.py
py
464
python
en
code
0
github-code
1
[ { "api_name": "requests.post", "line_number": 10, "usage_type": "call" } ]
12496357516
import json from dataclasses import asdict from datetime import datetime from typing import List from unittest import mock import hypothesis import pytest from hypothesis.strategies import ( dictionaries, integers, just, lists, sampled_from, text, ) from pydantic import ConfigDict from pydantic...
NHSDigital/nrlf-converter
nrlf_converter/convert_nrl_to_r4/tests/test_nrl_to_r4.py
test_nrl_to_r4.py
py
7,324
python
en
code
0
github-code
1
[ { "api_name": "nrlf_converter.r4.document_reference.DocumentReference", "line_number": 42, "usage_type": "name" }, { "api_name": "pydantic.dataclasses.dataclass", "line_number": 41, "usage_type": "call" }, { "api_name": "pydantic.ConfigDict", "line_number": 41, "usage_typ...
24061391126
from openpyxl.worksheet.worksheet import Worksheet from utilities import format_cell, get_named_value class Table: class Item: pass def __init__(self, sheet: Worksheet, table_name: str) -> None: self.sheet = sheet self.columns, self.items = Table.read_excel_table(self.sheet, table_na...
flolbr/InvoiceGenerator
table.py
table.py
py
1,662
python
en
code
0
github-code
1
[ { "api_name": "openpyxl.worksheet.worksheet.Worksheet", "line_number": 10, "usage_type": "name" }, { "api_name": "openpyxl.worksheet.worksheet.Worksheet", "line_number": 18, "usage_type": "name" }, { "api_name": "utilities.format_cell", "line_number": 40, "usage_type": "c...
35596840111
# !/usr/bin/env python # coding=utf-8 """ author: yonas """ import argparse import torch import numpy as np from pathlib import Path from transformers import BertTokenizer, AutoTokenizer, RobertaTokenizer from datautils import NerExample, Any2Id, file2list import time, copy, os # import ipdb try: from prefetch_g...
Qznan/QizNER
data_reader.py
data_reader.py
py
22,118
python
en
code
2
github-code
1
[ { "api_name": "torch.utils", "line_number": 21, "usage_type": "attribute" }, { "api_name": "prefetch_generator.BackgroundGenerator", "line_number": 23, "usage_type": "call" }, { "api_name": "transformers.AutoTokenizer", "line_number": 34, "usage_type": "name" }, { ...
12839162951
#!/usr/bin/env python # coding: utf-8 # <a href="https://colab.research.google.com/github/pratikunterwegs/elemove/blob/master/temp_kruger.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # In[ ]: import subprocess try: import geemap except Im...
pratikunterwegs/elemove
python/02_get_landsat_data.py
02_get_landsat_data.py
py
2,842
python
en
code
8
github-code
1
[ { "api_name": "subprocess.check_call", "line_number": 15, "usage_type": "call" }, { "api_name": "ee.Initialize", "line_number": 28, "usage_type": "call" }, { "api_name": "ee.Authenticate", "line_number": 30, "usage_type": "call" }, { "api_name": "ee.Initialize", ...
30453705281
#! /usr/bin/env python #! -*- coding: utf-8 -*- import sqlite3, copy, datetime from pathlib import Path root_path = '../databases' dbfile = 'call_calibrations.db' agentdb = Path(root_path,dbfile) def get_details(func): def wrapper(_search_name): con = sqlite3.connect(agentdb) with con: ...
alan1world/call_calibrations
call_calibrations/test.py
test.py
py
2,880
python
en
code
0
github-code
1
[ { "api_name": "pathlib.Path", "line_number": 10, "usage_type": "call" }, { "api_name": "sqlite3.connect", "line_number": 14, "usage_type": "call" }, { "api_name": "sqlite3.connect", "line_number": 31, "usage_type": "call" }, { "api_name": "sqlite3.connect", "l...
410962230
"""Provides a lift over annotator and helpers.""" import logging from typing import Any, Optional from dae.annotation.annotation_pipeline import AnnotationPipeline from dae.annotation.annotation_pipeline import Annotator from dae.annotation.annotation_pipeline import AnnotatorInfo from dae.annotation.annotation_pipel...
iossifovlab/gpf
dae/dae/annotation/liftover_annotator.py
liftover_annotator.py
py
7,386
python
en
code
1
github-code
1
[ { "api_name": "logging.getLogger", "line_number": 23, "usage_type": "call" }, { "api_name": "dae.annotation.annotation_pipeline.AnnotationPipeline", "line_number": 26, "usage_type": "name" }, { "api_name": "dae.annotation.annotation_pipeline.AnnotatorInfo", "line_number": 27,...
32935036695
import email.utils import smtplib from email.mime.application import MIMEApplication from tkinter import messagebox from string import Template from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText from time import sleep import os import csv import configparser """ autor: Pedrozo Juan Mar...
FZMartin/mailing_app
common_services.py
common_services.py
py
8,609
python
en
code
0
github-code
1
[ { "api_name": "smtplib.SMTP_SSL", "line_number": 41, "usage_type": "call" }, { "api_name": "smtplib.SMTPException", "line_number": 60, "usage_type": "attribute" }, { "api_name": "tkinter.messagebox.showerror", "line_number": 62, "usage_type": "call" }, { "api_name...
25877808240
''' @author: jmc ''' from setuptools import setup, find_packages version = '1.3.0' setup( name='odn-ckancommons', version=version, description=""" CKAN's commons for development of ODN related extensions """, long_description=""" """, classifiers=[], # Get strings from http://pypi.pyth...
OpenDataNode/odn-ckancommons
setup.py
setup.py
py
657
python
en
code
0
github-code
1
[ { "api_name": "setuptools.setup", "line_number": 8, "usage_type": "call" }, { "api_name": "setuptools.find_packages", "line_number": 22, "usage_type": "call" } ]
14913214995
#!/usr/bin/env python """Distutils setup file""" import ez_setup ez_setup.use_setuptools() from setuptools import setup # Metadata PACKAGE_NAME = "BytecodeAssembler" PACKAGE_VERSION = "0.6.1" PACKAGES = ['peak', 'peak.util'] def get_description(): # Get our long description from the documentation f = open('RE...
PEAK-Legacy/BytecodeAssembler
setup.py
setup.py
py
1,176
python
en
code
1
github-code
1
[ { "api_name": "ez_setup.use_setuptools", "line_number": 4, "usage_type": "call" }, { "api_name": "setuptools.setup", "line_number": 26, "usage_type": "call" } ]
35987328488
import aiohttp from furl import furl from typing import Optional class PapaJohnsClient: def __init__(self, url: str, city_id: int, restaurant_id: int): self.base_url = url self.city_id = city_id self.restaurant_id = restaurant_id @staticmethod async def _query( url: furl, ...
Fisab/foodtech_clients
foodtech_clients/papa_johns.py
papa_johns.py
py
2,361
python
en
code
0
github-code
1
[ { "api_name": "furl.furl", "line_number": 14, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 14, "usage_type": "name" }, { "api_name": "aiohttp.ClientSession", "line_number": 16, "usage_type": "call" }, { "api_name": "furl.furl", "line...
37157061629
import pygame import ui import art import utilities class Inventory(object): def __init__(self): self.items = {"Weapon": [], "Armor": [], "Commodity": [], "Misc": []} def add_item(self, item_to_add): category = item_to_add.item...
z-van-baars/embark
inventory.py
inventory.py
py
17,855
python
en
code
0
github-code
1
[ { "api_name": "ui.Menu", "line_number": 23, "usage_type": "attribute" }, { "api_name": "pygame.sprite.Sprite", "line_number": 74, "usage_type": "call" }, { "api_name": "pygame.sprite", "line_number": 74, "usage_type": "attribute" }, { "api_name": "art.inventory_ba...
22020730306
from . import app from .models import Survey from flask import url_for, session, request from twilio.twiml.messaging_response import MessagingResponse from sms_app.send_sms import client from sms_app.scan_email import survey_prompt, welcome_message import datetime @app.route('/message') def sms_survey(): response ...
picsul/short-message-survey
sms_app/survey_view.py
survey_view.py
py
2,680
python
en
code
1
github-code
1
[ { "api_name": "twilio.twiml.messaging_response.MessagingResponse", "line_number": 11, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 13, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 13, "usage_type": "attribute" ...
15252733263
import os import sys import random from os.path import dirname, basename, isfile import glob import inspect import re import copy import numpy as np from collections import deque, defaultdict from string import Formatter import generatorUtils as gu CUR_DIR = os.path.dirname(__file__) CODEORG_DIR = os.path.join(CUR_D...
malik-ali/generative-grading
src/rubricsampling/engine.py
engine.py
py
8,838
python
en
code
5
github-code
1
[ { "api_name": "os.path.dirname", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path", "line_number": 16, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path", "line_number"...
8087151518
import os from .forms import PostForm, EditProfileAdminForm, CommentForm from sqlalchemy.exc import IntegrityError from . import main from .. import db from ..models import User, Role, Post, Permission, Comment from flask import render_template ,redirect, url_for, request, current_app, jsonify, flash, abort, make_respo...
manyrices/look
app/main/views.py
views.py
py
10,249
python
en
code
0
github-code
1
[ { "api_name": "forms.PostForm", "line_number": 15, "usage_type": "call" }, { "api_name": "flask_login.current_user.can", "line_number": 16, "usage_type": "call" }, { "api_name": "flask_login.current_user", "line_number": 16, "usage_type": "name" }, { "api_name": "...
24605712534
from HoG_SVM_SlidingWindow import * from define_parameter_dict import params_dict from moviepy.editor import VideoFileClip import numpy as np with open(params_dict['svm_pickel_file_for_video'],'rb') as fp: [cl_svm_vid, std_scaler_vid] = pickle.load(fp) scale_list = params_dict['detection_scales'] consecutive_appea...
skbhat/SDC-P5
process_video.py
process_video.py
py
2,857
python
en
code
0
github-code
1
[ { "api_name": "define_parameter_dict.params_dict", "line_number": 6, "usage_type": "name" }, { "api_name": "define_parameter_dict.params_dict", "line_number": 8, "usage_type": "name" }, { "api_name": "define_parameter_dict.params_dict", "line_number": 9, "usage_type": "na...
14891452818
from rest_framework import serializers from django_redis import get_redis_connection from redis.exceptions import RedisError import logging logger = logging.getLogger('django') class CheckImageCodeSerializer(serializers.Serializer): """ 图片验证码校验序列化器 """ image_code_id = serializers.UUIDField() text...
potatoxinxin/store
meiduo_mall/meiduo_mall/apps/verifications/serializers.py
serializers.py
py
1,970
python
zh
code
0
github-code
1
[ { "api_name": "logging.getLogger", "line_number": 6, "usage_type": "call" }, { "api_name": "rest_framework.serializers.Serializer", "line_number": 9, "usage_type": "attribute" }, { "api_name": "rest_framework.serializers", "line_number": 9, "usage_type": "name" }, { ...
24666498556
from django.shortcuts import render from .models import * from django.http import HttpResponse # Create your views here. def parent_views(request): return render(request, 'parent.html') def child_views(request): return render(request, 'child.html') def add_author_views(request): obj = Author(name='jianai...
smakerm/list
pyweb/django/my_project/day4/index/views.py
views.py
py
2,825
python
en
code
0
github-code
1
[ { "api_name": "django.shortcuts.render", "line_number": 7, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 10, "usage_type": "call" }, { "api_name": "django.http.HttpResponse", "line_number": 16, "usage_type": "call" }, { "api_name"...
29893442836
import datetime from django.conf import settings from django.utils.timezone import now from celery import shared_task from monascaclient import client as monasca_client from decouple import config from core.conf import conf_file from nova.models import Hypervisors, Servers monasca = monasca_client.Client( api_ver...
whasley/lsd-billing
monasca/tasks.py
tasks.py
py
4,939
python
en
code
0
github-code
1
[ { "api_name": "monascaclient.client.Client", "line_number": 11, "usage_type": "call" }, { "api_name": "monascaclient.client", "line_number": 11, "usage_type": "name" }, { "api_name": "decouple.config", "line_number": 12, "usage_type": "call" }, { "api_name": "djan...
70983035873
# data_loader.py import os import torch import numpy as np from torchvision import datasets, transforms from torch.utils.data import DataLoader, Subset def load_and_split_dataset(num_classes, num_clients, alpha, non_iid=False): transform = transforms.Compose([transforms.ToTensor(), transforms.Normalize((0.5,), (0....
Twinte/FedAVG_with_Entropy_Selection
data_loader.py
data_loader.py
py
2,567
python
en
code
0
github-code
1
[ { "api_name": "torchvision.transforms.Compose", "line_number": 9, "usage_type": "call" }, { "api_name": "torchvision.transforms", "line_number": 9, "usage_type": "name" }, { "api_name": "torchvision.transforms.ToTensor", "line_number": 9, "usage_type": "call" }, { ...
72660230113
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ migrations.Create...
edersonbrilhante/coleta-assinaturas
contador/migrations/0001_initial.py
0001_initial.py
py
3,169
python
en
code
0
github-code
1
[ { "api_name": "django.db.migrations.Migration", "line_number": 8, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 8, "usage_type": "name" }, { "api_name": "django.db.migrations.swappable_dependency", "line_number": 11, "usage_type": "call...
18994907838
from collections import defaultdict try: from itertools import zip_longest except ImportError: from itertools import izip_longest as zip_longest _NONE_TYPE = type(None) _EMPTY_TYPE = type('', (object,), {}) _MIXED_TYPE = type('<mixed-type>', (object,), {}) class AttrDict(dict): """A dict with keys access...
agroce/cs562w16
projects/xujing/hw4&5/examine.py
examine.py
py
8,372
python
en
code
2
github-code
1
[ { "api_name": "itertools.izip_longest", "line_number": 89, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 105, "usage_type": "call" } ]
21457893362
from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.common.keys import Keys options = webdriver.ChromeOptions() options.add_experimental_option("detach", True) driver = webdriver.Chrome(options=options) url = "https://www.wikipedia.org/" driver.get(url) search_bar = driv...
Know-Thyself/python-exercises
web_scraping/selenium-driver/interacting.py
interacting.py
py
744
python
en
code
0
github-code
1
[ { "api_name": "selenium.webdriver.ChromeOptions", "line_number": 5, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 5, "usage_type": "name" }, { "api_name": "selenium.webdriver.Chrome", "line_number": 7, "usage_type": "call" }, { "api_na...
8604083530
import math import numpy as np import matplotlib #matplotlib.use('Agg') import matplotlib.pyplot as plt from Model import Individual from Model import FitnessFunction import time from Model.PrintModule import PrintModule import multiprocessing import pygmo as pg import itertools from Model.DisplayHandler import Displ...
jurrutiag/Robotic-Manipulator
Model/GeneticAlgorithm.py
GeneticAlgorithm.py
py
31,658
python
en
code
0
github-code
1
[ { "api_name": "Model.FitnessFunction.FitnessFunction", "line_number": 104, "usage_type": "call" }, { "api_name": "Model.FitnessFunction", "line_number": 104, "usage_type": "name" }, { "api_name": "Model.PrintModule.PrintModule", "line_number": 128, "usage_type": "call" ...
74374471392
import subprocess import json def cacheMissHit(): try: api = json.loads(subprocess.check_output("varnishstat --json", shell=True, text=True)) except: return {"cacheHits": 0, "cacheMiss": 0, "hitRatio": 0, "backendFetches": 0, "backendFailures": 0, "backendFailRatio": 0} hit = api["counters"...
trentwiles/BARTAPI
varnishStat.py
varnishStat.py
py
1,413
python
en
code
1
github-code
1
[ { "api_name": "json.loads", "line_number": 6, "usage_type": "call" }, { "api_name": "subprocess.check_output", "line_number": 6, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 28, "usage_type": "call" }, { "api_name": "subprocess.check_output",...
26904398226
import sys from collections import deque input = sys.stdin.readline n = int(input()) lst = [] for _ in range(n): lst.append(list(input().strip())) visited = [] count = 0 dx = [1, -1, 0, 0] dy = [0, 0, 1, -1] for i in range(n): for j in range(n): if (i, j) not in visited and lst[i][j] != '0': ...
habaekk/Algorithm
boj/2667.py
2667.py
py
1,423
python
en
code
0
github-code
1
[ { "api_name": "sys.stdin", "line_number": 3, "usage_type": "attribute" }, { "api_name": "collections.deque", "line_number": 21, "usage_type": "call" } ]
8543674282
# -*- coding: UTF-8 -*- """ @Project : leetcode @File : 17-迭代构造二叉树.py @IDE : PyCharm @Author : Peter @Date : 06/12/2021 11:52 @Brief : 使用前序和中序遍历结构构造二叉树 """ from typing import List class TreeNode: def __init__(self, val=0, left=None, right=None): self.val = val self.left = left ...
JinkaiGUAN/Python-Office
1-DataStructure/leetcode/17-迭代构造二叉树.py
17-迭代构造二叉树.py
py
1,446
python
en
code
0
github-code
1
[ { "api_name": "typing.List", "line_number": 22, "usage_type": "name" } ]
43512977578
''' 347. 前 K 个高频元素 给定一个非空的整数数组,返回其中出现频率前 k 高的元素。 示例 1: 输入: nums = [1,1,1,2,2,3], k = 2 输出: [1,2] 示例 2: 输入: nums = [1], k = 1 输出: [1] 说明: 你可以假设给定的 k 总是合理的,且 1 ≤ k ≤ 数组中不相同的元素的个数。 你的算法的时间复杂度必须优于 O(n log n) , n 是数组的大小。 ''' from collections import Counter import heapq class...
km1994/leetcode
topic10_queue/T347_topKFrequent/interview.py
interview.py
py
1,036
python
zh
code
24
github-code
1
[ { "api_name": "collections.Counter", "line_number": 25, "usage_type": "call" }, { "api_name": "heapq.nlargest", "line_number": 26, "usage_type": "call" } ]
25985233479
# -*-coding:utf-8 -* """ 基于dqn的agent """ import numpy as np import random from agent import Agent import sys sys.path.append(sys.path[0].replace("agent","")) from config import args from policy_learning import DQN_dis class AgentDQN(Agent): def __init__(self, slot_set, disease_set, disease_symptom): super(...
Ccccandy/20211208
model3/agent/agent_dqn.py
agent_dqn.py
py
3,355
python
en
code
0
github-code
1
[ { "api_name": "sys.path.append", "line_number": 9, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "agent.Agent", "line_number": 13, "usage_type": "name" }, { "api_name": "config.args.input_size", ...
18836706246
from django.shortcuts import render, redirect from .forms import CreateUserForm from .forms import ProduitForm from .forms import * from .models import * from django.contrib.auth.forms import UserCreationForm from django.contrib.auth import authenticate , login, logout from django.contrib import messages from django....
KOFFIHO/Ampoule-Rouge
blog/views.py
views.py
py
10,339
python
fr
code
0
github-code
1
[ { "api_name": "django.shortcuts.render", "line_number": 36, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 39, "usage_type": "call" }, { "api_name": "django.db.models.query", "line_number": 47, "usage_type": "name" }, { "api_name":...
11481832162
from zope.interface import Attribute, Interface from zope.interface.interfaces import IObjectEvent from zope.lifecycleevent import IObjectCreatedEvent from zope.schema import ASCIILine, Bool, Choice, Dict, Field, Object, Text, TextLine, Tuple, URI from pyams_form.interfaces import DISPLAY_MODE, IContentProviders, IFie...
Py-AMS/pyams-form
src/pyams_form/interfaces/form.py
form.py
py
13,055
python
en
code
0
github-code
1
[ { "api_name": "zope.interface.Interface", "line_number": 16, "usage_type": "name" }, { "api_name": "zope.schema.Object", "line_number": 19, "usage_type": "call" }, { "api_name": "pyams_form._", "line_number": 19, "usage_type": "call" }, { "api_name": "pyams_form._...
43687386238
# -*- coding: utf-8 -*- from PyQt4 import QtGui from modules.classes.custom.QTableWidgetItem import QCustomTableWidgetItem as QCI def setItemArmEvEsChtbGcscGcsmCscfsCspSpdQty(form, itemIndex, dataPropertiesImplicitExplicitLinesList, typeName): if dataPropertiesImplicitExplicitLinesList: temp = dataProperti...
Doberm4n/POEStashJsonViewer
modules/items/armEvEsChtbGcscGcsmCscfsCspSpdQty.py
armEvEsChtbGcscGcsmCscfsCspSpdQty.py
py
4,057
python
en
code
0
github-code
1
[ { "api_name": "modules.classes.custom.QTableWidgetItem.QCustomTableWidgetItem", "line_number": 77, "usage_type": "call" }, { "api_name": "modules.classes.custom.QTableWidgetItem.QCustomTableWidgetItem", "line_number": 79, "usage_type": "call" }, { "api_name": "modules.classes.cus...
6248797453
import numpy as np import networkx as nx import random import timeit import gym import matplotlib.pyplot as plt from utils import get_node_values from utils import interventional_selection env = gym.make('Taxi-v3') n_actions = env.action_space.n n_states = env.observation_space.n qtable = np.zeros((n_states,n_actions...
atagade/Causal-RL
taxi_causal_greedy.py
taxi_causal_greedy.py
py
2,081
python
en
code
0
github-code
1
[ { "api_name": "gym.make", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 14, "usage_type": "call" }, { "api_name": "networkx.read_graphml", "line_number": 27, "usage_type": "call" }, { "api_name": "utils.get_node_values", ...
23778588737
import json #省和城市的逻辑 class NationalCities(object): def choice(self,prct): provice = tuple(prct().keys()) provices = list() for pro in provice: provices.append((pro,pro)) citys_list = sum(list(prct().values()),[]) citys = list() for city in citys_list: ...
hsztyw/testswiper
ztc/ztc/ztc/api_cof.py
api_cof.py
py
1,238
python
en
code
0
github-code
1
[ { "api_name": "json.load", "line_number": 22, "usage_type": "call" } ]
373802572
import copy import warnings from typing import Optional, Tuple from vyper import ast as vy_ast from vyper.lll import compile_lll, optimizer from vyper.old_codegen import parser from vyper.old_codegen.global_context import GlobalContext from vyper.semantics import set_data_positions, validate_semantics from vyper.typin...
webanck/GigaVoxels
lib/python3.8/site-packages/vyper/compiler/phases.py
phases.py
py
9,003
python
en
code
23
github-code
1
[ { "api_name": "typing.Optional", "line_number": 47, "usage_type": "name" }, { "api_name": "vyper.typing.InterfaceImports", "line_number": 47, "usage_type": "name" }, { "api_name": "vyper.ast.Module", "line_number": 74, "usage_type": "attribute" }, { "api_name": "v...
29343615007
import sys import json import sql from dateutil import parser as dt def getPackageId(package, ecosystem): ''' returns packageId if exists, else creates ''' selectQ = 'select id from package where name=%s and ecosystem=%s' results = sql.execute(selectQ,(package,ecosystem)) if not results: inse...
nasifimtiazohi/secrel
ghsa/explore.py
explore.py
py
1,991
python
en
code
0
github-code
1
[ { "api_name": "sql.execute", "line_number": 10, "usage_type": "call" }, { "api_name": "sql.execute", "line_number": 13, "usage_type": "call" }, { "api_name": "sql.execute", "line_number": 14, "usage_type": "call" }, { "api_name": "json.load", "line_number": 18...
16921762500
from random import randint, shuffle import discord import modules.math.strmath as strmath import modules.math.wolfram as wolfram import modules.math.latex as latex from command import command from util import client, theme_color, error_color from logger import log # import urllib.parse @command('math') async def ...
ComedicChimera/Null-Discord-Bot
modules/math/commands.py
commands.py
py
2,980
python
en
code
0
github-code
1
[ { "api_name": "modules.math.strmath.evaluate", "line_number": 18, "usage_type": "call" }, { "api_name": "modules.math.strmath", "line_number": 18, "usage_type": "name" }, { "api_name": "discord.Embed", "line_number": 21, "usage_type": "call" }, { "api_name": "util...
6482397047
from preprocessing.loading import * from utils import * import logging, os import gcsfs from joblib import Parallel, delayed from tqdm import tqdm from db import RedisDB from math import ceil logging.basicConfig(level = logging.INFO) GOOGLE_APPLICATION_CREDENTIALS = os.getenv('GOOGLE_APPLICATION_CREDENTIALS') GOOGLE_...
agriuseatstweets/gut
load_tweets.py
load_tweets.py
py
1,464
python
en
code
0
github-code
1
[ { "api_name": "logging.basicConfig", "line_number": 10, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 10, "usage_type": "attribute" }, { "api_name": "os.getenv", "line_number": 12, "usage_type": "call" }, { "api_name": "os.getenv", "line...
16943091683
# _*_ coding:utf-8 _*_ import pika from multiprocessing import Process, current_process from settings import * class FlowCollect(Process): """流量收集类""" def __init__(self, url, instance): super(FlowCollect, self).__init__() self.url = url self.instance = instance self.name = ins...
cloudmonitor/flowcollector
flowcollector/flowcollect.py
flowcollect.py
py
3,355
python
en
code
0
github-code
1
[ { "api_name": "multiprocessing.Process", "line_number": 8, "usage_type": "name" }, { "api_name": "pika.BlockingConnection", "line_number": 20, "usage_type": "call" }, { "api_name": "pika.ConnectionParameters", "line_number": 20, "usage_type": "call" }, { "api_name...
7455808520
import copy import datetime import os import random import re import signal import socket import sys import time import traceback from urllib.parse import unquote from pandacommon.pandalogger.PandaLogger import PandaLogger from pandajedi.jediconfig import jedi_config from pandajedi.jedicore import Interaction, JediCor...
PanDAWMS/panda-jedi
pandajedi/jediorder/JobGenerator.py
JobGenerator.py
py
136,720
python
en
code
3
github-code
1
[ { "api_name": "pandacommon.pandalogger.PandaLogger.PandaLogger", "line_number": 38, "usage_type": "call" }, { "api_name": "JediKnight.JediKnight", "line_number": 47, "usage_type": "name" }, { "api_name": "JediKnight.JediKnight.__init__", "line_number": 50, "usage_type": "...
43498696368
import numpy as np import matplotlib.pyplot as plt from part4 import kf_smooth def time_and_meas_update(Sigma, A, Sigma_w, C, R): '''Your code here''' # all the definitions are similar to KF implementation, performing time update and measurement update # here Sigma_w is Q in the slides. You need to output ...
tpvt99/robotics
cs287hw4/part5.py
part5.py
py
3,213
python
en
code
1
github-code
1
[ { "api_name": "numpy.linalg.inv", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.linalg", "line_number": 13, "usage_type": "attribute" }, { "api_name": "numpy.identity", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.array", "...
6584229686
import numpy from typing import Optional, cast from UM.Qt.Bindings.Theme import Theme from UM.Qt.QtApplication import QtApplication from UM.Logger import Logger class LayerPolygon: NoneType = 0 Inset0Type = 1 InsetXType = 2 SkinType = 3 SupportType = 4 SkirtType = 5 InfillType = 6 Su...
Ultimaker/Cura
cura/LayerPolygon.py
LayerPolygon.py
py
12,372
python
en
code
5,387
github-code
1
[ { "api_name": "numpy.logical_or", "line_number": 25, "usage_type": "call" }, { "api_name": "numpy.arange", "line_number": 25, "usage_type": "call" }, { "api_name": "numpy.arange", "line_number": 26, "usage_type": "call" }, { "api_name": "numpy.arange", "line_n...
32712471476
from pydicom import dcmread import numpy as np from scipy.sparse import csc_matrix import matplotlib.pyplot as plt import math from mpl_toolkits.mplot3d import Axes3D # noqa: F401 unused import import pandas as pd import scipy.stats as stats def fun(contour_dataset, image, zcoord): img_ID = image.SOPInstanceUID ...
perseusf/MainProject
main.py
main.py
py
12,068
python
ru
code
0
github-code
1
[ { "api_name": "matplotlib.pyplot.subplots", "line_number": 44, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 44, "usage_type": "name" }, { "api_name": "math.sqrt", "line_number": 69, "usage_type": "call" }, { "api_name": "math.ceil", ...
1588154559
"""Tests for ``highcharts.no_data``.""" from copy import deepcopy import pytest from json.decoder import JSONDecodeError from validator_collection import checkers from highcharts_core.headless_export import ExportServer as cls from highcharts_core.options import HighchartsOptions from highcharts_core import errors fr...
highcharts-for-python/highcharts-core
tests/test_headless_export.py
test_headless_export.py
py
7,115
python
en
code
40
github-code
1
[ { "api_name": "tests.fixtures.Class__init__", "line_number": 21, "usage_type": "call" }, { "api_name": "highcharts_core.headless_export.ExportServer", "line_number": 21, "usage_type": "argument" }, { "api_name": "pytest.mark.parametrize", "line_number": 19, "usage_type": ...
40059843407
import copy import random from typing import Optional, List from ..services.spu_feature_service import SpuFeatureService from ...entity.rec_item import RecItem class HotsRecall(object): def get_candidates(self, k: Optional[int] = None) -> List[RecItem]: """ 获取前k个热映商品 :param k: 待获取的数量,如果为N...
lingltang/LML
tx/02_nlp/projectSet/MovieRecSystem/src/MovieRecSystem/stategy/recall/hots_recall.py
hots_recall.py
py
1,020
python
en
code
0
github-code
1
[ { "api_name": "typing.Optional", "line_number": 10, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 10, "usage_type": "name" }, { "api_name": "entity.rec_item.RecItem", "line_number": 10, "usage_type": "name" }, { "api_name": "typing.Optional",...
24508802688
import math import sys import time from typing import Tuple from codebase.real_world.base.getters import Getters from codebase.real_world.base.senders import Senders from socket import socket from codebase.real_world.base.base_client import BaseClient class PTP(BaseClient): def __init__(self, host: str, port: int...
Dominique-Yiu/pyspacemouse-coppeliasim
codebase/real_world/base/PTP.py
PTP.py
py
9,431
python
en
code
1
github-code
1
[ { "api_name": "codebase.real_world.base.base_client.BaseClient", "line_number": 11, "usage_type": "name" }, { "api_name": "typing.Tuple", "line_number": 12, "usage_type": "name" }, { "api_name": "socket.socket", "line_number": 12, "usage_type": "name" }, { "api_na...
44044303509
#!/usr/bin/env python3 import os import sys from dataclasses import dataclass, field """ author: dmaynor@gmail.com The script will scan through my ~/code and ~/home directory to look for virtual enviroments for python by looking for a venv directory structure. It can be called from my ~/tools/bin directory so firs...
dmaynor/mytools
src/project_selector.py
project_selector.py
py
2,035
python
en
code
0
github-code
1
[ { "api_name": "dataclasses.field", "line_number": 18, "usage_type": "call" }, { "api_name": "dataclasses.dataclass", "line_number": 16, "usage_type": "name" }, { "api_name": "os.getcwd", "line_number": 28, "usage_type": "call" }, { "api_name": "os.path.expanduser"...
1042706126
import warnings from PIL import Image,ImageFilter def down_sample_fit(pil_img, num): ds = [2 ** (i + 1) for i in range(num)] for d in ds: a, b = pil_img.size add = (a % d) na = a + add add = (b % d) nb = b + add pil_img = pil_img.resize((na, nb),Image....
MashiMaroLjc/elegance
plugin/util.py
util.py
py
1,095
python
en
code
39
github-code
1
[ { "api_name": "PIL.Image.BICUBIC", "line_number": 12, "usage_type": "attribute" }, { "api_name": "PIL.Image", "line_number": 12, "usage_type": "name" }, { "api_name": "warnings.warn", "line_number": 21, "usage_type": "call" }, { "api_name": "PIL.Image.BICUBIC", ...
833418569
from typing import Sequence import math import torch from torch.utils.data.sampler import Sampler, RandomSampler class StratifiedEventBatchSampler(Sampler): """Samples elements with from a set with binary labelling to ensure the event label (1) is evenly distributed across batches. This sampler is useful...
alok-ai-lab/pyDeepInsight
pyDeepInsight/utils/_sebs.py
_sebs.py
py
3,289
python
en
code
137
github-code
1
[ { "api_name": "torch.utils.data.sampler.Sampler", "line_number": 7, "usage_type": "name" }, { "api_name": "torch.Tensor", "line_number": 15, "usage_type": "attribute" }, { "api_name": "typing.Sequence", "line_number": 18, "usage_type": "name" }, { "api_name": "tor...
39793659658
from cx_Freeze import setup, Executable # On appelle la fonction setup buildOptions = dict( includes=["pygame.py"], include_files=["fichier1.txt", "mon_icone.ico"] ) setup( name="BoumeurMan", version="1", description="Projet Terminale 2021", executables=[Executable("main.py")],...
LeadCreep/BombermanLan
setup.py
setup.py
py
325
python
en
code
1
github-code
1
[ { "api_name": "cx_Freeze.setup", "line_number": 11, "usage_type": "call" }, { "api_name": "cx_Freeze.Executable", "line_number": 15, "usage_type": "call" } ]
8523668579
import pickle from pathlib import Path import matplotlib import matplotlib.pyplot as plt import matplotlib.patches as ptc from nicpy import nic_misc, nic_pic import a_star from geometry import Square, SquareGrid def algo_animation(history_directory, fps=2, frame_skip=1): matplotlib.use('Agg') # Gets rid of p...
niceholgate/pathfinding
py_pathfinding/plotting.py
plotting.py
py
4,143
python
en
code
0
github-code
1
[ { "api_name": "matplotlib.use", "line_number": 15, "usage_type": "call" }, { "api_name": "nicpy.nic_misc.mkdir_if_DNE", "line_number": 26, "usage_type": "call" }, { "api_name": "nicpy.nic_misc", "line_number": 26, "usage_type": "name" }, { "api_name": "matplotlib....
11923005618
import datetime from aiogram import types from aiogram.dispatcher import FSMContext from aiogram.dispatcher.filters.builtin import CommandStart from aiogram.types import InputFile from handlers.helps.met_support import create_array_account_proxy, replaceter_text_in_aiogram from handlers.users.som_inviter.a_in...
psiap/botsProject
handlers/users/som_spam/spam_hendler.py
spam_hendler.py
py
3,523
python
en
code
0
github-code
1
[ { "api_name": "aiogram.types.Message", "line_number": 17, "usage_type": "attribute" }, { "api_name": "aiogram.types", "line_number": 17, "usage_type": "name" }, { "api_name": "aiogram.dispatcher.FSMContext", "line_number": 17, "usage_type": "name" }, { "api_name":...
35708849027
''' Author: 千仞无锋 Date: 2022-04-20 21:31:30 LastEditors: 千仞无锋 LastEditTime: 2022-04-20 22:36:20 FilePath: \20220411HTML_CSS\一个小插曲关于excel和py的\youtube_openpyxl_03.py ''' import openpyxl from openpyxl import Workbook, load_workbook from openpyxl.utils import get_column_letter, column_index_from_string from openpyxl.styles ...
asusfgg/20220411HTML_CSS
一个小插曲关于excel和py的/youtube_openpyxl_03.py
youtube_openpyxl_03.py
py
1,468
python
en
code
1
github-code
1
[ { "api_name": "openpyxl.Workbook", "line_number": 30, "usage_type": "call" }, { "api_name": "openpyxl.utils.get_column_letter", "line_number": 44, "usage_type": "call" }, { "api_name": "openpyxl.utils.get_column_letter", "line_number": 50, "usage_type": "call" }, { ...
15814542538
#!/usr/bin/env python """ Example application views. Note that `render_template` is wrapped with `make_response` in all application routes. While not necessary for most Flask apps, it is required in the App Template for static publishing. """ import app_config import json import oauth import static from flask import...
PostDispatchInteractive/app-template
app.py
app.py
py
2,843
python
en
code
1
github-code
1
[ { "api_name": "flask.Flask", "line_number": 25, "usage_type": "call" }, { "api_name": "app_config.DEBUG", "line_number": 26, "usage_type": "attribute" }, { "api_name": "render_utils.smarty_filter", "line_number": 28, "usage_type": "argument" }, { "api_name": "rend...
32918054625
import logging import os import time import asyncpraw import discord from discord.ext import tasks, commands from cogs.commands import settings log = logging.getLogger(__name__) class RedditTask(commands.Cog): """ Reddit Background Task """ def __init__(self, bot): self.bot = bot # Attempt...
richtan/chiya
cogs/tasks/reddit.py
reddit.py
py
4,527
python
en
code
null
github-code
1
[ { "api_name": "logging.getLogger", "line_number": 11, "usage_type": "call" }, { "api_name": "discord.ext.commands.Cog", "line_number": 13, "usage_type": "attribute" }, { "api_name": "discord.ext.commands", "line_number": 13, "usage_type": "name" }, { "api_name": "...
26813376874
import pygame, sys, random import pygame.camera from pygame.locals import * from PIL import Image import pytesseract as pt """S_L = 'eng' D_L = 'en'""" WINDOWWIDTH = 640 WINDOWHEIGHT = 480 FPS = 30 BLACK = ( 0, 0, 0) WHITE = (255, 255, 255) BRIGHTBLUE = ( 0, 50, 255) BUTTONCOLOR = WHITE BUT...
nehalAggarwal/Linguista
main3.py
main3.py
py
10,494
python
en
code
0
github-code
1
[ { "api_name": "pygame.init", "line_number": 24, "usage_type": "call" }, { "api_name": "pygame.camera.init", "line_number": 25, "usage_type": "call" }, { "api_name": "pygame.camera", "line_number": 25, "usage_type": "attribute" }, { "api_name": "pygame.camera.list_...
35010640604
import datetime from rest_framework import status from rest_framework.views import APIView from rest_framework.response import Response from rest_framework.permissions import IsAuthenticated from drf_yasg.utils import swagger_auto_schema from apps.commons.views import Pagination, MyPagination from apps.posts.seriali...
Billionaire-Project/four_hours_service
apps/posts/views/post_my.py
post_my.py
py
2,683
python
en
code
0
github-code
1
[ { "api_name": "apps.commons.views.Pagination", "line_number": 14, "usage_type": "call" }, { "api_name": "apps.commons.views.MyPagination", "line_number": 16, "usage_type": "call" }, { "api_name": "rest_framework.views.APIView", "line_number": 19, "usage_type": "name" },...
20113334698
import json import os import time import uuid from pathlib import Path from typing import ( Any, AsyncGenerator, Coroutine, Dict, Generator, Optional, Tuple, Union, ) import tiktoken from anthropic import Anthropic from fastapi import HTTPException from fastapi.responses import JSONResp...
TensorOpsAI/LLMstudio
llmstudio/engine/providers/provider.py
provider.py
py
6,548
python
en
code
60
github-code
1
[ { "api_name": "pydantic.BaseModel", "line_number": 35, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 36, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 39, "usage_type": "name" }, { "api_name": "pydantic.BaseModel...
7273039158
#!/usr/bin/env python # -*- coding: utf-8 -*- """ This server watches for changes in log files and sends out updates to subscribers via web sockets. """ import time import subprocess import select import threading from websocket_server import WebsocketServer from baibaitrader.utils import build_logger class TickerSer...
moppymopperson/baibai-trader
baibaitrader/TickerServer.py
TickerServer.py
py
2,047
python
en
code
1
github-code
1
[ { "api_name": "baibaitrader.utils.build_logger", "line_number": 18, "usage_type": "call" }, { "api_name": "websocket_server.WebsocketServer", "line_number": 20, "usage_type": "call" }, { "api_name": "subprocess.Popen", "line_number": 45, "usage_type": "call" }, { ...
6761293557
from sPENminer import sPENminer from oPENminer import oPENminer from stream import Stream import argparse import sys def parse_args(): def str2bool(v): if v.lower() in ('yes', 'true', 't', 'y', '1'): return True elif v.lower() in ('no', 'false', 'f', 'n', '0'): return False ...
SSDS-Croatia/SSDS-2020
Day-4/Hands-on/persistence_evolving_networks/src/main.py
main.py
py
3,286
python
en
code
4
github-code
1
[ { "api_name": "argparse.ArgumentTypeError", "line_number": 14, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 16, "usage_type": "call" }, { "api_name": "stream.Stream", "line_number": 33, "usage_type": "call" }, { "api_name": "sPEN...
27848165994
import copy import torch.nn as nn import torch.optim as optim from Net import Net class Agent(object): def __init__(self, LR, global_net_dict, label_length, output_length): self.LR = LR self.output_length = output_length self.net = Net(label_length, self.output_length+1) # 由于取头取尾,所以加1 ...
BobbyBBY/machine-learning-course
Agent.py
Agent.py
py
1,245
python
en
code
0
github-code
1
[ { "api_name": "Net.Net", "line_number": 11, "usage_type": "call" }, { "api_name": "torch.nn.CrossEntropyLoss", "line_number": 13, "usage_type": "call" }, { "api_name": "torch.nn", "line_number": 13, "usage_type": "name" }, { "api_name": "torch.optim.SGD", "lin...
25142590976
import torch import torch.nn as nn from typing import Dict, Any from argparse import _ArgumentGroup import argparse import numpy as np from .cnn import CNN, IMAGE_SIZE class IvanoConv(nn.Module): def __init__(self, in_dim: int, out_dim: int, kernel_size:int=3, stride:int=1, padding:int=1): super().__in...
cluePrints/fsdl-text-recognizer-2021-labs
lab3/text_recognizer/models/line_cnn_ivan.py
line_cnn_ivan.py
py
4,649
python
en
code
null
github-code
1
[ { "api_name": "torch.nn.Module", "line_number": 13, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 13, "usage_type": "name" }, { "api_name": "torch.nn.Conv2d", "line_number": 16, "usage_type": "call" }, { "api_name": "torch.nn", "line_nu...
7853998639
import torch import detectron2.data.transforms as T from detectron2.structures import Instances from detectron2.layers import paste_masks_in_image from detectron2.modeling import build_model from detectron2.checkpoint import DetectionCheckpointer from detectron2.data import MetadataCatalog from detectron2.checkpoint i...
gist-ailab/uoais
adet/utils/post_process.py
post_process.py
py
6,482
python
en
code
110
github-code
1
[ { "api_name": "torch.Tensor", "line_number": 18, "usage_type": "attribute" }, { "api_name": "torch.stack", "line_number": 23, "usage_type": "call" }, { "api_name": "detectron2.structures.Instances", "line_number": 33, "usage_type": "call" }, { "api_name": "detectr...
410790070
from werkzeug.routing import BaseConverter class ListConverter(BaseConverter): """Matches one of the items provided. Items can either be Python identifiers or strings:: Rule('/<any(about, help, imprint, class, "foo,bar"):page_name>') :param map: the :class:`Map`. :param items: this function accepts the pos...
inab/disease_perception
REST/libs/converters.py
converters.py
py
1,036
python
en
code
2
github-code
1
[ { "api_name": "werkzeug.routing.BaseConverter", "line_number": 3, "usage_type": "name" }, { "api_name": "werkzeug.routing.BaseConverter.__init__", "line_number": 16, "usage_type": "call" }, { "api_name": "werkzeug.routing.BaseConverter", "line_number": 16, "usage_type": "...
43563103032
__version__ = "$Rev: 48541 $" import datetime import socket import cx_Oracle import despydb.errors as errors import despymisc.miscutils as miscutils # Construct a name for the v$session module column to allow database auditing. import __main__ try: _MODULE_NAME = __main__.__file__ except AttributeError: _...
DarkEnergySurvey/despydb
python/despydb/oracon.py
oracon.py
py
9,936
python
en
code
0
github-code
1
[ { "api_name": "__main__.__file__", "line_number": 16, "usage_type": "attribute" }, { "api_name": "socket.getfqdn", "line_number": 22, "usage_type": "call" }, { "api_name": "cx_Oracle.BINARY", "line_number": 27, "usage_type": "attribute" }, { "api_name": "cx_Oracle...
73457857633
from flask import Blueprint, request from src.db.user import * user = Blueprint("user", __name__) @user.route("/api/user/register", methods=["POST"]) def register(): print(request.json) # dict body = request.json arg_list = list(body.values()) res = user_register(arg_list) return { "resu...
xkyang00/Web-Development-Technology---Experiment---Good-Community---Backend
src/api/user_api.py
user_api.py
py
1,480
python
en
code
0
github-code
1
[ { "api_name": "flask.Blueprint", "line_number": 4, "usage_type": "call" }, { "api_name": "flask.request.json", "line_number": 9, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 9, "usage_type": "name" }, { "api_name": "flask.request.json...