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
8650968817
import os from dotenv import load_dotenv import telegram from telegram import Update from telegram.ext import Updater from telegram.ext import Dispatcher from telegram.ext import Filters from telegram.ext import CommandHandler,MessageHandler from telegram.ext import CallbackContext from telegram import ReplyKeyboardMa...
949027/devman_assistant
meeting_organizer/management/commands/inform_bot.py
inform_bot.py
py
3,965
python
en
code
0
github-code
6
[ { "api_name": "json.load", "line_number": 25, "usage_type": "call" }, { "api_name": "telegram.ReplyKeyboardMarkup", "line_number": 34, "usage_type": "call" }, { "api_name": "telegram.Update", "line_number": 44, "usage_type": "name" }, { "api_name": "telegram.ext.C...
23185945419
import logging import time import torch class Trainer(object): def __init__(self, cfg, model, output_dir, writer_dict): self.cfg = cfg self.model = model self.output_dir = output_dir self.writer_dict = writer_dict self.weight_decay_coefficient = cfg.TRAIN.WD ...
Nickiris/contextualpose
core/trainer.py
trainer.py
py
3,856
python
en
code
0
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 16, "usage_type": "call" }, { "api_name": "time.time", "line_number": 26, "usage_type": "call" }, { "api_name": "time.time", "line_number": 29, "usage_type": "call" }, { "api_name": "torch.cat", "line_number": ...
14324501616
# coding: utf-8 from typing import Dict, List # noqa: F401 from fastapi import ( # noqa: F401 APIRouter, Body, Cookie, Depends, Form, Header, Path, Query, Response, Security, status, ) from customer_api.impl.health import is_everything_ok from customer_api.models.extra_m...
egde/fastapi_tutorial
app/src/customer_api/apis/health_api.py
health_api.py
py
627
python
en
code
0
github-code
6
[ { "api_name": "fastapi.APIRouter", "line_number": 23, "usage_type": "call" }, { "api_name": "customer_api.impl.health.is_everything_ok", "line_number": 36, "usage_type": "call" } ]
8763792867
import requests # Get the auth token using Synthetics Credential Vault client_id = "<%CharlesLin-API-User%>" client_secret = "<%CharlesLin-API-Secret%>" token_url = 'http://se-demo-aws.demo.appdynamics.com:8090/controller/api/oauth/access_token' payload={'grant_type': 'client_credentials', 'client_id':client_id, 'cl...
Appdynamics/synthetic-jobs
Synthetics-listofapps.py
Synthetics-listofapps.py
py
790
python
en
code
1
github-code
6
[ { "api_name": "requests.post", "line_number": 8, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 14, "usage_type": "call" } ]
39920785164
from zerorobot import service_collection as scol from zerorobot import config import json def service_view(service): s = { "template": str(service.template_uid), "version": service.version, "name": service.name, "guid": service.guid, "state": state_view(service.state), ...
BolaNasr/0-robot
zerorobot/server/handlers/views.py
views.py
py
1,642
python
en
code
0
github-code
6
[ { "api_name": "zerorobot.service_collection.is_service_public", "line_number": 14, "usage_type": "call" }, { "api_name": "zerorobot.service_collection", "line_number": 14, "usage_type": "name" }, { "api_name": "zerorobot.config.god", "line_number": 17, "usage_type": "attr...
73831983547
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Date: Created on 28 Aug 2023 09:19 # @Author: Yao LI # @File: clustering.py import pandas as pd from sklearn.linear_model import LogisticRegression import hdbscan import sys from pcg_pattern import * from scipy.ndimage import gaussian_filter1d import numpy as np from p...
BGI-Qingdao/4D-BioReconX
PCG/clustering/clustering.py
clustering.py
py
5,604
python
en
code
4
github-code
6
[ { "api_name": "sys.argv", "line_number": 24, "usage_type": "attribute" }, { "api_name": "scanpy.read_h5ad", "line_number": 26, "usage_type": "call" }, { "api_name": "hdbscan.HDBSCAN", "line_number": 39, "usage_type": "call" }, { "api_name": "numpy.savetxt", "l...
38678645336
from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np import random import pyarrow.plasma as plasma def random_object_id(): return plasma.ObjectID(np.random.bytes(20)) def generate_metadata(length): metadata_buffer = bytearray(lengt...
ray-project/sandbox
python/ray/plasma/utils.py
utils.py
py
1,616
python
en
code
4
github-code
6
[ { "api_name": "pyarrow.plasma.ObjectID", "line_number": 12, "usage_type": "call" }, { "api_name": "pyarrow.plasma", "line_number": 12, "usage_type": "name" }, { "api_name": "numpy.random.bytes", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.rando...
17347843732
from django.db import models class TsInterfaceMixin(object): """将pydantic转换为Ts格式字符串""" @classmethod def get_ts_interface(cls, field_dict=None, field_is_list=False, indentation_form='\t', recursion_time=1): # 递归深度写进函数参数里,每次递归根据情况决定是否将深度加一 result = 'interface ' + cls.__name__ + ' {\n' + cls.__get_ts_...
cuifeihe/django_WorkFlowProject
common/basemodel.py
basemodel.py
py
3,222
python
en
code
0
github-code
6
[ { "api_name": "django.db.models.Model", "line_number": 63, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 63, "usage_type": "name" }, { "api_name": "django.db.models.DateTimeField", "line_number": 65, "usage_type": "call" }, { "api_n...
21113378432
from django.shortcuts import render, render_to_response, get_object_or_404 from openvpn.models import OpenvpnServer, OpenvpnClient from openvpn.forms import OpenvpnServerForm, OpenvpnClientForm def start(request): context = {} return render(request, 'core/start.html', context) def list_vpns(request): vpn_...
superdachs/OwnVPN
ownvpn/core/views.py
views.py
py
1,254
python
en
code
0
github-code
6
[ { "api_name": "django.shortcuts.render", "line_number": 7, "usage_type": "call" }, { "api_name": "openvpn.models.OpenvpnServer.objects.all", "line_number": 10, "usage_type": "call" }, { "api_name": "openvpn.models.OpenvpnServer.objects", "line_number": 10, "usage_type": "...
26758338046
import re import os import configparser from typing import List from RPA.Browser.Selenium import Selenium from RPA.FileSystem import FileSystem from RPA.PDF import PDF from RPA.Excel.Files import Files from selenium.common.exceptions import NoSuchElementException def parse_config(config_path: str) -> str: confi...
sapiely/rpa_agencies
main.py
main.py
py
5,707
python
en
code
0
github-code
6
[ { "api_name": "configparser.ConfigParser", "line_number": 15, "usage_type": "call" }, { "api_name": "RPA.Browser.Selenium.Selenium", "line_number": 19, "usage_type": "call" }, { "api_name": "typing.List", "line_number": 24, "usage_type": "name" }, { "api_name": "t...
29747616689
""" Config.py : the congfiguration of hyper-parameters and the setting of experiments, such as the number of training instances ResNet.py : the definition of Resnet for MNIST and CIFAR10 data set, including the convolutional blocks, GAP and fully connectiong layers ResNet_imagenet.py : the defin...
itapty-ily/Lagat
main.py
main.py
py
13,913
python
en
code
11
github-code
6
[ { "api_name": "Config.opt.n_epochs", "line_number": 68, "usage_type": "attribute" }, { "api_name": "Config.opt", "line_number": 68, "usage_type": "name" }, { "api_name": "Config.opt.n_epochs", "line_number": 69, "usage_type": "attribute" }, { "api_name": "Config.o...
17215751397
"""ChatGPTを使った社則チャットボット""" import os # import openai import requests import json # APIキーを環境変数から取得 api_key = os.getenv("CHATGPT_API_KEY") # openai.api_key = os.getenv("CHATGPT_API_KEY") # API エンドポイントとヘッダー # init()とask()で共通 url = "https://api.openai.com/v1/chat/completions" headers = { "Content-Type": "application...
u1and0/employment_regulations_gpt3bot
main.py
main.py
py
3,632
python
ja
code
0
github-code
6
[ { "api_name": "os.getenv", "line_number": 9, "usage_type": "call" }, { "api_name": "requests.post", "line_number": 50, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 50, "usage_type": "call" }, { "api_name": "requests.post", "line_number": ...
71451146107
import numpy as np import tensorflow as tf from waymo_open_dataset.protos import occupancy_flow_metrics_pb2 from waymo_open_dataset.protos import occupancy_flow_submission_pb2 from waymo_open_dataset.protos import scenario_pb2 from waymo_open_dataset.utils import occupancy_flow_data from waymo_open_dataset.utils impor...
georgeliu233/STrajNet
loss.py
loss.py
py
13,035
python
en
code
40
github-code
6
[ { "api_name": "tensorflow.keras", "line_number": 22, "usage_type": "attribute" }, { "api_name": "tensorflow_addons.losses.SigmoidFocalCrossEntropy", "line_number": 32, "usage_type": "call" }, { "api_name": "tensorflow_addons.losses", "line_number": 32, "usage_type": "attr...
11900494264
from navbar import create_navbar import dash import dash_bootstrap_components as dbc from dash import Dash, dcc, html, Input, Output, callback, dash_table import pandas as pd import plotly.express as px from sklearn.preprocessing import StandardScaler from sklearn.preprocessing import LabelEncoder from matplotlib.ticke...
jeanpierec/ljpiere_projects
DataScience_projects/Proyecto5_DS4ABucaramanga/page_2.py
page_2.py
py
8,456
python
en
code
1
github-code
6
[ { "api_name": "seaborn.set", "line_number": 11, "usage_type": "call" }, { "api_name": "dash.Dash", "line_number": 14, "usage_type": "call" }, { "api_name": "dash_bootstrap_components.themes", "line_number": 14, "usage_type": "attribute" }, { "api_name": "navbar.cr...
20841040066
import nltk from nltk.tokenize import word_tokenize, sent_tokenize from nltk.corpus import stopwords from Sastrawi.Stemmer.StemmerFactory import StemmerFactory from nltk.probability import FreqDist import re import string import pandas as pd from nltk.tokenize.treebank import TreebankWordDetokenizer spill_words = { ...
mfaisalafandi/identification_teks_ulasan_svm
Preprocessing.py
Preprocessing.py
py
4,786
python
en
code
0
github-code
6
[ { "api_name": "re.sub", "line_number": 86, "usage_type": "call" }, { "api_name": "string.punctuation", "line_number": 87, "usage_type": "attribute" }, { "api_name": "re.sub", "line_number": 88, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 89,...
33553821470
#!/usr/bin/env python3 ''' New Post Usage: newpost.py [-t TITLE] -h --help show this -t --title title ''' from docopt import docopt from datetime import date def main(): root_dir = '_posts/' post_title = arguments.get('TITLE') today = date.today() post_replace ...
georgeglessner/blog
newpost.py
newpost.py
py
813
python
en
code
0
github-code
6
[ { "api_name": "datetime.date.today", "line_number": 21, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 21, "usage_type": "name" }, { "api_name": "docopt.docopt", "line_number": 36, "usage_type": "call" } ]
17830203884
from copy import deepcopy import numpy as np import torch import torch.nn as nn def get_module(config): if config['name'] == 'linear': return LinearWrapper(**config['args']) if config['name'] == 'flatten': return Flatten() if config['name'] == 'conv_2d': return Conv2dWrapper(**con...
niksaz/aido1
models/ddpg/modules.py
modules.py
py
6,633
python
en
code
0
github-code
6
[ { "api_name": "torch.nn.BatchNorm2d", "line_number": 16, "usage_type": "call" }, { "api_name": "torch.nn", "line_number": 16, "usage_type": "name" }, { "api_name": "torch.nn.Dropout", "line_number": 18, "usage_type": "call" }, { "api_name": "torch.nn", "line_n...
30468980540
import requests import json import gspread # pip install gspread '''SETUP - google developer console: https://console.developers.google.com - new project -> activate drive and sheets api - credentials -> service account -> name + role=editor ->create key and download json - share client_email fom json in your sheet...
Pratap517/Email_function_calling
test.py
test.py
py
1,168
python
en
code
0
github-code
6
[ { "api_name": "gspread.service_account", "line_number": 14, "usage_type": "call" }, { "api_name": "requests.post", "line_number": 41, "usage_type": "call" } ]
70268989949
import time import logging from blin.config import Config from blin.database import Database from blin.vk import API from blin.numerals import get_seconds logging.basicConfig( format='%(asctime)s - %(levelname)s - %(funcName)s - %(message)s', level=Config.log_level ) # # # datetime = Config.datetime # dateti...
cyber-chuvash/blinBlinskiyNoviyGod
blin/blin.py
blin.py
py
1,245
python
en
code
0
github-code
6
[ { "api_name": "logging.basicConfig", "line_number": 9, "usage_type": "call" }, { "api_name": "blin.config.Config.log_level", "line_number": 11, "usage_type": "attribute" }, { "api_name": "blin.config.Config", "line_number": 11, "usage_type": "name" }, { "api_name"...
29928906591
import numpy as np import matplotlib.pyplot as plt from scipy.interpolate import interp1d from ast2000tools.solar_system import SolarSystem from ast2000tools.space_mission import SpaceMission from ast2000tools.shortcuts import SpaceMissionShortcuts class PlanetaryOrbits: """ Interpolerer verdier fra...
Jonnyigeh/AST2000
Part 5/Del 5/interpolation.py
interpolation.py
py
1,026
python
en
code
0
github-code
6
[ { "api_name": "ast2000tools.shortcuts.SpaceMissionShortcuts", "line_number": 14, "usage_type": "call" }, { "api_name": "ast2000tools.space_mission.SpaceMission", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.linspace", "line_number": 15, "usage_type": "c...
33548573171
import requests import sys, os import time def translate_deepl(text, source_lang, target_lang): with open("./required_functions/deepl_api_key.txt","r") as f: API_KEY = f.readlines()[0].replace("\n","") source_lang = source_lang.upper() target_lang = target_lang.upper() params = { "auth...
StarterinUtopian/VIDEOBOT
utils_translation.py
utils_translation.py
py
825
python
en
code
0
github-code
6
[ { "api_name": "requests.post", "line_number": 17, "usage_type": "call" } ]
42103954143
import time from unittest import TestCase import pytest import mock from ddtrace.span import Span from ddtrace.internal.writer import AgentWriter, Q, Empty class RemoveAllFilter(): def __init__(self): self.filtered_traces = 0 def process_trace(self, trace): self.filtered_traces += 1 ...
karolinepauls/dd-trace-py
tests/internal/test_writer.py
test_writer.py
py
6,141
python
en
code
null
github-code
6
[ { "api_name": "mock.Mock", "line_number": 50, "usage_type": "call" }, { "api_name": "unittest.TestCase", "line_number": 63, "usage_type": "name" }, { "api_name": "mock.Mock", "line_number": 67, "usage_type": "call" }, { "api_name": "ddtrace.internal.writer.AgentWr...
23837861582
''' Research zero stability by means of special function ''' import numpy as np import pandas as pd import drawer import multiprocessing import utils from functools import partial import warnings warnings.filterwarnings("ignore", category=DeprecationWarning) NUMERICAL_METHODS = ['Euler', 'Runge-Kutta', 'Butcher']...
leonel11/KaschenkoEquation
Scripts/zero_point_research_multiproc.py
zero_point_research_multiproc.py
py
6,006
python
en
code
0
github-code
6
[ { "api_name": "warnings.filterwarnings", "line_number": 15, "usage_type": "call" }, { "api_name": "multiprocessing.cpu_count", "line_number": 28, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 45, "usage_type": "call" }, { "api_name": "numpy.a...
18796266227
import multiprocessing as mp import os from fnmatch import fnmatch from subprocess import Popen def chunk(seq, n): """ divide a sequence into equal sized chunks (the last chunk may be smaller, but won't be empty) """ chunks = [] some = [] for element in seq: if len(some) == n: ...
milvus-io/milvus
internal/core/build-support/lintutils.py
lintutils.py
py
2,652
python
en
code
24,190
github-code
6
[ { "api_name": "multiprocessing.cpu_count", "line_number": 41, "usage_type": "call" }, { "api_name": "subprocess.Popen", "line_number": 42, "usage_type": "call" }, { "api_name": "os.walk", "line_number": 58, "usage_type": "call" }, { "api_name": "os.path.join", ...
17433151770
import unittest import gmpy2 from gmpy2 import mpz from chvote.Utils.Utils import AssertNumeric, AssertInt def ToByteArray(x): """ Algorithm 4.3: ToByteArray(x): Converts the given integer to a bytearray in big-endian byte order Args: x (int | mpz): The number to be converted to a bytearray ...
nextgenevoting/visualizer
backend/chvote/Utils/ToByteArray.py
ToByteArray.py
py
2,964
python
en
code
3
github-code
6
[ { "api_name": "chvote.Utils.Utils.AssertNumeric", "line_number": 39, "usage_type": "call" }, { "api_name": "unittest.TestCase", "line_number": 54, "usage_type": "attribute" }, { "api_name": "gmpy2.mpz", "line_number": 57, "usage_type": "call" }, { "api_name": "gmp...
39556747349
# -*- coding: utf-8 -*- import db import os import uuid from pathlib import Path from eyed3.mp3 import Mp3AudioFile import utils def create_playlist(playlist_name: str) -> None: db.insert_playlists([{"id": str(uuid.uuid4()), "title": playlist_name}]) def add_source(sources=[]): for source in sources: ...
georgemunyoro/audial
api/media.py
media.py
py
3,683
python
en
code
1
github-code
6
[ { "api_name": "db.insert_playlists", "line_number": 11, "usage_type": "call" }, { "api_name": "uuid.uuid4", "line_number": 11, "usage_type": "call" }, { "api_name": "db.get_sources", "line_number": 16, "usage_type": "call" }, { "api_name": "db.default_con", "l...
14222044900
''' Libsubmit ========= Uniform interface to diverse and multi-lingual set of computational resources. ''' import logging logger = logging.getLogger(__name__) from libsubmit.version import VERSION from libsubmit.providers import LocalProvider from libsubmit.providers import CobaltProvider from libsubmit.providers i...
Parsl/libsubmit
libsubmit/__init__.py
__init__.py
py
3,321
python
en
code
14
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 9, "usage_type": "call" }, { "api_name": "libsubmit.version.VERSION", "line_number": 36, "usage_type": "name" }, { "api_name": "logging.DEBUG", "line_number": 60, "usage_type": "attribute" }, { "api_name": "logging...
25070266255
from attr import has from django.urls import reverse from rest_framework.request import Request from purplship.references import collect_providers_data, collect_references from purplship.server.core.serializers import CustomsContentType, Incoterm, MODELS from purplship.server.conf import settings PACKAGE_MAPPERS = c...
danh91/purplship
server/modules/core/purplship/server/core/dataunits.py
dataunits.py
py
2,910
python
en
code
null
github-code
6
[ { "api_name": "purplship.references.collect_providers_data", "line_number": 10, "usage_type": "call" }, { "api_name": "purplship.references.collect_references", "line_number": 13, "usage_type": "call" }, { "api_name": "purplship.server.core.serializers.CustomsContentType", "l...
12483912159
import numpy as np import matplotlib.pyplot as plt from cowling import CowlingModel from constants import Msun,Lsun,Tesun from scipy.constants import year Myr = 1e6*year m = 9 M = np.linspace(2*Msun, 10*Msun, m) X,Z = 0.7, 0.02 dt,n,nstep = 0.01*Myr, 2, 20 L,T = np.empty((2,m,n+1)) t = np.arange(n+1)*dt*nstep/Myr f...
tt-nakamura/cowling
fig4.py
fig4.py
py
962
python
en
code
0
github-code
6
[ { "api_name": "scipy.constants.year", "line_number": 7, "usage_type": "name" }, { "api_name": "numpy.linspace", "line_number": 10, "usage_type": "call" }, { "api_name": "constants.Msun", "line_number": 10, "usage_type": "name" }, { "api_name": "numpy.empty", "...
72143870268
from typing import List, Set, Tuple from copy import copy # conceptualmente ''' mapa: List[List[int]] = [] point = Tuple[int, int] ''' ROCK = 1 EMPTY = 0 ''' Obs: La unica función que subre modificaciones en esta implementación es search_path. Dado que la lógica para obtener vecinos y verificar si un espacio esta d...
levensworth/udesa-pc-tutorial
2022-a/5-recursion/solutions/find_path_no_recur.py
find_path_no_recur.py
py
4,214
python
es
code
2
github-code
6
[ { "api_name": "typing.List", "line_number": 21, "usage_type": "name" }, { "api_name": "typing.Tuple", "line_number": 21, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 36, "usage_type": "name" }, { "api_name": "typing.Tuple", "line_number"...
17296666480
# -*- coding: utf-8 -*- """ Created on Thu Nov 18 11:35:43 2021 @author: NLP Lab """ import numpy as np from cv2 import cv2 original = cv2.imread('th.jpg') #cv2.imshow('ori',original) #cv2.waitKey(0) gray = cv2.cvtColor(original, cv2.COLOR_BGR2GRAY) (thresh,bina) = cv2.threshold(gray,120,255,cv2.THRE...
SajibTalukder2k16/Temp
Image/Dilation.py
Dilation.py
py
1,348
python
en
code
0
github-code
6
[ { "api_name": "cv2.cv2.imread", "line_number": 12, "usage_type": "call" }, { "api_name": "cv2.cv2", "line_number": 12, "usage_type": "name" }, { "api_name": "cv2.cv2.cvtColor", "line_number": 15, "usage_type": "call" }, { "api_name": "cv2.cv2", "line_number": ...
4592756922
__all__ = [ 'Index', ] import json from datetime import datetime, timezone from systemimage.bag import Bag from systemimage.image import Image IN_FMT = '%a %b %d %H:%M:%S %Z %Y' OUT_FMT = '%a %b %d %H:%M:%S UTC %Y' class Index(Bag): @classmethod def from_json(cls, data): """Parse the JSON...
ubports/system-image
systemimage/index.py
index.py
py
2,157
python
en
code
2
github-code
6
[ { "api_name": "systemimage.bag.Bag", "line_number": 17, "usage_type": "name" }, { "api_name": "json.loads", "line_number": 21, "usage_type": "call" }, { "api_name": "datetime.datetime.strptime", "line_number": 29, "usage_type": "call" }, { "api_name": "datetime.da...
23423074344
#!/usr/bin/env python3 import re import os import pprint import logging import urllib from prompt_toolkit import prompt from prompt_toolkit.contrib.completers import WordCompleter from prompt_toolkit.history import FileHistory from prompt_toolkit.auto_suggest import AutoSuggestFromHistory from prompt_toolkit.styles i...
oftl/ab
ab.py
ab.py
py
2,134
python
en
code
0
github-code
6
[ { "api_name": "sys.path", "line_number": 17, "usage_type": "attribute" }, { "api_name": "prompt_toolkit.history.FileHistory", "line_number": 23, "usage_type": "call" }, { "api_name": "os.path.expanduser", "line_number": 23, "usage_type": "call" }, { "api_name": "o...
36226503206
import flask from flask import request from auth import authenticate, get_session app = flask.Flask(__name__) @app.route('/authenticate', methods=['POST']) def login(): """ Autentiserer et innloggingsforsøk. Brukernavn og (hashet) passord sendes som JSON. Dersom de er gyldig genereres en tilfeldig to...
mchyll/sikkerhet
oving_10/oppgave_1/server.py
server.py
py
1,520
python
no
code
0
github-code
6
[ { "api_name": "flask.Flask", "line_number": 5, "usage_type": "call" }, { "api_name": "flask.request.get_json", "line_number": 16, "usage_type": "call" }, { "api_name": "flask.request", "line_number": 16, "usage_type": "attribute" }, { "api_name": "auth.authenticat...
23692873229
''' Main server file. This file reads the arguments of the program and sets the server state accordingly. It also has the main function responsible for receiving and sending DNS messages. Processing is done in another file. Last modification: Multiprocessing Date of Modification: 19/11/2022 18:11 ''' #TODO: Terminate...
SLP25/DNS
dnsserver.py
dnsserver.py
py
11,569
python
en
code
1
github-code
6
[ { "api_name": "multiprocessing.Queue", "line_number": 37, "usage_type": "name" }, { "api_name": "server.cache.process_message", "line_number": 42, "usage_type": "call" }, { "api_name": "server.cache", "line_number": 42, "usage_type": "name" }, { "api_name": "serve...
7506419546
import db_connection import psycopg2.sql as sql COMPARISON_TYPES = ('=', '<>', '<', '>', '<=', '>=', 'LIKE', 'NOT LIKE', 'IN', 'NOT IN') COMPARISON_TYPES_EXTENDED = ('BETWEEN', 'NOT BETWEEN') JOIN_WORDS = ('AND', 'OR') SQL_FUNCTIONS = ('COUNT', 'SUM', 'AVG', '') ORDER_TYPES = ('ASC', 'DESC') JOIN_TYPES = ('LEFT', 'RI...
CodecoolWAW20171/web-askmate-project-sejsmogrzmoty
persistence.py
persistence.py
py
18,444
python
en
code
0
github-code
6
[ { "api_name": "psycopg2.sql.SQL", "line_number": 34, "usage_type": "call" }, { "api_name": "psycopg2.sql", "line_number": 34, "usage_type": "name" }, { "api_name": "psycopg2.sql.SQL", "line_number": 39, "usage_type": "call" }, { "api_name": "psycopg2.sql", "li...
41969607479
import asyncio from tonplace import get_token, API async def main(): token = await get_token("+79123456789", save_session=True) api = API(token) # Любой запрос к ton.place api которого нет в методах custom_data = await api.request("POST", path=f"test/test", json_data={"test": 123}) return custom...
0x216/tonplaceApi
examples/custom_request.py
custom_request.py
py
411
python
ru
code
null
github-code
6
[ { "api_name": "tonplace.get_token", "line_number": 7, "usage_type": "call" }, { "api_name": "tonplace.API", "line_number": 8, "usage_type": "call" }, { "api_name": "asyncio.get_event_loop", "line_number": 15, "usage_type": "call" } ]
16257317726
""" - `combine_index((None,), (0,)) == ()` - `combine_index((None,), (None,)) == (None, None)` - `combine_index((None, ), (slice(None), )) == (None, )` - `combine_index((), (None, )) == (None, )` - `combine_index((), right) == right` - `combine_index((None,) + left, (0,) + right) == combine_index(left, right)` - `combi...
morphocut/morphocut
experiments/NDProxy.py
NDProxy.py
py
9,116
python
en
code
7
github-code
6
[ { "api_name": "functools.partial", "line_number": 22, "usage_type": "call" }, { "api_name": "lazy_object_proxy.slots.slots", "line_number": 45, "usage_type": "attribute" }, { "api_name": "lazy_object_proxy.slots", "line_number": 45, "usage_type": "name" }, { "api_...
33800378688
from collections import deque dx = [-1,-1,-2,-2,1,1,2,2] dy = [-2,2,-1,1,-2,2,-1,1] t = int(input()) for _ in range(t): n = int(input()) sx,sy = map(int, input().split()) ex,ey = map(int, input().split()) if sx==ex and sy==ey: print(0) continue check = [[-1]*n for _ in range(n)] ...
devAon/Algorithm
BOJ-Python/boj-7562_나이트의이동.py
boj-7562_나이트의이동.py
py
721
python
en
code
0
github-code
6
[ { "api_name": "collections.deque", "line_number": 13, "usage_type": "call" } ]
2535388387
import importlib from os import listdir class Path: LAYER1 = 'bot' LAYER2 = ['exts', 'assets', 'utils'] LAYER3 = ['admin'] def get_extensions(): """ Loops through directories and subdirectories to find for cogs that can be load into """ base = f'./{Path.LAYER1}/{Path.LAYER2[0]}/' ...
Rickaym/kwe-sai-sai-music
bot/utils/extensions.py
extensions.py
py
1,048
python
en
code
1
github-code
6
[ { "api_name": "os.listdir", "line_number": 17, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 20, "usage_type": "call" }, { "api_name": "importlib.import_module", "line_number": 25, "usage_type": "call" } ]
74692291386
import numpy as np import matplotlib.pyplot as plt import pandas as pd bitcoin = pd.read_csv('data_game/BTC-EUR.csv', index_col='Date', parse_dates=True) # bitcoin['Close'].plot(figsize=(9, 6)) bitcoin.loc['2022':'2023', 'Close'].plot() plt.show() bitcoin.loc['2023', 'Close'].resample('2W').mean().plot() plt.show() ...
Lenked/Machine-Learnia-Tutorial
18_time_series.py
18_time_series.py
py
1,305
python
en
code
0
github-code
6
[ { "api_name": "pandas.read_csv", "line_number": 5, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.show", "line_number": 9, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 9, "usage_type": "name" }, { "api_name": "matplotlib.pypl...
73817265786
from copy import copy, deepcopy import pytest from pystiche_papers.utils import HyperParameters @pytest.fixture def params(): return {name: val for val, name in enumerate("abc")} def test_HyperParameters_getattr(params): hyper_parameters = HyperParameters(**params) for name, val in params.items(): ...
pystiche/papers
tests/unit/utils/test_hyper_params.py
test_hyper_params.py
py
3,593
python
en
code
4
github-code
6
[ { "api_name": "pytest.fixture", "line_number": 8, "usage_type": "attribute" }, { "api_name": "pystiche_papers.utils.HyperParameters", "line_number": 14, "usage_type": "call" }, { "api_name": "pystiche_papers.utils.HyperParameters", "line_number": 21, "usage_type": "call" ...
40290864558
""" Purpose : Retirement savings lasting period Author : Vivek T S Date : 07/11/2018 """ import matplotlib.pyplot as pyplot def retirement(balance, age, retireAge, rate, monthly, percentWithdraw): amount = balance plan1List = [amount] age1List = [age] for year in range(age*12+1,ret...
vivekworks/learning-to-code
4. Discovering Computer Science/Python/Chapter 4 - Growth And Decay/Projects/4.2/part3.py
part3.py
py
2,427
python
en
code
0
github-code
6
[ { "api_name": "matplotlib.pyplot.plot", "line_number": 44, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 44, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 45, "usage_type": "call" }, { "api_name": "matpl...
32220256613
import cv2 import numpy as np from StrawberryMaturation import * # Wildan Fajri Alfarabi def main(): img = cv2.imread("maturationStage.png") img2 = cv2.imread("Strawberry-plant-1.jpg") img3 = cv2.imread("Strawberry-plant-2.jpg") width = int(img3.shape[1] * 60 / 100) height = int(img3.sh...
wildanfajri1alfarabi/strawberry-maturation-detection
main.py
main.py
py
2,092
python
en
code
0
github-code
6
[ { "api_name": "cv2.imread", "line_number": 8, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 9, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 10, "usage_type": "call" }, { "api_name": "cv2.resize", "line_number": 14, ...
27625663917
# -*- coding: utf-8 -*- """ Created on Tue Oct 26 16:06:42 2021 @author: Viann_prems """ from PIL import Image from cv2 import cv2 import numpy as np import easyocr import time import matplotlib import matplotlib.pyplot as plt cni_recto_path = 'Images/cnirecto.png' cni_verso_path = 'Images/cniverso.png' # decouper ...
viannprems99/projet_ocr
cni.py
cni.py
py
3,543
python
es
code
0
github-code
6
[ { "api_name": "PIL.Image.open", "line_number": 31, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 31, "usage_type": "name" }, { "api_name": "numpy.array", "line_number": 60, "usage_type": "call" }, { "api_name": "easyocr.Reader", "line_numbe...
5556193757
import itertools import logging import os import sys from data.exceptions import RequestDoesntExist from plots.metrics_ import moments_dataset_xr from run.train import Timer import torch from data.load import get_data from data.vars import get_var_mask_name from models.load import load_model, load_old_model import...
CemGultekin1/cm2p6
run/analysis/lsrp_eval.py
lsrp_eval.py
py
4,359
python
en
code
0
github-code
6
[ { "api_name": "utils.arguments.options", "line_number": 25, "usage_type": "call" }, { "api_name": "utils.arguments.options", "line_number": 27, "usage_type": "call" }, { "api_name": "xarray.Dataset", "line_number": 41, "usage_type": "call" }, { "api_name": "plots....
43299451946
# from groovypy.elements.echo import Echo # from groovypy.elements.shell import Shell # # classes = [Echo, Shell] import importlib import inspect from pathlib import Path classes = [] for pkg in Path(Path(__file__).parent).iterdir(): if pkg.suffix == ".py" and pkg.name != "__init__.py": elements = import...
MarkVerbeek91/groovypy
src/groovypy/elements/__init__.py
__init__.py
py
720
python
en
code
0
github-code
6
[ { "api_name": "pathlib.Path", "line_number": 12, "usage_type": "call" }, { "api_name": "importlib.import_module", "line_number": 14, "usage_type": "call" }, { "api_name": "inspect.getmembers", "line_number": 18, "usage_type": "call" }, { "api_name": "inspect.iscla...
38482934434
from django.test import TestCase from ..models import Story import json class PostStoryTestCase(TestCase): def setUp(self): Story.objects.create(id = 1, title = "Testing Story", story= "Once upon a time ...", name = "USER", longitude = 3.14, latitude = 4.13, location = "somewhere", tag =...
bounswe/2021SpringGroup9
practice-app/api/tests/test_post_story.py
test_post_story.py
py
2,112
python
en
code
3
github-code
6
[ { "api_name": "django.test.TestCase", "line_number": 5, "usage_type": "name" }, { "api_name": "models.Story.objects.create", "line_number": 9, "usage_type": "call" }, { "api_name": "models.Story.objects", "line_number": 9, "usage_type": "attribute" }, { "api_name"...
34596293196
from collections import defaultdict from dataclasses import dataclass import os from time import time from typing import List, Optional, Union import numpy as np import torch import transformers from app.const import ( APPS_PROBLEMS_DIR, MAX_GEN_HORIZON, MODEL_NAME, NO_CUDA, NUM_BEAMS, SEED, ...
cavaunpeu/mcts-llm-codegen
app/type.py
type.py
py
8,582
python
en
code
1
github-code
6
[ { "api_name": "app.const.APPS_PROBLEMS_DIR", "line_number": 25, "usage_type": "name" }, { "api_name": "os.listdir", "line_number": 26, "usage_type": "call" }, { "api_name": "typing.Optional", "line_number": 55, "usage_type": "name" }, { "api_name": "torch.Tensor",...
35864122546
from tweepy import Stream from tweepy import OAuthHandler from tweepy.streaming import StreamListener import json import sqlite3 from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer from textblob import TextBlob from unidecode import unidecode import time from keys import * # Tweepy is an open sourc...
Chris-Valenzuela/Twitter_Sentiment
7_StreamingTweets.py
7_StreamingTweets.py
py
4,060
python
en
code
0
github-code
6
[ { "api_name": "sqlite3.connect", "line_number": 27, "usage_type": "call" }, { "api_name": "vaderSentiment.vaderSentiment.SentimentIntensityAnalyzer", "line_number": 50, "usage_type": "call" }, { "api_name": "tweepy.streaming.StreamListener", "line_number": 52, "usage_type...
39298523491
from django.urls import path from AppIntermedia.views import * urlpatterns = [ path('', inicio, name="Inicio"), path('Crear/Sucursales', crearSucursales, name='CrearSucursales'), path('Crear/Empleados', crearEmpleados, name='CrearEmpleados'), path('Crear/Servicios', crearServicios, name='CrearSe...
fredymiranda/problema_url_intermedia
EntregaIntermedia/AppIntermedia/urls.py
urls.py
py
838
python
es
code
0
github-code
6
[ { "api_name": "django.urls.path", "line_number": 5, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 6, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "django.urls.path", ...
29088741580
import pygame pygame.font.init() class Text: def __init__(self, posx, posy, culoare, marime): self.posx = posx self.posy = posy self.culoare = culoare self.Font = pygame.font.SysFont('timesnewroman', marime) def draw(self, ecran, text): txt = self.Font.rend...
Cosmin351/Snake
Text.py
Text.py
py
465
python
en
code
0
github-code
6
[ { "api_name": "pygame.font.init", "line_number": 3, "usage_type": "call" }, { "api_name": "pygame.font", "line_number": 3, "usage_type": "attribute" }, { "api_name": "pygame.font.SysFont", "line_number": 11, "usage_type": "call" }, { "api_name": "pygame.font", ...
33195056129
import cv2 import numpy as np from time import sleep import datetime def Rodar(cam=0, largura=None, altura=None, tamanho_font_letra=None, offset=None, ponto_y_init = None, ponto_y_final=None, ponto_x_init=None, ponto_x_final=None, sentido_detectar=None, cor_letra=None, posicao_letra_x = None, posicao_letra_y = None): ...
rnanc/MOBYDATA
services/counter.py
counter.py
py
4,424
python
pt
code
0
github-code
6
[ { "api_name": "cv2.VideoCapture", "line_number": 6, "usage_type": "call" }, { "api_name": "cv2.bgsegm.createBackgroundSubtractorMOG", "line_number": 36, "usage_type": "call" }, { "api_name": "cv2.bgsegm", "line_number": 36, "usage_type": "attribute" }, { "api_name...
21334348523
""" Source: https://www.youtube.com/watch?v=XfK1KajB8dI&list=PLcoE64orFoVsyzbvfgiY5iNKo30fJ4IWm&index=7&ab_channel=RocketMan USe hooks to retrieve files that's the sensor sensed and o something with this files. Maybe print its contents and then delete it and then reschedule a tag and this will kind of happen all ove...
njsdias/airflow_own
first_dags/airflow_tests/airflow_home/dags/my_first_hook.py
my_first_hook.py
py
2,040
python
en
code
0
github-code
6
[ { "api_name": "airflow.utils.dates.days_ago", "line_number": 22, "usage_type": "call" }, { "api_name": "airflow.models.DAG", "line_number": 25, "usage_type": "call" }, { "api_name": "airflow.hooks.filesystem.FSHook", "line_number": 36, "usage_type": "call" }, { "a...
32048161223
# -*- coding: utf-8 -*- from django.conf.urls import url from . import views app_name = 'mysql_account' urlpatterns = [ url(r'^$', views.show_all(), name='show_all'), url(r'^new_account/', views.new_account(), name='new_account') ]
milespeng/django
bigdata/mysql_account/urls.py
urls.py
py
242
python
en
code
0
github-code
6
[ { "api_name": "django.conf.urls.url", "line_number": 8, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 9, "usage_type": "call" } ]
21169225518
from os import system from flask import Flask, render_template, jsonify app = Flask(__name__) @app.route('/') def main(): return render_template('index.html') @app.route('/crawl') def start_crawler(): system('python -m scrapy crawl yy') return jsonify({'result': 'Task created'}) if __name__ == '__main...
zeratul0097/auto_exp
auto_exp/flaskr/app.py
app.py
py
339
python
en
code
0
github-code
6
[ { "api_name": "flask.Flask", "line_number": 3, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 8, "usage_type": "call" }, { "api_name": "os.system", "line_number": 13, "usage_type": "call" }, { "api_name": "flask.jsonify", "line_n...
29064391705
import os from PIL import Image import io def open_image(img_path:str, size:(int, int) = None) -> bytes: with Image.open(img_path) as im: if size: im.thumbnail(size) image_extension = os.path.splitext(img_path)[1][1:] return get_image_bytes(im, image_extension) def get_image_bytes(image:Image,...
Askodan/web_wycieczka
image_server/app/image_handler.py
image_handler.py
py
452
python
en
code
0
github-code
6
[ { "api_name": "PIL.Image.open", "line_number": 6, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 6, "usage_type": "name" }, { "api_name": "os.path.splitext", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "line_number": 9...
40124071039
import json #open and read vegetation data crop = open('harvest-hero-a01de-default-rtdb-vegetation-export.json') crop_data = json.load(crop) #open and read recipe data recipe = open('recipes.json') recipe_data = json.load(recipe) #make an id for vegetation data id = 1 for crop in crop_data: crop['id...
SteveHuy/Harvest-Hero
Database+APIs/id_crop_recipe.py
id_crop_recipe.py
py
1,111
python
en
code
0
github-code
6
[ { "api_name": "json.load", "line_number": 5, "usage_type": "call" }, { "api_name": "json.load", "line_number": 9, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 37, "usage_type": "call" } ]
8372217683
import json import os from botocore.exceptions import ClientError from botocore.stub import Stubber import pytest from builder.authentication.ssm import fetch_credentials def test_fetch_credentials(ssm): os.environ.update({ "SECRET_NAME": "secret", "AWS_DEFAULT_REGION": "us-east-1", "AWS...
m1l0ai/m1l0_image_builder
tests/test_authentication_ssm.py
test_authentication_ssm.py
py
1,784
python
en
code
0
github-code
6
[ { "api_name": "os.environ.update", "line_number": 11, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 11, "usage_type": "attribute" }, { "api_name": "json.dumps", "line_number": 17, "usage_type": "call" }, { "api_name": "builder.authentication.s...
41650734880
import socket import argparse import json import time import logging import sys # uncomment to see detailed info #logging.basicConfig(level=logging.INFO) def peel_size(data,pos): size = int.from_bytes(data[pos:pos+4],byteorder='big') return (size,pos+4) def peel_json(data,pos,size_left): packet_size = len(data) ...
SocketsAndDragons/Server
dragon.py
dragon.py
py
2,381
python
en
code
1
github-code
6
[ { "api_name": "time.sleep", "line_number": 46, "usage_type": "call" }, { "api_name": "logging.info", "line_number": 51, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 55, "usage_type": "call" }, { "api_name": "socket.recv", "line_number": 6...
22961416494
import matplotlib.pyplot as plt import numpy as np import pandas as pd import requests # set period date_from = '2018-01-01' date_to = '2018-01-30' # method which takes data from json. def fetch_currency(currency,beg,end): url = 'http://api.nbp.pl/api/exchangerates/rates/A/' + currency + "/" + date_from + "/" + d...
Pukala/SI
lab1.py
lab1.py
py
1,237
python
en
code
0
github-code
6
[ { "api_name": "requests.get", "line_number": 13, "usage_type": "call" }, { "api_name": "pandas.DataFrame.from_dict", "line_number": 22, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 22, "usage_type": "attribute" }, { "api_name": "pandas....
33269413040
from viola import viola from writeOutSeparate import writeOutSeparate from saveImg import saveImg import cv2 as cv roundName ="validationImageList.txt" with open(roundName, "r") as readFiles: for image in readFiles: noLineBreak = image.rstrip() [imageFolder,imageName] = noLineBreak.split('/') ...
lucasff57/Viola_x_Yolo
viola/predict.py
predict.py
py
622
python
en
code
0
github-code
6
[ { "api_name": "cv2.imread", "line_number": 12, "usage_type": "call" }, { "api_name": "viola.viola", "line_number": 13, "usage_type": "call" }, { "api_name": "writeOutSeparate.writeOutSeparate", "line_number": 14, "usage_type": "call" }, { "api_name": "saveImg.save...
72532278909
import logging from typing import cast from fastapi import FastAPI from servicelib.rabbitmq import ( RabbitMQClient, RabbitMQRPCClient, wait_till_rabbitmq_responsive, ) from settings_library.rabbit import RabbitSettings from ..core.errors import ConfigurationError logger = logging.getLogger(__name__) d...
ITISFoundation/osparc-simcore
services/director-v2/src/simcore_service_director_v2/modules/rabbitmq.py
rabbitmq.py
py
1,732
python
en
code
35
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 14, "usage_type": "call" }, { "api_name": "fastapi.FastAPI", "line_number": 17, "usage_type": "name" }, { "api_name": "settings_library.rabbit.RabbitSettings", "line_number": 19, "usage_type": "name" }, { "api_name...
12881537312
import cv2 import numpy as np import multiprocessing import threading import time import argparse FRAME_QUEUE = multiprocessing.JoinableQueue() RESULT_QUEUE = multiprocessing.Queue() # defaults NWORKERS = 2 PARALLEL_TYPE = 'thread' FONT = cv2.FONT_HERSHEY_SIMPLEX def process_frame(frame): # Convert BGR to HSV ...
fzea01/deteccar_pp2
ted.py
ted.py
py
4,902
python
en
code
0
github-code
6
[ { "api_name": "multiprocessing.JoinableQueue", "line_number": 8, "usage_type": "call" }, { "api_name": "multiprocessing.Queue", "line_number": 9, "usage_type": "call" }, { "api_name": "cv2.FONT_HERSHEY_SIMPLEX", "line_number": 14, "usage_type": "attribute" }, { "a...
8692572472
import re import uuid import colander from unicore.comments.service.models import ( COMMENT_MAX_LENGTH, COMMENT_CONTENT_TYPES, COMMENT_MODERATION_STATES, COMMENT_STREAM_STATES) # ISO 639 3-letter code + ISO 3166-1 alpha-2 LOCALE_CODE_RE = re.compile(r'^[a-z]{3}_[A-Z]{2}$') def known_uuid_validator...
universalcore/unicore.comments
unicore/comments/service/validators.py
validators.py
py
1,566
python
en
code
1
github-code
6
[ { "api_name": "re.compile", "line_number": 14, "usage_type": "call" }, { "api_name": "colander.OneOf", "line_number": 25, "usage_type": "call" }, { "api_name": "uuid.UUID", "line_number": 25, "usage_type": "call" }, { "api_name": "colander.deferred", "line_num...
37935756154
import os import skimage.transform as trans import skimage.io as io import matplotlib.pyplot as plt import numpy as np def gen_labels(path): images = gen_images(path) img = images[150,0,:,:,:,0] # labels(img) # path = "data/RednBlue/Axial/Label" # outpath = "test" # img = io.imread(os.path....
Phid13/IP2
labels.py
labels.py
py
1,823
python
en
code
0
github-code
6
[ { "api_name": "numpy.zeros", "line_number": 18, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 40, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 42, "usage_type": "call" }, { "api_name": "skimage.io.imread", "line_numbe...
2620610280
import os import requests import json import base64 import io import logging import pandas as pd from tqdm import tqdm from nomeclature import WBNomenclature from pymyskald import get_all_single_products_code_id_info, get_all_multi_product_info class ImageFormatException(Exception): pass class Image: CORRE...
skribl5000/MoiSkladImplementation
integrations/photo_update.py
photo_update.py
py
5,120
python
en
code
0
github-code
6
[ { "api_name": "requests.get", "line_number": 45, "usage_type": "call" }, { "api_name": "io.BytesIO", "line_number": 46, "usage_type": "call" }, { "api_name": "base64.b64encode", "line_number": 47, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line...
3336319745
#!/usr/bin/env python import json import logging from classes.backup import Backup # read configuration with open('./etc/backup.conf') as config_file: config = json.load(config_file) # logging # Can't use logging object in the config file. # So we need to transform loglevel in config to numeric level numeric_leve...
Scolavisa/packup
packup.py
packup.py
py
910
python
en
code
1
github-code
6
[ { "api_name": "json.load", "line_number": 8, "usage_type": "call" }, { "api_name": "logging.basicConfig", "line_number": 14, "usage_type": "call" }, { "api_name": "logging.info", "line_number": 21, "usage_type": "call" }, { "api_name": "classes.backup.Backup", ...
26249010689
import asyncio from ircrobots import Bot from time import time from .database import Database async def check_expiry(bot: Bot, db: Database): while True: now = int(time()) wait = 10.0 if not bot.servers: await asyncio.sleep(wait) continue server = l...
examknow/bans
bans/timers.py
timers.py
py
1,092
python
en
code
0
github-code
6
[ { "api_name": "ircrobots.Bot", "line_number": 8, "usage_type": "name" }, { "api_name": "database.Database", "line_number": 8, "usage_type": "name" }, { "api_name": "time.time", "line_number": 10, "usage_type": "call" }, { "api_name": "asyncio.sleep", "line_num...
321803461
import os from PIL import Image class GraphTrendDataset(Dataset): def __init__(self, **kwargs): # load in the data self.photos_path = kwargs['photos_path'] self.labels_path = kwargs['labels_path'] self.transform = kwargs['transform'] self.flip = kwargs.get('flip', True) ...
landmann/trend-detection
resnet-model/train_set_with_flips.py
train_set_with_flips.py
py
1,479
python
en
code
1
github-code
6
[ { "api_name": "PIL.Image.open", "line_number": 35, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 35, "usage_type": "name" }, { "api_name": "os.path.join", "line_number": 35, "usage_type": "call" }, { "api_name": "os.path", "line_number": 35...
36065544298
import requests from pprint import pprint import os from dotenv import load_dotenv from flight_search import FlightSearch load_dotenv() # take environment variables from.env SHEETY_AUTH = os.getenv("sheety_authorization") SHEETY_ENDPOINT = "https://api.sheety.co/7e5dc26de00c4f9595d05537d7febfae/flightDeals/prices" f...
Shivam29k/Python_Projects
flight_deals_alert/data_manager.py
data_manager.py
py
1,573
python
en
code
1
github-code
6
[ { "api_name": "dotenv.load_dotenv", "line_number": 6, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 8, "usage_type": "call" }, { "api_name": "flight_search.FlightSearch", "line_number": 11, "usage_type": "call" }, { "api_name": "requests.get", ...
20444907983
''' 将影片OR摄影机画面定时拍照 -> JPG转binary -> 传到kafka ''' import cv2 ,imutils , sys import numpy as np from confluent_kafka import Producer # 要开启的影片或摄影机 cap = cv2.VideoCapture('../../Pyai0815/yolo/test2/VIDEO0014.mp4') # 计数器 accum = 1 # 用来接收从Consumer instance发出的error讯息 def error_cb(err): print('Error: %s' % err) # 主程式进入...
hung0422/practice_test
Kafka_YOLO/camera_kafka2.py
camera_kafka2.py
py
2,479
python
zh
code
0
github-code
6
[ { "api_name": "cv2.VideoCapture", "line_number": 10, "usage_type": "call" }, { "api_name": "confluent_kafka.Producer", "line_number": 28, "usage_type": "call" }, { "api_name": "cv2.imshow", "line_number": 37, "usage_type": "call" }, { "api_name": "imutils.resize",...
24352033520
""" Dispersion module""" import numpy as np from numpy import pi, linspace, sqrt, sin, r_, conj, exp, \ diff,cumsum from scipy.interpolate import UnivariateSpline as spline from scipy.integrate import cumtrapz from .units import * class Dispersion(): def __init__(self, wl = None, n = No...
actionfarsi/farsilab
farsilab/dispersion.py
dispersion.py
py
4,786
python
en
code
0
github-code
6
[ { "api_name": "numpy.linspace", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.ones_like", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.pi", "line_number": 24, "usage_type": "name" }, { "api_name": "numpy.pi", "line_number":...
33864893024
from selenium import webdriver from selenium.webdriver.chrome.options import Options from selenium.webdriver.common.keys import Keys import bs4, pprint #directory to find chrome webdriver chrome_driver = r'C:\Users\Yan\Desktop\git\projects\scrappers\insta_scrapper\chromedriver_win32\chromedriver.exe' #instance a chro...
nomadbitcoin/projects
scrappers/insta_scrapper/info_in_Publication.py
info_in_Publication.py
py
3,639
python
en
code
0
github-code
6
[ { "api_name": "selenium.webdriver.chrome.options.Options", "line_number": 10, "usage_type": "call" }, { "api_name": "selenium.webdriver.Chrome", "line_number": 14, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 14, "usage_type": "name" }, {...
10128930138
from django.urls import path from . import views app_name = 'face' urlpatterns = [ path('upload/', views.FileUploadView.as_view()), path('index/', views.index, name='index'), path('result/', views.send, name='send'), path('train/', views.FileTrainView.as_view(), name='train'), path('face/', views....
Shahin-Sefidgaran/similarity-to-celebrity-with-facial-landmarks
face/urls.py
urls.py
py
364
python
en
code
0
github-code
6
[ { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 8, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 9, "usage_type": "call" }, { "api_name": "django.urls.path", ...
434952997
import numpy as np from tkinter import * from lightfm.datasets import fetch_movielens from lightfm import LightFM from sklearn.metrics.pairwise import cosine_similarity import pandas as pd import importlib import time #----------------------------------------------------------------------------------------------------...
sandersona3/CS4319_RecSys4
recSys4.py
recSys4.py
py
9,850
python
en
code
0
github-code
6
[ { "api_name": "lightfm.datasets.fetch_movielens", "line_number": 24, "usage_type": "call" }, { "api_name": "lightfm.LightFM", "line_number": 27, "usage_type": "call" }, { "api_name": "numpy.arange", "line_number": 56, "usage_type": "call" }, { "api_name": "numpy.a...
3951436710
from django.conf.urls import url, include from . import views from django.contrib.auth.views import login urlpatterns = [ url(r'^$', login, {'template_name': 'accounts/login.html'}), url(r'^login/$', login, {'template_name': 'accounts/login.html'}), url(r'^logout/$', views.logout, name="logout"), url(r...
pratik151192/FairnessApp
accounts/urls.py
urls.py
py
525
python
en
code
1
github-code
6
[ { "api_name": "django.conf.urls.url", "line_number": 6, "usage_type": "call" }, { "api_name": "django.contrib.auth.views.login", "line_number": 6, "usage_type": "argument" }, { "api_name": "django.conf.urls.url", "line_number": 7, "usage_type": "call" }, { "api_na...
1245186307
from pathlib import Path from tkinter import * from tkinter import Tk, Button, messagebox from requests import get from os import path, remove from pygame import mixer from PIL import ImageTk, Image from threading import Thread from random import shuffle from re import sub from yt_dlp import YoutubeDL from mutagen.mp3 ...
GaGa-Team/SpautiNoFay
main.py
main.py
py
17,623
python
en
code
8
github-code
6
[ { "api_name": "tkinter.Tk", "line_number": 14, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 25, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 26, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number"...
30520173925
import task_A from langdetect import detect_langs # how likely is a string of text english def english_prob(text) -> float: try: detected_languages = detect_langs(text) for lang in detected_languages: if lang.lang == 'en': return lang.prob return 0.0 except ...
mhaneman/CSC323_PROJ_1
src/task_B.py
task_B.py
py
905
python
en
code
0
github-code
6
[ { "api_name": "langdetect.detect_langs", "line_number": 8, "usage_type": "call" }, { "api_name": "task_A.XOR_hex", "line_number": 26, "usage_type": "call" }, { "api_name": "task_A.bytes_to_ascii", "line_number": 27, "usage_type": "call" } ]
5722739800
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Jun 10 14:21:20 2019 @author: siddharth """ from argparse import ArgumentParser import os,random,evaluate from utils import list_files TMP_DIR = '.fast_neural_style_frames_%s/' % random.randint(0,99999) DEVICE = '/gpu:0' BATCH_SIZE = 4 def build_par...
slickFix/Video_style_transfer
transform_video.py
transform_video.py
py
2,086
python
en
code
0
github-code
6
[ { "api_name": "random.randint", "line_number": 14, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 50, "usage_type": "call" }, { "api_name": "os.path", "...
71145092669
import datetime from django.dispatch import Signal from fractal.core.event_sourcing.event import SendingEvent from fractal.core.event_sourcing.event_projector import EventProjector from fractal.core.event_sourcing.message import Message fractal_event_signal = Signal(providing_args=["message"]) class DjangoSignalEv...
douwevandermeij/fractal
fractal/contrib/django/projectors.py
projectors.py
py
778
python
en
code
12
github-code
6
[ { "api_name": "django.dispatch.Signal", "line_number": 9, "usage_type": "call" }, { "api_name": "fractal.core.event_sourcing.event_projector.EventProjector", "line_number": 12, "usage_type": "name" }, { "api_name": "fractal.core.event_sourcing.event.SendingEvent", "line_numbe...
27107031918
import importlib import inspect import times from uuid import uuid4 from cPickle import loads, dumps, UnpicklingError from .local import LocalStack from .connections import resolve_connection from .exceptions import UnpickleError, NoSuchJobError def enum(name, *sequential, **named): values = dict(zip(sequential, ...
SteelHouseLabs/vFense
python/python-2.7.5/lib/python2.7/site-packages/rq/job.py
job.py
py
14,834
python
en
code
5
github-code
6
[ { "api_name": "cPickle.loads", "line_number": 28, "usage_type": "call" }, { "api_name": "cPickle.UnpicklingError", "line_number": 29, "usage_type": "name" }, { "api_name": "exceptions.UnpickleError", "line_number": 30, "usage_type": "call" }, { "api_name": "queue....
16375683180
import asyncio import datetime import logging import os from sanic import Sanic from sanic.exceptions import SanicException from sanic.response import json STARTED = datetime.datetime.utcnow().isoformat() DIR = os.path.dirname(os.path.realpath(__file__)) app = Sanic() app.config.REQUEST_MAX_SIZE = 100000 # 100 KB a...
tcolgate/gracetests
python/graceful/main.py
main.py
py
1,575
python
en
code
2
github-code
6
[ { "api_name": "datetime.datetime.utcnow", "line_number": 10, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 10, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 11, "usage_type": "call" }, { "api_name": "os.pa...
10909603220
import pytest from tinkoff.invest.schemas import FuturesResponse from bot.scanner.scanner import ResponseFilter def test_response_filter_raises_errors(futures_response): with pytest.raises(KeyError): ResponseFilter(futures_response.instruments) with pytest.raises(ValueError): ResponseFilter(F...
holohup/trademan-1.0-alpha-public
tests/bot_tests/spread_yield_tests/test_filters.py
test_filters.py
py
580
python
en
code
2
github-code
6
[ { "api_name": "pytest.raises", "line_number": 8, "usage_type": "call" }, { "api_name": "bot.scanner.scanner.ResponseFilter", "line_number": 9, "usage_type": "call" }, { "api_name": "pytest.raises", "line_number": 10, "usage_type": "call" }, { "api_name": "bot.scan...
21109060906
from __future__ import annotations import datetime import itertools import json import math import re import time from dataclasses import dataclass from pathlib import Path from typing import Callable, List, Optional, Tuple from osh.history import Event from osh.osh_files import ( OshFileChangedMuch, OshFileR...
dkuettel/one-shell-history
python/osh/sources.py
sources.py
py
3,093
python
en
code
0
github-code
6
[ { "api_name": "pathlib.Path", "line_number": 25, "usage_type": "name" }, { "api_name": "math.inf", "line_number": 31, "usage_type": "attribute" }, { "api_name": "time.time", "line_number": 36, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number"...
30906447171
from scripts.python.get_floorplan_link import get_floorplan import cv2 import requests from pytesseract import pytesseract def get_floorplan_text(rightmove_link: str): floorplan_link = get_floorplan(rightmove_link) try: if len(floorplan_link) == 0: return 0 config = ('-l eng --o...
GregorMonsonFD/holmly_sourcing_legacy
scripts/python/extract_text.py
extract_text.py
py
848
python
en
code
0
github-code
6
[ { "api_name": "scripts.python.get_floorplan_link.get_floorplan", "line_number": 9, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 17, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 21, "usage_type": "call" }, { "api_name":...
73512910589
import os from dotenv import load_dotenv import openai import logging # Import functions from the separate files from utils.external_files_loading import loadweb_document from utils.text_splitter import split_document from embeddings_utils.embeddings_manager import manage_embeddings from utils.chat_setup import setup_...
omdivyatej/advanced_finance_ai
main_app/main.py
main.py
py
1,803
python
en
code
0
github-code
6
[ { "api_name": "dotenv.load_dotenv", "line_number": 18, "usage_type": "call" }, { "api_name": "openai.api_key", "line_number": 19, "usage_type": "attribute" }, { "api_name": "os.getenv", "line_number": 19, "usage_type": "call" }, { "api_name": "logging.basicConfig"...
24747355919
# -*- coding: utf-8 -*- from django.conf.urls import patterns, include, url from django.conf import settings # Uncomment the next two lines to enable the admin: # from django.contrib import admin # admin.autodiscover() urlpatterns = patterns('', url(r'^$', 'www.misc.views.show_index_...
lantianlz/zx
www/urls.py
urls.py
py
3,959
python
en
code
1
github-code
6
[ { "api_name": "django.conf.urls.patterns", "line_number": 10, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 11, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 12, "usage_type": "call" }, { "api_name": "d...
31030926846
#!/usr/bin/env python3 import time import requests import csv import os from argparse import ArgumentParser from math import sqrt def get_voltages_pi(): IP_pi = '130.60.164.209' return requests.get('http://%s:8080/read' % IP_pi).json() def get_average(measurements): n = len(measurements) return sum(me...
fstaeg/croc_tools
probecard_readout.py
probecard_readout.py
py
4,249
python
en
code
0
github-code
6
[ { "api_name": "requests.get", "line_number": 11, "usage_type": "call" }, { "api_name": "math.sqrt", "line_number": 21, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 25, "usage_type": "call" }, { "api_name": "time.sleep", "line...
22553397341
from pyfirmata import Arduino, util import time carte = Arduino ('/dev/ttyACM0') acquisition = util.Iterator (carte) acquisition.start () sortie = carte.get_pin ('d:10:o') time.sleep (1.0) sortie.write (True) time.sleep (4) sortie.write (False) carte.exit ()
PsychoLeo/Arduino
self/led_light.py
led_light.py
py
262
python
en
code
0
github-code
6
[ { "api_name": "pyfirmata.Arduino", "line_number": 4, "usage_type": "call" }, { "api_name": "pyfirmata.util.Iterator", "line_number": 5, "usage_type": "call" }, { "api_name": "pyfirmata.util", "line_number": 5, "usage_type": "name" }, { "api_name": "time.sleep", ...
19882762540
from pathlib import Path from collections import defaultdict from typing import Dict, Tuple, Set, Optional, Union, AsyncIterator, NoReturn, Pattern import trio from trio import lowlevel from pendulum import DateTime from structlog import get_logger from async_generator import asynccontextmanager from guardata.client....
bitlogik/guardata
guardata/client/fs/storage/workspace_storage.py
workspace_storage.py
py
14,104
python
en
code
9
github-code
6
[ { "api_name": "structlog.get_logger", "line_number": 31, "usage_type": "call" }, { "api_name": "guardata.client.types.LocalDevice", "line_number": 45, "usage_type": "name" }, { "api_name": "pathlib.Path", "line_number": 46, "usage_type": "name" }, { "api_name": "g...
16654410150
import sys import argparse from time import sleep from axiom_tc import axiom from axiom_tc import u06_SelfTest from axiom_tc import u07_LiveView def init_axiom_comms(args): # Import the requested comms layer if args.i == "i2c": if args.i2c_bus == None or args.i2c_address == None: print("Th...
TouchNetix/axexamples
SelfTest/selftest_02.py
selftest_02.py
py
3,525
python
en
code
1
github-code
6
[ { "api_name": "sys.exit", "line_number": 15, "usage_type": "call" }, { "api_name": "axiom_tc.I2C_Comms.I2C_Comms", "line_number": 18, "usage_type": "call" }, { "api_name": "sys.exit", "line_number": 24, "usage_type": "call" }, { "api_name": "axiom_tc.SPI_Comms.SPI...
73439299068
from pathlib import Path import time from utils.logging import get_logger_for_module from data_models import NavigatorData, MontageData LOG = get_logger_for_module(__name__) class NavigatorProcessor(): processors_by_session = {} tracking_interval = 60 @classmethod def for_session(cls, session): ...
zruan/hotspur_command
processors/navigator_processor.py
navigator_processor.py
py
7,652
python
en
code
0
github-code
6
[ { "api_name": "utils.logging.get_logger_for_module", "line_number": 8, "usage_type": "call" }, { "api_name": "data_models.NavigatorData.fetch_all", "line_number": 34, "usage_type": "call" }, { "api_name": "data_models.NavigatorData", "line_number": 34, "usage_type": "name...
40421485581
from browser import bind, document from scripts.form import form from scripts.query import get_query_string inputs = [ {'name': 'nome', 'type': 'text', 'label': 'nome'}, {'name': 'email', 'type': 'email', 'label': 'email'}, {'name': 'senha', 'type': 'password', 'label': 'senha', 'required': True}, { ...
dunossauro/curso-python-selenium-pages
paginas/exercicios/exercicio_07.py
exercicio_07.py
py
1,201
python
pt
code
13
github-code
6
[ { "api_name": "scripts.query.get_query_string", "line_number": 24, "usage_type": "call" }, { "api_name": "scripts.form.form", "line_number": 25, "usage_type": "call" }, { "api_name": "browser.document", "line_number": 30, "usage_type": "name" }, { "api_name": "bro...
7161749854
""" Given a sorted integer array arr, two integers k and x, return the k closest integers to x in the array. The result should also be sorted in ascending order. An integer a is closer to x than an integer b if: |a - x| < |b - x|, or |a - x| == |b - x| and a < b Example 1: Input: arr = [1,2,3,4,5], k = 4,...
CompetitiveCodingLeetcode/LeetcodeEasy
JulyLeetcodeChallenge/FindKClosestElementsQ658.py
FindKClosestElementsQ658.py
py
3,194
python
en
code
0
github-code
6
[ { "api_name": "typing.List", "line_number": 62, "usage_type": "name" } ]
34181360702
# -*- coding: utf-8 -*- """ Created on Mon Nov 9 15:47:20 2020 @author: Kollarlab """ import userfuncs import matplotlib.pyplot as plt import numpy as np import os from mpl_toolkits.axes_grid1.inset_locator import inset_axes saveDir = r'Z:\Data\HouckTaTransmon\20201109' stamp = userfuncs.timestamp() name = 'cavity...
MRitter95/Kollar-Lab
Old_scripts_delete_20220804/Scripts/legacycode/TransSweep.py
TransSweep.py
py
1,826
python
en
code
2
github-code
6
[ { "api_name": "userfuncs.timestamp", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.linspace", "line_number": 25, "usage_type": "call" }, { "api_name": "numpy.linspace", "line_number": 26, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.f...
16629861210
import multiprocessing import time import numpy as np import pandas as pd from gensim.models import Word2Vec from sa_logic.models import ClassifierModels from sa_logic.support import Support from sa_root import ROOT_DIR_DATA_EMBEDDING from sklearn.model_selection import train_test_split, cross_val_score, cross_val_pred...
EdwinPuertas/DomainSentimentAnalysis
sa_logic/bank2vec_sa.py
bank2vec_sa.py
py
5,099
python
en
code
0
github-code
6
[ { "api_name": "warnings.filterwarnings", "line_number": 11, "usage_type": "call" }, { "api_name": "sa_logic.support.Support", "line_number": 16, "usage_type": "call" }, { "api_name": "sa_root.ROOT_DIR_DATA_EMBEDDING", "line_number": 17, "usage_type": "name" }, { "...
38075262195
import os import argparse import json import time import numpy as np import torch torch.backends.cudnn.enabled = True import torch.nn as nn import torch.nn.functional as F from configs.config import cfg, merge_cfg_from_file from datasets.datasets import create_dataset from models.modules import AddSpatialInfo, Change...
Holipori/EKAID
model/test_mimic.py
test_mimic.py
py
5,982
python
en
code
8
github-code
6
[ { "api_name": "torch.backends", "line_number": 7, "usage_type": "attribute" }, { "api_name": "argparse.ArgumentParser", "line_number": 25, "usage_type": "call" }, { "api_name": "configs.config.merge_cfg_from_file", "line_number": 32, "usage_type": "call" }, { "api...
5484841507
import numpy as np import uproot import ROOT import sys sys.path.append('../utils') import utils as utils ROOT.gROOT.SetBatch(True) df1 = uproot.open("/data/shared/hyp_run_3/mc/AO2D_MC.root")["O2mchypcands"].arrays(library="pd") df2 = df1.copy(deep=True) df1.query("fIsReco > 0", inplace=True) df2.query("fIsReco > 0",...
lbariogl/HyperRoutine
resolution/calibrate_he3_momentum.py
calibrate_he3_momentum.py
py
5,804
python
en
code
0
github-code
6
[ { "api_name": "sys.path.append", "line_number": 5, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 5, "usage_type": "attribute" }, { "api_name": "ROOT.gROOT.SetBatch", "line_number": 8, "usage_type": "call" }, { "api_name": "ROOT.gROOT", "line...
26731615587
#!/usr/bin/env python import os import sys import shutil import argparse import errno def split_all(path): tails=[] while True: head, tail = os.path.split(path) if tail: tails.append(tail) path = head else: if head: tails.append(head)...
pmop/cppstats
cppstats/link_or_copy_file.py
link_or_copy_file.py
py
6,532
python
en
code
null
github-code
6
[ { "api_name": "os.path.split", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path", "line_number": 12, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 34, "usage_type": "call" }, { "api_name": "os.path", "line_number": ...