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
7357739385
from flask import Flask, request as req, render_template from requests import get from bs4 import BeautifulSoup as bs import re app = Flask(__name__) @app.route("/") def index(): kota = get_city()["result"] return render_template("index.html",city=kota) @app.route("/jadwal") def jadwal(): try: id = re...
karjok/sholat-api
app/sholat_api.py
sholat_api.py
py
2,476
python
en
code
3
github-code
18
[ { "api_name": "flask.Flask", "line_number": 6, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 11, "usage_type": "call" }, { "api_name": "flask.request.args", "line_number": 16, "usage_type": "attribute" }, { "api_name": "flask.reques...
43276446060
#coding:utf-8 import os import re import json from datetime import datetime, timedelta from django.conf import settings from django.db import models from django.db.models import BooleanField from django.db.models import CASCADE from django.db.models import Case from django.db.models import Count from django.db.models ...
piratar/wasa2il
core/models.py
models.py
py
8,469
python
en
code
null
github-code
18
[ { "api_name": "django.db.models.Manager", "line_number": 31, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 31, "usage_type": "name" }, { "api_name": "django.db.models.Count", "line_number": 35, "usage_type": "call" }, { "api_name": ...
24180047193
import sqlalchemy as alch import pandas as pd from getpass import getpass #from import tools.sql_tools as sql from config.configuration import engine def check(what,string): """ recieves a table name and a string returns True if 'string' exists in table name and False if not """ if what == "char...
jalex141/Emo_C3PO
src/data_to_sql.py
data_to_sql.py
py
3,303
python
en
code
1
github-code
18
[ { "api_name": "config.configuration.engine.execute", "line_number": 16, "usage_type": "call" }, { "api_name": "config.configuration.engine", "line_number": 16, "usage_type": "name" }, { "api_name": "config.configuration.engine.execute", "line_number": 23, "usage_type": "c...
71209529639
from collections import namedtuple from contextlib import contextmanager, ExitStack from functools import partial from typing import ContextManager, Callable, Any, TypeVar, overload from ._async_value import AsyncValue def _IDENTITY(x): return x T_OUT = TypeVar('T_OUT') @overload def compose_values(**value_m...
groove-x/trio-util
src/trio_util/_compose_values.py
_compose_values.py
py
3,677
python
en
code
59
github-code
18
[ { "api_name": "typing.TypeVar", "line_number": 13, "usage_type": "call" }, { "api_name": "_async_value.AsyncValue", "line_number": 17, "usage_type": "name" }, { "api_name": "typing.overload", "line_number": 16, "usage_type": "name" }, { "api_name": "typing.Context...
35766834935
# -*- coding: utf-8 -*- import asyncio import datetime import functools import json import os import aiopg.sa import structlog import uvloop from aiohttp import web from jsonrpcserver import config from jsonrpcserver.async_methods import AsyncMethods from sqlalchemy.engine.url import make_url from .methods.account_...
steemit/sbds
sbds/server/serve.py
serve.py
py
4,447
python
en
code
37
github-code
18
[ { "api_name": "asyncio.set_event_loop_policy", "line_number": 21, "usage_type": "call" }, { "api_name": "uvloop.EventLoopPolicy", "line_number": 21, "usage_type": "call" }, { "api_name": "jsonrpcserver.config.log_responses", "line_number": 23, "usage_type": "attribute" ...
32172411205
#!/usr/bin/env python # -*- encoding: utf-8 -*- # # @Description: 获取虚拟信息 # @PreInstall: BeautifulSoup,lxml,requests # @Author : https://www.bajins.com # @File : fake_website.py # @Version: 1.0.0 # @Time : 2019/12/26/026 12:10 # @Project: reptile-python # @Package: # @Software: PyCharm import random import re import r...
bajins/scripts_python
fake_website.py
fake_website.py
py
6,613
python
en
code
6
github-code
18
[ { "api_name": "requests.packages.urllib3.disable_warnings", "line_number": 22, "usage_type": "call" }, { "api_name": "urllib3.exceptions.InsecureRequestWarning", "line_number": 22, "usage_type": "argument" }, { "api_name": "requests.packages", "line_number": 22, "usage_ty...
39034012095
#!/usr/bin/env python3 """Classify chain-gene pairs as orthologous, paralogous etc. Each chain-gene pair has a set of features. We have a XGBoost pre-trained model that can classify them. """ import argparse import sys import numpy as np import pandas as pd import joblib import xgboost as xgb from version import __ver...
hillerlab/TOGA
modules/classify_chains.py
classify_chains.py
py
12,437
python
en
code
114
github-code
18
[ { "api_name": "argparse.ArgumentParser", "line_number": 49, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 60, "usage_type": "attribute" }, { "api_name": "sys.exit", "line_number": 62, "usage_type": "call" }, { "api_name": "pandas.read_csv", ...
73027393320
from unified.core.actions import Actions import json import requests from time_tracking.harvest import util from time_tracking.harvest.entities.harvest_client import HarvestClient from time_tracking.harvest.entities.harvest_contact import HarvestContact from time_tracking.harvest.entities.harvest_project import Harvest...
dipendrabaidawa/unified_api
unified/modules/main/categories/time_tracking/harvest/actions.py
actions.py
py
4,005
python
en
code
0
github-code
18
[ { "api_name": "unified.core.actions.Actions", "line_number": 12, "usage_type": "name" }, { "api_name": "time_tracking.harvest.entities.harvest_client.HarvestClient", "line_number": 17, "usage_type": "call" }, { "api_name": "time_tracking.harvest.util.rest", "line_number": 21,...
4488841011
from django.contrib import admin # Register your models here. from .models import Olymp class OlympModelAdmin(admin.ModelAdmin): list_display = ["title", "start_time", "timestamp"] list_display_links = ["start_time"] list_editable = ["title"] list_filter = ["start_time", "timestamp"] search_fields = ["title"] ...
canstri/enigmath
Enigmath/olymps/admin.py
admin.py
py
393
python
en
code
0
github-code
18
[ { "api_name": "django.contrib.admin.ModelAdmin", "line_number": 6, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 6, "usage_type": "name" }, { "api_name": "models.Olymp", "line_number": 14, "usage_type": "name" }, { "api_name": "...
70018318759
import time from scipy.stats import uniform, gamma, beta, bernoulli, truncnorm, norm, multivariate_normal, weibull_min, expon, loggamma from scipy import stats, linalg import numpy as np import math #from numpy.polynomial.polynomial import polyval from matplotlib import pyplot as plt import scipy import scipy.linalg ...
joelchaconcastillo/Computo_Cientifico
Tareas/TareaVIII_Joel_Chacon_Castillo/Codigo/TareaVIII_Punto1.py
TareaVIII_Punto1.py
py
3,124
python
en
code
0
github-code
18
[ { "api_name": "numpy.set_printoptions", "line_number": 12, "usage_type": "call" }, { "api_name": "sys.maxsize", "line_number": 12, "usage_type": "attribute" }, { "api_name": "numpy.random.seed", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.rando...
22010731668
import dataclasses import config import logging from telegram.ext import Updater from telegram.ext import Updater, CommandHandler, MessageHandler from telegram.ext import MessageHandler, Filters from models import ReceiptInfo, ReceiptResult from receipts_api import request_receipt_details import spread_sheet from util ...
Moleus/store_receipts_bot
src/bot.py
bot.py
py
2,292
python
en
code
0
github-code
18
[ { "api_name": "logging.basicConfig", "line_number": 16, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 17, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 18, "usage_type": "call" }, { "api_name": "receipts_api....
28670641834
# Read text from a file, and count the occurence of words in that text # Example: # count_words("The cake is done. It is a big cake!") # --> {"cake":2, "big":1, "is":2, "the":1, "a":1, "it":1} from importlib.resources import contents def read_file_content(filename): # [assignment] Add your code here with ope...
keme-ebi/i4gxzuri
Reading-Text-Files/main.py
main.py
py
884
python
en
code
0
github-code
18
[ { "api_name": "importlib.resources.contents", "line_number": 12, "usage_type": "name" }, { "api_name": "importlib.resources.contents", "line_number": 13, "usage_type": "argument" }, { "api_name": "importlib.resources.contents", "line_number": 14, "usage_type": "name" } ...
28899323946
import geopandas as gpd import numpy as np import pandas as pd import pytest from shapely.geometry import LineString, Point, Polygon import momepy as mm from momepy import sw_high from momepy.shape import _make_circle class TestDimensions: def setup_method(self): test_file_path = mm.datasets.get_path("bu...
pysal/momepy
momepy/tests/test_dimension.py
test_dimension.py
py
11,565
python
en
code
412
github-code
18
[ { "api_name": "momepy.datasets.get_path", "line_number": 14, "usage_type": "call" }, { "api_name": "momepy.datasets", "line_number": 14, "usage_type": "attribute" }, { "api_name": "geopandas.read_file", "line_number": 15, "usage_type": "call" }, { "api_name": "geo...
74735231398
import requests import psycopg2 from lxml.html import fromstring import sys # have to copy nba_abbr to br_abbr # update teams set br_abbr = nba_abbr # phx = pho # bkn = brk #cha = cho url ="https://www.basketball-reference.com/coaches/NBA_stats.html" resp = requests.get(url, headers = {'User-Agent' : 'Mozilla/5.0 (...
njndtu/FantasyBasketball
DataCollection/BasketballReference/BrCoaches.py
BrCoaches.py
py
3,302
python
en
code
0
github-code
18
[ { "api_name": "requests.get", "line_number": 14, "usage_type": "call" }, { "api_name": "lxml.html.fromstring", "line_number": 15, "usage_type": "call" }, { "api_name": "psycopg2.connect", "line_number": 19, "usage_type": "call" }, { "api_name": "sys.argv", "li...
6217451147
from collections import defaultdict from contextlib import contextmanager from datetime import datetime from common.local import get_request_username from django.core import serializers from django.core.exceptions import ObjectDoesNotExist from django.db import models, router, transaction from django.db.models.query i...
Tencent/bk-base
src/api/dataflow/flow/handlers/signals.py
signals.py
py
25,304
python
en
code
85
github-code
18
[ { "api_name": "dataflow.shared.log.flow_logger.info", "line_number": 54, "usage_type": "call" }, { "api_name": "dataflow.shared.log.flow_logger", "line_number": 54, "usage_type": "name" }, { "api_name": "django.utils.functional.wraps", "line_number": 48, "usage_type": "ca...
34722009168
import os from argparse import ArgumentParser import pandas as pd from tqdm import tqdm import numpy as np from medcat.cat import CAT from medcat.utils.vocab import Vocab from medcat.cdb import CDB vocab = Vocab() vocab.load_dict(os.environ["MEDCAT_VOCAB_FILE"]) print("Loaded Vocab") # Load the cdb model you downl...
elehman16/exposing_patient_data_release
setup_scripts/subject_id_to_medcat_preprocess.py
subject_id_to_medcat_preprocess.py
py
2,689
python
en
code
45
github-code
18
[ { "api_name": "medcat.utils.vocab.Vocab", "line_number": 12, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 13, "usage_type": "attribute" }, { "api_name": "medcat.cdb.CDB", "line_number": 17, "usage_type": "call" }, { "api_name": "os.environ", ...
72111400041
import pytest from django.contrib.auth.models import User from rest_framework.authtoken.models import Token from rest_framework.test import APIClient # @pytest.fixture def create_user_token(): User.objects.create_user('user', 'user@test.com', 'testuser') user = User.objects.get(username='user') token, _ =...
Eltoney/Django-Experimenting-Corner
utils/pytest_gloabl_helpers.py
pytest_gloabl_helpers.py
py
1,018
python
en
code
0
github-code
18
[ { "api_name": "django.contrib.auth.models.User.objects.create_user", "line_number": 9, "usage_type": "call" }, { "api_name": "django.contrib.auth.models.User.objects", "line_number": 9, "usage_type": "attribute" }, { "api_name": "django.contrib.auth.models.User", "line_number...
4819172932
""" 103. Binary Tree Zigzag Level Order Traversal Given the root of a binary tree, return the zigzag level order traversal of its nodes' values. (i.e. from left to right, then right to left for the next level and alternate between). Example1: Input: root = [3, 9, 20, null, null, 15, 7] 3 / \ ...
tkwang0530/LeetCode
0103.py
0103.py
py
2,443
python
en
code
4
github-code
18
[ { "api_name": "typing.Optional", "line_number": 41, "usage_type": "name" }, { "api_name": "collections.deque", "line_number": 44, "usage_type": "call" }, { "api_name": "typing.List", "line_number": 41, "usage_type": "name" }, { "api_name": "unittest.TestCase", ...
37190482288
# =========================================================== # Module: vector # File: axis.py # Package: PyRIS # Author: Federico Monegaglia # Date: April 2016 # Description: skeleton centerline extractor and vectorizator # =========================================================== from __future__ import division im...
riccardobonanomi/pyris3
pyris/raster/bars.py
bars.py
py
40,836
python
en
code
1
github-code
18
[ { "api_name": "numpy.where", "line_number": 57, "usage_type": "call" }, { "api_name": "numpy.unique", "line_number": 58, "usage_type": "call" }, { "api_name": "numpy.linspace", "line_number": 75, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_numbe...
6974578644
import pandas as pd import matplotlib.pyplot as plt import numpy as np from collections import defaultdict from aif360.datasets import StandardDataset from aif360.metrics import BinaryLabelDatasetMetric from aif360.metrics import ClassificationMetric from aif360.explainers import MetricTextExplainer from sklearn.lin...
datacraft-paris/ethical-ai-toolkit
ethicalai/study.py
study.py
py
10,636
python
en
code
6
github-code
18
[ { "api_name": "aif360.datasets.StandardDataset", "line_number": 29, "usage_type": "call" }, { "api_name": "utils.get_categorical_cols", "line_number": 35, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 48, "usage_type": "call" }, { "api_n...
3496489168
import gzip import json from time import time import requests start = time() i = 0 PAUSE_ITER = 10_000 FILE_PATH = "data/sample.gz" with gzip.open(FILE_PATH, "r") as events_file: time_ = time() for event in events_file: i += 1 body = json.loads(event) response = requests.post( ...
Kyziridis/collab_filtering
main.py
main.py
py
695
python
en
code
0
github-code
18
[ { "api_name": "time.time", "line_number": 7, "usage_type": "call" }, { "api_name": "gzip.open", "line_number": 11, "usage_type": "call" }, { "api_name": "time.time", "line_number": 12, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 15, ...
72875212200
#!/usr/bin/env python3 #shebang line to inform the OS that the content is in python # -------------------------------------------------- # A simple python script to print hello world! # Miguel Riem Oliveira. # PSR, September 2023. # -------------------------------------------------- import argparse import readchar ...
miguelriemoliveira/psr_23-24
Parte02/Ex4/ex4c.py
ex4c.py
py
924
python
en
code
2
github-code
18
[ { "api_name": "readchar.readkey", "line_number": 27, "usage_type": "call" } ]
33655631299
""" [STEPIK] Python: основы и применение https://stepik.org/512 03_04_02 Распространённые форматы текстовых файлов: CSV, JSON """ """ Вам дано описание наследования классов в формате JSON. Описание представляет из себя массив JSON-объектов, которые соответствуют классам. У каждого JSON-объекта есть поле name, которое ...
ornichola/learning-new
stepik/python512/03_04_02.py
03_04_02.py
py
2,482
python
ru
code
3
github-code
18
[ { "api_name": "json.loads", "line_number": 46, "usage_type": "call" } ]
30245464505
""" This code is supported by the website: https://www.guanjihuan.com The newest version of this code is on the web page: https://www.guanjihuan.com/archives/6896 """ import numpy as np from math import * import matplotlib.pyplot as plt import time import cmath def hamiltonian(kx,ky,kz): # Weyl semimetal A = 1 ...
guanjihuan/guanjihuan.com
academic_codes/topological_invariant/2020.11.04_Chern_number_of_the_cross_section_plane_in_Weyl_semimetals/Chern_number_of_the_cross_section_plane_in_Weyl_semimetals.py
Chern_number_of_the_cross_section_plane_in_Weyl_semimetals.py
py
3,027
python
en
code
24
github-code
18
[ { "api_name": "numpy.array", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 26, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 30, "usage_type": "call" }, { "api_name": "time.time", "line_number": 34...
38406257383
#! /usr/bin/env python3 """Collect the corresponding information of nic""" import os import shutil import argparse from subprocess import Popen, PIPE DEV_LIST = ["0x4000", "0x6000", "0x3800"] VENDOR_LIST = ["0x19ee", "0x1da8"] CONFIG_DEBUG_SCMD = False SCRIPT_LOG = "" BSP_PATHS = ["/opt/corigine/bin", "/opt/netronom...
Netronome/nfp-drv-kmods
tools/nfp_troubleshoot_gather.py
nfp_troubleshoot_gather.py
py
44,496
python
en
code
29
github-code
18
[ { "api_name": "argparse.ArgumentParser", "line_number": 338, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 361, "usage_type": "call" }, { "api_name": "os.walk", "line_number": 380, "usage_type": "call" }, { "api_name": "shutil.which", "lin...
21737632030
# chat/urls.py # root: /recipes/ from django.urls import path from . import views urlpatterns = [ path('', views.recipe_small_start, name="recipe_small_start"), path('small/', views.recipe_small, name='recipe_small'), path('large/', views.recipe_large, name='recipe_large'), path('<str:room_name>/', vi...
cs160-summer-2021/p4-starter-code-evelynluw
draw/urls.py
urls.py
py
347
python
en
code
1
github-code
18
[ { "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", "line_number": 10, "usage_type": "call" }, { "api_name": "django.urls.path", ...
24687233174
import argparse import asyncio from sys import exit from .proto import Client def do_stats(caller, options): res = yield from caller.send_command('stats') if isinstance(res, Exception): print(res) exit(1) print(res.data.decode('ascii')) def do_stats_tube(caller, options): for tube i...
tailhook/aio-beanstalk
aiobeanstalk/stats.py
stats.py
py
1,718
python
en
code
5
github-code
18
[ { "api_name": "sys.exit", "line_number": 12, "usage_type": "call" }, { "api_name": "sys.exit", "line_number": 21, "usage_type": "call" }, { "api_name": "proto.Client.connect", "line_number": 33, "usage_type": "call" }, { "api_name": "proto.Client", "line_numbe...
14951405021
# A part of NonVisual Desktop Access (NVDA) # Copyright (C) 2006-2019 NV Access Limited # This file is covered by the GNU General Public License. # See the file COPYING for more details. """ When working on this file, consider moving to winAPI. """ import threading from ctypes import * from ctypes.wintypes...
nvaccess/nvda
source/winInputHook.py
winInputHook.py
py
3,414
python
en
code
1,802
github-code
18
[ { "api_name": "watchdog.isAttemptingRecovery", "line_number": 62, "usage_type": "attribute" }, { "api_name": "threading.Thread", "line_number": 92, "usage_type": "call" }, { "api_name": "winUser.WM_QUIT", "line_number": 113, "usage_type": "attribute" } ]
38440334376
import RPi.GPIO as GPIO import time from readchar import readchar from gpiozero import Robot #GPIO.cleanup() GPIO.setmode(GPIO.BCM) #Set GPIO pin numbering bit_a = 22 bit_b = 27 bit_c = 17 rf_pin = 15 GPIO.setup(bit_a, GPIO.OUT) GPIO.setup(bit_b, GPIO.OUT) GPIO.setup(bit_c, GPIO.OUT) GPIO.setup...
ata213/Omnidirectional_robot2
ultra_rf_multi_follow.py
ultra_rf_multi_follow.py
py
5,043
python
en
code
0
github-code
18
[ { "api_name": "RPi.GPIO.setmode", "line_number": 8, "usage_type": "call" }, { "api_name": "RPi.GPIO", "line_number": 8, "usage_type": "name" }, { "api_name": "RPi.GPIO.BCM", "line_number": 8, "usage_type": "attribute" }, { "api_name": "RPi.GPIO.setup", "line_n...
42239475103
from initialize_phi import phi as ph from schemes import chanvesse_functional, yezzi_functional, bhattacharya_functional,seg_w_control,optimal_segmentation import scipy.ndimage class segmentation: def __init__(self, imname, algo,dt): self.imname = imname self.img = self.get_image() self.im...
ibipul/segmentation-2Dsnakes-wt-interactive-control
seg_fwk.py
seg_fwk.py
py
1,634
python
en
code
2
github-code
18
[ { "api_name": "initialize_phi.phi", "line_number": 11, "usage_type": "call" }, { "api_name": "scipy.ndimage.ndimage.imread", "line_number": 17, "usage_type": "call" }, { "api_name": "scipy.ndimage.ndimage", "line_number": 17, "usage_type": "attribute" }, { "api_na...
6055827801
""" Main handler for plugin.video.edx """ import json import urllib import xbmc # pylint: disable=import-error import xbmcgui # pylint: disable=import-error import xbmcplugin # pylint: disable=import-error from resources.course import Course def build_url(plugin_url, query): """ Utility function for callb...
efischer19/plugin.video.edx
resources/handler.py
handler.py
py
5,045
python
en
code
0
github-code
18
[ { "api_name": "urllib.urlencode", "line_number": 17, "usage_type": "call" }, { "api_name": "xbmcgui.Dialog", "line_number": 24, "usage_type": "call" }, { "api_name": "xbmc.translatePath", "line_number": 35, "usage_type": "call" }, { "api_name": "json.dumps", "...
42129647954
import unittest import dbus from unittest import mock from rhsmlib.dbus import service_wrapper, constants class ServiceWrapperTest(unittest.TestCase): def test_parse_argv(self): opts, args = service_wrapper.parse_argv( ["cmd_name", "--verbose", "--bus-name", "Hello", "Foo"], "Default" ...
candlepin/subscription-manager
test/rhsmlib/dbus/test_service_wrapper.py
test_service_wrapper.py
py
1,670
python
en
code
61
github-code
18
[ { "api_name": "unittest.TestCase", "line_number": 9, "usage_type": "attribute" }, { "api_name": "rhsmlib.dbus.service_wrapper.parse_argv", "line_number": 11, "usage_type": "call" }, { "api_name": "rhsmlib.dbus.service_wrapper", "line_number": 11, "usage_type": "name" },...
38377105929
#!/usr/bin/env python import socket,os,sys,re,threading,inotify,time,ind class wpaclass: def __init__(self): self.bssid = "" self.ssid = "" self.keymgmt = "" self.state = "" self.ip = "" self.qual = "" self.sock = None self.fnmap={'bssid':self.setbssid, 'ssid':self.setssid, 'key_mgmt':...
eggled/wifiindicator
wpasock.py
wpasock.py
py
2,961
python
en
code
1
github-code
18
[ { "api_name": "re.split", "line_number": 41, "usage_type": "call" }, { "api_name": "re.split", "line_number": 44, "usage_type": "call" }, { "api_name": "re.search", "line_number": 46, "usage_type": "call" }, { "api_name": "ind.n.set_from_file", "line_number": ...
23275997299
# -*- coding: utf-8 -*- from django import template from django.utils.translation import ugettext_lazy as _ register = template.Library() @register.filter def arraylookup(a, idx): """ Gets a value from an iterable. :param a: array / list / other monad. :param idx: aray index (zero based). :retur...
dwebdevcore/BoardDirector_dashboard
apps/billing/templatetags/billing_tags.py
billing_tags.py
py
902
python
en
code
8
github-code
18
[ { "api_name": "django.template.Library", "line_number": 6, "usage_type": "call" }, { "api_name": "django.template", "line_number": 6, "usage_type": "name" }, { "api_name": "django.utils.translation.ugettext_lazy", "line_number": 34, "usage_type": "call" } ]
26772028981
''' This program estimates pi by considering a unit circle enclosed a square. In order to estimate pi, the hit and miss method was employed, we consider a 2 x 2 square piece of paper with an inscribed circle of radius 1, we then simulate throwing darts at the sqaure and we have the following relations: (number...
brucecarlon/Numerical-Computing
Monte_Carlo_Pi_Estimate/pi_estimate.py
pi_estimate.py
py
1,704
python
en
code
0
github-code
18
[ { "api_name": "numpy.random.uniform", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 24, "usage_type": "name" }, { "api_name": "numpy.random.uniform", "line_number": 25, "usage_type": "call" }, { "api_name": "numpy.random",...
10926328349
import pyopencl as cl import numpy as np import cv2 import os import sys import time import pickle import numpy as np from math import atan2, floor, pi from skimage.metrics import peak_signal_noise_ratio def get_elapsed_ms(ev_list): elapsed = [] for e in ev_list: elapsed.append((e.profile.end - e.profi...
saturdaycoder/oclComputerVision
super_resolution/raisr.py
raisr.py
py
7,142
python
en
code
0
github-code
18
[ { "api_name": "numpy.array", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.float32", "line_number": 25, "usage_type": "attribute" }, { "api_name": "numpy.array", "line_number": 26, "usage_type": "call" }, { "api_name": "numpy.float32", "line_...
24253392734
from __future__ import annotations from typing import Any, Iterable, List, Optional, Type, Union from eth_typing import URI from typing_extensions import Protocol from web3 import HTTPProvider from web3.types import RPCEndpoint, RPCResponse from ankr.exceptions import APIError class MultichainHTTPProvider(HTTPProvi...
Ankr-network/ankr-python-sdk
ankr/providers.py
providers.py
py
4,585
python
en
code
10
github-code
18
[ { "api_name": "web3.HTTPProvider", "line_number": 12, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 16, "usage_type": "name" }, { "api_name": "typing.Union", "line_number": 16, "usage_type": "name" }, { "api_name": "eth_typing.URI", "...
8178991005
import math import random from matplotlib import pyplot as plt import time def f(rjesenje, tezinska_matrica): put = 0 put += tezinska_matrica[rjesenje[0] - 1][rjesenje[1] - 1] for i in range(1, len(rjesenje) - 1): put += tezinska_matrica[rjesenje[i] - 1][rjesenje[i + 1] - 1] put += tezinska_m...
ekovac2/genetic-algorithm-for-tsp
ACO.py
ACO.py
py
12,015
python
sh
code
0
github-code
18
[ { "api_name": "random.choice", "line_number": 73, "usage_type": "call" }, { "api_name": "math.sqrt", "line_number": 103, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 108, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", ...
20735967565
# -*- coding: utf-8 -*- import click import os import signal from gunicorn import util from pyft import __version__, settings @click.group() def cli(): pass @cli.command('run', help='Run worker server.') @click.option('--env', '-e', default='dev', help='Run as a daemon.') def run(env): """ 웹서버를 실행한다. ...
coninggu/pyft
pyft/cli.py
cli.py
py
1,899
python
en
code
0
github-code
18
[ { "api_name": "click.group", "line_number": 10, "usage_type": "call" }, { "api_name": "pyft.settings.SERVER_HOST", "line_number": 28, "usage_type": "attribute" }, { "api_name": "pyft.settings", "line_number": 28, "usage_type": "name" }, { "api_name": "pyft.setting...
27376071258
from sklearn.svm import LinearSVC from sklearn.feature_selection import SelectFromModel from sklearn.model_selection import train_test_split from sklearn.metrics import accuracy_score from sklearn import svm from sklearn.feature_selection import VarianceThreshold from sklearn.neighbors import KNeighborsClassifier from ...
Julietvill/DataMiningProject
DataMining.py
DataMining.py
py
3,687
python
en
code
0
github-code
18
[ { "api_name": "numpy.zeros", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 28, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 40, "usage_type": "call" }, { "api_name": "numpy.genfromtxt", "line_numb...
8485659148
import json from default import with_context from test_api import TestAPI from factories import ProjectFactory, TaskFactory, TaskRunFactory from pybossa.repositories import ProjectStatsRepository import pybossa.cache.project_stats as stats class TestProjectStatsAPI(TestAPI): @with_context def test_query_proje...
Scifabric/pybossa
test/test_api/test_api_project_stats.py
test_api_project_stats.py
py
3,544
python
en
code
730
github-code
18
[ { "api_name": "test_api.TestAPI", "line_number": 8, "usage_type": "name" }, { "api_name": "factories.ProjectFactory.create_batch", "line_number": 14, "usage_type": "call" }, { "api_name": "factories.ProjectFactory", "line_number": 14, "usage_type": "name" }, { "ap...
7315269835
import matplotlib.pyplot as plt import numpy as np snr_per_bit_dB = np.linspace(-20, 40, 10000) # dB c = np.log2(1 + 10 ** (snr_per_bit_dB / 10)) # remember to do the foruma in linear ''' # Work backwards c = np.linspace(0.1, 10, 1000) snr_per_bit = (2**c - 1) snr_per_bit_dB = 10.0*np.log10(snr_per_bit) ''' fig, ax ...
777arc/textbook
figure-generating-scripts/shannon_limit.py
shannon_limit.py
py
1,021
python
en
code
205
github-code
18
[ { "api_name": "numpy.linspace", "line_number": 4, "usage_type": "call" }, { "api_name": "numpy.log2", "line_number": 5, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.subplots", "line_number": 12, "usage_type": "call" }, { "api_name": "matplotlib.pyplot"...
35827698869
#!/usr/bin/env python # -*- coding: utf-8 -*- """ calisphere extent stats """ import sys import argparse import re from datetime import date import itertools import json import xlsxwriter import requests from pprint import pprint as pp import ConfigParser import time FACETS = [ 'title_ss', 'alternative_title...
ucldc/extent_stats
calisphere/facets.py
facets.py
py
3,940
python
en
code
0
github-code
18
[ { "api_name": "argparse.ArgumentParser", "line_number": 42, "usage_type": "call" }, { "api_name": "ConfigParser.SafeConfigParser", "line_number": 55, "usage_type": "call" }, { "api_name": "time.ctime", "line_number": 67, "usage_type": "call" }, { "api_name": "xlsx...
12950023418
import os, commands, gzip, re, shutil, stat, hashlib, ssl from Workdir import * from subprocess import * from stat import * from tarfile import * from M2Crypto import m2, BIO, SMIME, X509 from kctllib.kkeys import * # kpython from kfile import * class KARException(Exception): pass class KARData: def __init__...
tmbx/teambox-acttools
adminacttools/acttools/KAR.py
KAR.py
py
7,597
python
en
code
1
github-code
18
[ { "api_name": "M2Crypto.SMIME.SMIME", "line_number": 38, "usage_type": "call" }, { "api_name": "M2Crypto.SMIME", "line_number": 38, "usage_type": "name" }, { "api_name": "M2Crypto.SMIME.Cipher", "line_number": 39, "usage_type": "call" }, { "api_name": "M2Crypto.SM...
31638631720
from lib.helpers import * from lib.models import Category, Page def write_category_to_mongo(category, parent_pageid): category['title'] = category['title'].replace('Category:','') if Category.objects(pageid=category['pageid']).count() == 0: this_category = Category(pageid=category['pagei...
joshuacook/latent_semantic_analysis
src/lib/controllers/category_controller.py
category_controller.py
py
768
python
en
code
3
github-code
18
[ { "api_name": "lib.models.Category.objects", "line_number": 6, "usage_type": "call" }, { "api_name": "lib.models.Category", "line_number": 6, "usage_type": "name" }, { "api_name": "lib.models.Category", "line_number": 7, "usage_type": "call" }, { "api_name": "lib....
75101788200
import torch from nuscenes.nuscenes import NuScenes from NuScenes_utils.map import Map from NuScenes_utils.visualization import Visualizer from preprocessing_utils.functions import * from NuScenes_utils.train_data import DatasetCreator # load_datasetloader, load_solvers import os from utils import GetArgs from train...
skepsl/NuScenesV2
visualization.py
visualization.py
py
6,992
python
en
code
0
github-code
18
[ { "api_name": "utils.GetArgs", "line_number": 18, "usage_type": "call" }, { "api_name": "NuScenes_utils.train_data.DatasetSaver", "line_number": 22, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 25, "usage_type": "call" }, { "api_name": "o...
448036083
from datetime import datetime import json import re def date_format(date): d = date.split('/') year = f'20{d[2]}' month = d[0] if len(d[0]) == 2 else f'0{d[0]}' day = d[1] return f'{year}-{month}-{day}' def remove_countries(countries): del_idx = [] for idx, country in enumerate(countri...
bradj/covid-19
covid_19/scrape.py
scrape.py
py
5,234
python
en
code
1
github-code
18
[ { "api_name": "json.loads", "line_number": 74, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 77, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 135, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 146, ...
10537747262
import base64 base64_csp_prefixes = [ 'play.filters.headers.contentSecurityPolicy.base64', ] csp_prefixes = [ 'play.filters.headers.contentSecurityPolicy.base64', 'play.filters.headers.contentSecurityPolicy', 'play.filters.headers.contentSecurity', 'filters.headers.security.contentSecurityPolicy',...
hmrc/csp-tool
csp_tool/csp_extractor.py
csp_extractor.py
py
3,018
python
en
code
0
github-code
18
[ { "api_name": "base64.b64decode", "line_number": 67, "usage_type": "call" } ]
75124177641
# coding: utf-8 import time import socket import struct from bencode import bencode, bdecode from random import randint from threading import Thread, Timer, Lock BOOTSTRAP_ADDR = ("router.bittorrent.com", 6881) # BOOTSTRAP_ADDR = ("dht.transmissionbt.com", 6881) def btih2info_hash(btih): info_hash = '' for ...
cuijinyu/m2t
m2t.py
m2t.py
py
9,350
python
en
code
1
github-code
18
[ { "api_name": "random.randint", "line_number": 22, "usage_type": "call" }, { "api_name": "socket.socket", "line_number": 42, "usage_type": "call" }, { "api_name": "socket.AF_INET", "line_number": 42, "usage_type": "attribute" }, { "api_name": "socket.SOCK_DGRAM", ...
15691954041
import pygame import sys import lcm import lasvegas # #################### # # Parámetros del juego # # #################### # SCREEN_W = 20 SCREEN_H = 20 # Tamaño del pixel SIZE = 40 # Tamaño max del túnel MAX_T_SIZE = 8 # Tamaño número de túneles MAX_T_NUM = 72 # Densidad de enemigos D = 0.02 # Densidad...
SrEstroncio38/EjerciciosAJ
Practicas/practica2.py
practica2.py
py
7,220
python
en
code
0
github-code
18
[ { "api_name": "pygame.init", "line_number": 43, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 44, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 44, "usage_type": "attribute" }, { "api_name": "pygame.displa...
11474832879
# 1. **Anagram Check**: Write a Python function that checks whether two given words are anagrams. # - *Input*: "cinema", "iceman" # - *Output*: "True" def anagramfun(str1, str2): dict1 = {} dict2 = {} for char in str1: dict1[char] = dict1.get(char, 0) + 1 for char in str2: dict...
Adesh856/GA101_Masai
Sprint1/day3/pythonday2/set4.py
set4.py
py
5,096
python
en
code
0
github-code
18
[ { "api_name": "itertools.permutations", "line_number": 78, "usage_type": "call" } ]
4431283007
import urllib.request, urllib.parse, urllib.error import xml.etree.ElementTree as ET #serviceurl = 'http://maps.googleapis.com/maps/api/geocode/xml?' while True: address = input('Enter location: ') if len(address) < 1: break sum=0 print('Retrieving', address) uh = urllib.request.urlope...
rohanmarwah/hello-world
Using Python to extract webdata(course3)/xmlparsing.py
xmlparsing.py
py
681
python
en
code
0
github-code
18
[ { "api_name": "urllib.request.request.urlopen", "line_number": 12, "usage_type": "call" }, { "api_name": "urllib.request.request", "line_number": 12, "usage_type": "attribute" }, { "api_name": "urllib.request", "line_number": 12, "usage_type": "name" }, { "api_nam...
26310465419
#Specia Thanks To @spechide sar # #(c) Shrimadhav U K # # This file is part of UniBorg # # UniBorg is free software; you cannot redistribute it and/or modify # it under the terms of the GNU General Public License as published # by the Free Software Foundation, either version 3 of the License, or # (at your option) any ...
Chinu79/PaperplaneExtended
userbot/modules/remove_bg.py
remove_bg.py
py
4,027
python
en
code
null
github-code
18
[ { "api_name": "userbot.REM_BG_API_KEY", "line_number": 34, "usage_type": "name" }, { "api_name": "datetime.datetime.now", "line_number": 38, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 38, "usage_type": "name" }, { "api_name": "userbo...
27479724864
import os import subprocess import sys try: import PySimpleGUI as SG except ModuleNotFoundError: os.system("pip3 install PySimpleGUI") import PySimpleGUI as SG print("hello") # Part 1 - The import popup_to_show = open(os.path.join(sys.path[0], "error_massege.txt"), 'r') massege = popup_to_show.read() popu...
KanadSamanta/Manavmitra_linux
popup.py
popup.py
py
1,503
python
en
code
0
github-code
18
[ { "api_name": "os.system", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path", "line_number": 13, "usage_type": "attribute" }, { "api_name": "sys.path", "line_number": 13, ...
20030703372
import numpy as np from PIL import Image, ImageOps import glob from sklearn.model_selection import train_test_split import pickle from sklearn.decomposition import PCA from sklearn.neighbors import KNeighborsClassifier #顔画像の枚数 num_of_hukushi= int(len(glob.glob('福士蒼汰顔/福士蒼汰顔*.jpg'))) #顔ない画像の枚数 num_of_nakagawa = int(le...
sotanchan/HukuNaka
learning.py
learning.py
py
2,293
python
en
code
0
github-code
18
[ { "api_name": "glob.glob", "line_number": 12, "usage_type": "call" }, { "api_name": "glob.glob", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 20, ...
30668927161
import os import discord import topgg from discord.ext import commands class TopGG(commands.Cog): def __init__(self, bot): self.topggtoken = os.environ["topggtoken"] if self.topggtoken == "insert topgg webhook token here""insert topgg webhook token here": raise ValueError sel...
Code-Cecilia/BotMan.py-legacy
Cogs/topgg_commands.py
topgg_commands.py
py
2,386
python
en
code
3
github-code
18
[ { "api_name": "discord.ext.commands.Cog", "line_number": 8, "usage_type": "attribute" }, { "api_name": "discord.ext.commands", "line_number": 8, "usage_type": "name" }, { "api_name": "os.environ", "line_number": 11, "usage_type": "attribute" }, { "api_name": "topg...
32048816368
import json import os import io import time import shutil DEF_FONT_SIZE = 12 SWITCH_LANG_WITH_BOTH_SHIFT = 0 SWITCH_LANG_WITH_LEFT_SHIFT = 1 SWITCH_LANG_WITH_RIGHT_SHIFT = 2 selKeys=( "1234567890" ) class CinBaseConfig: def __init__(self): self.candPerRow = 3 self.defaultEnglish = False ...
EasyIME/PIME
python/cinbase/config.py
config.py
py
8,187
python
en
code
1,275
github-code
18
[ { "api_name": "os.path.abspath", "line_number": 65, "usage_type": "call" }, { "api_name": "os.path", "line_number": 65, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 65, "usage_type": "call" }, { "api_name": "os.path.join", "line...
72853225641
from config import Config def get_logging_dict(config: Config) -> dict: return { 'version': 1, 'disable_existing_loggers': False, 'formatters': { 'main': { 'format': '{asctime} - {levelname} - {module} - ' '{message} - {user_id} - {message_id}', ...
MercyClassic/crocus_rnd
backend/tg_bot/src/config/logging.py
logging.py
py
903
python
ar
code
0
github-code
18
[ { "api_name": "config.Config", "line_number": 4, "usage_type": "name" }, { "api_name": "config.ROOT_DIR", "line_number": 22, "usage_type": "attribute" } ]
31644178595
import json from pathlib import Path import torch from transformers import AutoConfig, AutoModel from luke.model import LukeConfig, LukeModel def load_model_from_config(serialization_directory: str, weight_file: str = None): serialization_directory = Path(serialization_directory) metadata_path = serializati...
studio-ousia/luke
luke/utils/util.py
util.py
py
1,145
python
en
code
666
github-code
18
[ { "api_name": "pathlib.Path", "line_number": 11, "usage_type": "call" }, { "api_name": "json.load", "line_number": 13, "usage_type": "call" }, { "api_name": "transformers.AutoConfig.from_pretrained", "line_number": 15, "usage_type": "call" }, { "api_name": "transf...
11889415674
import sys import numpy import cv2 numpy.set_printoptions(threshold=sys.maxsize) frame = cv2.imread("/Users/cwlroda/Desktop/I100.png", 1) # frame = cv2.cvtColor(frame, cv2.COLOR_RGB2BGR) print(frame) numpy.save("I100", frame) img = numpy.load("/Users/cwlroda/Desktop/Python/DDC/I100.npy") cv2.imshow("DDC", img) cv2...
cwlroda/Dance-Dance-Convolution
src/imgmat.py
imgmat.py
py
356
python
en
code
0
github-code
18
[ { "api_name": "numpy.set_printoptions", "line_number": 5, "usage_type": "call" }, { "api_name": "sys.maxsize", "line_number": 5, "usage_type": "attribute" }, { "api_name": "cv2.imread", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.save", "lin...
31162724990
import psycopg2 from datetime import datetime def connect_postgres(): conn = psycopg2.connect(host='localhost', port=5434, user='postgres', password='postgres', database='test_db', ) return conn def save_search_data(author_id, query_keyword, links): connection = connect_postgres() cu...
niharika385/chatbot_discord
bot_db_utils.py
bot_db_utils.py
py
846
python
en
code
1
github-code
18
[ { "api_name": "psycopg2.connect", "line_number": 5, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 17, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 17, "usage_type": "name" } ]
42217944338
import cv2 import numpy as np def resize_img(img_path): pic=cv2.imread(img_path) print(pic.shape) # canvas_size=(333,500) if 333/500 < pic.shape[0]/pic.shape[1]: x=333 temp=(333-pic.shape[0])/pic.shape[0] y=pic.shape[1]+(temp*pic.shape[1]) else: y=500 temp=(...
DeepakLakhotia/carsify
CarsifyApp/image_processing.py
image_processing.py
py
1,074
python
en
code
0
github-code
18
[ { "api_name": "cv2.imread", "line_number": 5, "usage_type": "call" }, { "api_name": "cv2.resize", "line_number": 21, "usage_type": "call" }, { "api_name": "cv2.INTER_AREA", "line_number": 21, "usage_type": "attribute" }, { "api_name": "cv2.imshow", "line_numbe...
34469595880
# Cylinder Gadget (based on Amazon example code & Scott's original cylinder light) import logging import sys import time import board import neopixel import random import threading import dateutil.parser import traceback import json import color_constants from agt import AlexaGadget logging.basicConfig(stream=sys.st...
swb1701/RaspberryPi
cylinder-gadget/cylinder_gadget.py
cylinder_gadget.py
py
17,698
python
en
code
5
github-code
18
[ { "api_name": "logging.basicConfig", "line_number": 17, "usage_type": "call" }, { "api_name": "sys.stdout", "line_number": 17, "usage_type": "attribute" }, { "api_name": "logging.INFO", "line_number": 17, "usage_type": "attribute" }, { "api_name": "logging.getLogg...
73039775081
import torch import numpy as np import pandas as pd import face_alignment from argparse import ArgumentParser import os import cv2 from matplotlib import pyplot as plt #from tqdm.notebook import tqdm from tqdm import tqdm from moviepy.editor import AudioFileClip import librosa import librosa.display import pickle def...
davidelobba/FER_SPRING
affwild_preprocess.py
affwild_preprocess.py
py
9,830
python
en
code
0
github-code
18
[ { "api_name": "numpy.array", "line_number": 23, "usage_type": "call" }, { "api_name": "numpy.linalg.norm", "line_number": 25, "usage_type": "call" }, { "api_name": "numpy.linalg", "line_number": 25, "usage_type": "attribute" }, { "api_name": "numpy.array", "li...
14961358111
from sendgrid import SendGridAPIClient from sendgrid.helpers.mail import DynamicTemplateData, Mail from ..config.settings import settings from ..schemas.userSchema import User sg = SendGridAPIClient(settings.sendgrid_key) SENDER_EMAIL = "emekaallison4@gmail.com" async def send_email( recipient: User, message: s...
Aliemeka/bizzbuzz-fastapi
core/utils/mailservice.py
mailservice.py
py
926
python
en
code
0
github-code
18
[ { "api_name": "sendgrid.SendGridAPIClient", "line_number": 7, "usage_type": "call" }, { "api_name": "config.settings.settings.sendgrid_key", "line_number": 7, "usage_type": "attribute" }, { "api_name": "config.settings.settings", "line_number": 7, "usage_type": "name" }...
2483421798
from pymongo import MongoClient import pandas as pd from sklearn.feature_extraction.text import CountVectorizer from operator import itemgetter import tabulate import sys def connect_db(): try: client = MongoClient( 'mongodb+srv://admin:admin@cluster0.ekv0t.mongodb.net/myFirstDatabase?retryWri...
Code-with-ease/Smart-Talent-Resume-Ranker
Resume_matcher.py
Resume_matcher.py
py
6,147
python
en
code
3
github-code
18
[ { "api_name": "pymongo.MongoClient", "line_number": 11, "usage_type": "call" }, { "api_name": "sys.exc_info", "line_number": 15, "usage_type": "call" }, { "api_name": "sys.exc_info", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.zeros", "line...
39422848905
# -*- coding: utf-8 -*- # @TIME : 2020/11/09 12:06 # @Author : Chen Shan # @Email : jacobon@foxmail.com # @File : siftfeature.py # @Software : PyCharm import cv2 #opencv 读取进来为BGR格式 import matplotlib.pyplot as plt import numpy as np # print(cv2.__version__) # 4.4.0 def cv_show(name,img): cv2.imshow(...
ZUFEcsc/comVisionPro
comproject/siftfeature.py
siftfeature.py
py
751
python
en
code
0
github-code
18
[ { "api_name": "cv2.imshow", "line_number": 16, "usage_type": "call" }, { "api_name": "cv2.waitKey", "line_number": 17, "usage_type": "call" }, { "api_name": "cv2.destroyAllWindows", "line_number": 18, "usage_type": "call" }, { "api_name": "cv2.imread", "line_n...
25584372549
from nes_py.wrappers import JoypadSpace import gym_super_mario_bros from gym_super_mario_bros.actions import SIMPLE_MOVEMENT from gym.wrappers import FrameStack, GrayScaleObservation from stable_baselines3.common.vec_env import VecFrameStack, DummyVecEnv from make_env import make_env from matplotlib import pyplot as pl...
henryelliottli/RL-Beating-OpenGym
test.py
test.py
py
2,502
python
en
code
0
github-code
18
[ { "api_name": "sys.argv", "line_number": 19, "usage_type": "attribute" }, { "api_name": "gym_super_mario_bros.make", "line_number": 21, "usage_type": "call" }, { "api_name": "nes_py.wrappers.JoypadSpace", "line_number": 22, "usage_type": "call" }, { "api_name": "g...
25824282726
# -*- coding: utf-8 """ Steps for behavioral style tests are defined in this module. Each step is defined by the string decorating it. This string is used to call the step in "*.feature" file. """ from __future__ import unicode_literals, print_function import pexpect import subprocess import tempfile from behave impo...
kamurani/pgcli
tests/features/steps/basic_commands.py
basic_commands.py
py
2,721
python
en
code
null
github-code
18
[ { "api_name": "subprocess.check_output", "line_number": 21, "usage_type": "call" }, { "api_name": "behave.when", "line_number": 18, "usage_type": "call" }, { "api_name": "behave.then", "line_number": 24, "usage_type": "call" }, { "api_name": "wrappers.run_cli", ...
38682913196
from rest_framework import serializers from django.contrib.auth.models import User from api.models import Category, Subcategory, Product, Company, Contact, ProductImg, Order, Language, CategoryTranslation """ Serializers define the API representation.""" # the language model serializer class LanguageSerializer(seria...
spotlightgroup/hadaf-api
api/serializers.py
serializers.py
py
2,556
python
en
code
0
github-code
18
[ { "api_name": "rest_framework.serializers.ModelSerializer", "line_number": 9, "usage_type": "attribute" }, { "api_name": "rest_framework.serializers", "line_number": 9, "usage_type": "name" }, { "api_name": "api.models.Language", "line_number": 12, "usage_type": "name" ...
31999775068
import detl from detl.processor import load_and_save, identity_wrapper, Processor, change_state from detl.mydb import MyDb import shutil import os from test_util import save_int, load_int import unittest import pytest from detl.wrapper import wrap_obj, wrap_results class DecoratorTest(unittest.TestCase): @pytest....
Spotchi/dETL
tests/test_processors.py
test_processors.py
py
2,953
python
en
code
3
github-code
18
[ { "api_name": "unittest.TestCase", "line_number": 11, "usage_type": "attribute" }, { "api_name": "os.path.exists", "line_number": 22, "usage_type": "call" }, { "api_name": "os.path", "line_number": 22, "usage_type": "attribute" }, { "api_name": "shutil.rmtree", ...
24785646897
import pandas as pd import streamlit as st import joblib x_numerics = {'latitude': 0, 'longitude': 0, 'accommodates': 0, 'bathrooms': 0, 'bedrooms': 0, 'beds': 0, 'extra_people': 0, 'minimum_nights': 0, 'year': 0, 'month': 0, 'n_amenities': 0, 'host_listings_count': 0} x_tru...
franciscocezar/airbnb_project
airbnb_datascience_project/streamlit_deploy.py
streamlit_deploy.py
py
1,990
python
en
code
0
github-code
18
[ { "api_name": "streamlit.number_input", "line_number": 31, "usage_type": "call" }, { "api_name": "streamlit.number_input", "line_number": 33, "usage_type": "call" }, { "api_name": "streamlit.number_input", "line_number": 35, "usage_type": "call" }, { "api_name": "...
9667276711
__author__ = 'Sergio' import pandas as pd from flask import Flask from flask import render_template from flask import request from flask_bootstrap import Bootstrap from recommender import Recommender data = pd.read_csv('web/static/data/cars_information.csv', sep=',', encoding='utf-8') brands = sorted(data['Brand'].u...
seugarte/TFM-MasterDS
web/init.py
init.py
py
1,586
python
en
code
0
github-code
18
[ { "api_name": "pandas.read_csv", "line_number": 10, "usage_type": "call" }, { "api_name": "flask.Flask", "line_number": 17, "usage_type": "call" }, { "api_name": "flask_bootstrap.Bootstrap", "line_number": 18, "usage_type": "call" }, { "api_name": "flask.request.f...
8358282188
import pandas as pd # 用于读取excel文件 from pyecharts import options as opts # 可视化选项 from pyecharts.charts import Timeline, Map # 时间线、地图 from pyecharts.globals import ThemeType # 图表主题 src_file = "Epidemic data.xls" # 疫情地图所用颜色 list_color = ['#F4AD8B', '#EF826F', '#EE806E', '#BD3932 ', '#801D17'] # 读取数据 df = pd.read_ex...
stillwho/epidemic_map
Epidemic_map.py
Epidemic_map.py
py
5,084
python
en
code
0
github-code
18
[ { "api_name": "pandas.read_excel", "line_number": 12, "usage_type": "call" }, { "api_name": "pyecharts.charts.Timeline", "line_number": 58, "usage_type": "call" }, { "api_name": "pyecharts.options.InitOpts", "line_number": 58, "usage_type": "call" }, { "api_name":...
35874354133
#!/usr/bin/env python3 import sys sys.path.append('..') sys.path.append('/home/pi/python/mitemp') import logging import threading import time import atorlib import ble_temperature_sensor # bluetooth from mitemp_bt.mitemp_bt_poller import MiTempBtPoller, MI_TEMPERATURE, MI_HUMIDITY, MI_BATTERY # GUI import tkinter as...
BikeAtor/WoMoAtor
src/main/python/ble_temperature_sensor/misensorbluepy.py
misensorbluepy.py
py
5,286
python
en
code
1
github-code
18
[ { "api_name": "sys.path.append", "line_number": 4, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 4, "usage_type": "attribute" }, { "api_name": "sys.path.append", "line_number": 5, "usage_type": "call" }, { "api_name": "sys.path", "line_numbe...
43342558190
import logging import sys def configure_logger(path: str, file: str): log_formatter = logging.Formatter('\r%(asctime)s: %(levelname)s %(message)s') root_logger = logging.getLogger() root_logger.setLevel(logging.DEBUG) file_handler = logging.FileHandler("{0}/{1}.log".format(path, file), mode='w', enco...
dgefremov/PyGetTools
tools/utils/log_utils.py
log_utils.py
py
569
python
en
code
0
github-code
18
[ { "api_name": "logging.Formatter", "line_number": 6, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 7, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 8, "usage_type": "attribute" }, { "api_name": "logging.FileHandl...
12487534416
from setuptools import setup, find_packages from typing import List __version__ = '0.0.1' REQUIREMENT_FILE_NAME="requirements.txt" HYPHEN_E_DOT = "-e ." def get_requirements_list() -> List[str]: with open(REQUIREMENT_FILE_NAME) as requirement_file: requirement_list = requirement_file.readlines() ...
JayakeshavB/SENSOR-FAULT-DETECTION
setup.py
setup.py
py
970
python
en
code
0
github-code
18
[ { "api_name": "typing.List", "line_number": 11, "usage_type": "name" }, { "api_name": "setuptools.setup", "line_number": 19, "usage_type": "call" }, { "api_name": "setuptools.find_packages", "line_number": 28, "usage_type": "call" } ]
24914538246
from __future__ import annotations import copy import json import os from enum import Enum from fractions import Fraction from pathlib import Path from typing import Any import torch from lightning.pytorch.utilities import rank_zero_info, rank_zero_warn from torch.utils.data import Dataset ACTION_SPOTTING_LABELS_FIL...
juliendenize/eztorch
eztorch/datasets/soccernet_utils/parse_utils.py
parse_utils.py
py
15,909
python
en
code
25
github-code
18
[ { "api_name": "enum.Enum", "line_number": 120, "usage_type": "name" }, { "api_name": "torch.utils.data.Dataset", "line_number": 127, "usage_type": "name" }, { "api_name": "typing.Any", "line_number": 129, "usage_type": "name" }, { "api_name": "torch.ones_like", ...
6209485981
# This Message Will Self-Destruct in 5s # https://atcoder.jp/contests/abc166/tasks/abc166_e from collections import defaultdict N = int(input()) A = list(map(int, input().split())) d = defaultdict(int) for i in range(N): d[i + A[i]] += 1 ans = 0 for i in range(N): ans += d[i - A[i]] print(ans)
kotadd/competitive_programming
zentansaku/abc166_e.py
abc166_e.py
py
309
python
en
code
1
github-code
18
[ { "api_name": "collections.defaultdict", "line_number": 9, "usage_type": "call" } ]
9061749546
# Example of chaining operators together import rx from rx import operators as op # Set up a source with a filter and a map source = rx.from_list([2, 3, 5, 7, 4, 9, 8]) pipe = source.pipe( op.filter(lambda value: value % 2 == 0), op.map(lambda value: "'" + str(value) + "'") ) # Subscribe a lambda function pip...
johnehunt/advancedpython3
chapter35/reactive_ops5.py
reactive_ops5.py
py
372
python
en
code
47
github-code
18
[ { "api_name": "rx.from_list", "line_number": 6, "usage_type": "call" }, { "api_name": "rx.operators.filter", "line_number": 8, "usage_type": "call" }, { "api_name": "rx.operators", "line_number": 8, "usage_type": "name" }, { "api_name": "rx.operators.map", "li...
21124887688
from typing import List from neo4j import GraphDatabase from app.models.user import User, UserInput class UserRepository: def __init__(self, uri: str = "bolt://localhost:7687", user: str = "neo4j", password: str = "password"): self.driver = GraphDatabase.driver(uri, auth=(user, password)) def close...
pygabo/legogabo
app/repositories/user_repository.py
user_repository.py
py
2,672
python
en
code
0
github-code
18
[ { "api_name": "neo4j.GraphDatabase.driver", "line_number": 10, "usage_type": "call" }, { "api_name": "neo4j.GraphDatabase", "line_number": 10, "usage_type": "name" }, { "api_name": "app.models.user.UserInput", "line_number": 15, "usage_type": "name" }, { "api_name...
4398973409
import os from pathlib import Path from rich import print from joblib import Parallel, delayed import cv2 from tqdm import tqdm from . import utils from . import visualizations as vis from . import metrics as ym import numpy as np data_dir = Path(os.getcwd()).parent / "results" exp_dir = data_d...
rapaja/aiworkbench
src/incisive/scripts/backup/script_niksa_measures.py
script_niksa_measures.py
py
7,143
python
en
code
0
github-code
18
[ { "api_name": "pathlib.Path", "line_number": 17, "usage_type": "call" }, { "api_name": "os.getcwd", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.sum", "line_number": 26, "usage_type": "call" }, { "api_name": "numpy.sum", "line_number": 28, ...
70848639399
import torch import torch.nn as nn import torch.nn.functional as F class GCNLayer(nn.Module): def __init__(self, in_features, out_features): super(GCNLayer, self).__init__() self.linear = nn.Linear(in_features, out_features) def forward(self, x, adj): h = torch.matmul(adj, x) h...
wali39/stormtroppers
DeepLearningModel/GNN_LSTM.py
GNN_LSTM.py
py
1,393
python
en
code
0
github-code
18
[ { "api_name": "torch.nn.Module", "line_number": 5, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 5, "usage_type": "name" }, { "api_name": "torch.nn.Linear", "line_number": 8, "usage_type": "call" }, { "api_name": "torch.nn", "line_numbe...
27404058022
#! /usr/bin/env python # !-*-coding:utf-8 -*- # !@Time : 12:27 # !@Author :smile丶 # !@File :.py # 导入 webdriver from selenium import webdriver options = webdriver.ChromeOptions() options.add_argument('--headless') # 调用环境变量指定的PhantomJS浏览器创建浏览器对象 driver = webdriver.Chrome(chrome_options=options) # 如果没有在环境变量指...
sjsmi1e/python_crawl
爬虫/seleniumtest.py
seleniumtest.py
py
760
python
zh
code
1
github-code
18
[ { "api_name": "selenium.webdriver.ChromeOptions", "line_number": 11, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 11, "usage_type": "name" }, { "api_name": "selenium.webdriver.Chrome", "line_number": 14, "usage_type": "call" }, { "api...
23140539733
import threading import time from PyQt5.QtWidgets import * from src.visualisation_tool.Graph2D import Graph2D from PyQt5.QtCore import QThread, pyqtSlot, Qt, pyqtSignal from pyqtgraph import PlotWidget, plot import pyqtgraph as pg import numpy as np from src.visualisation_tool.NeighborCoordinateTable import NeighborCo...
SwarmUS/TestBench-Python
src/visualisation_tool/MainWindow.py
MainWindow.py
py
3,840
python
en
code
0
github-code
18
[ { "api_name": "PyQt5.QtCore.pyqtSignal", "line_number": 16, "usage_type": "call" }, { "api_name": "PyQt5.QtCore.Qt.Vertical", "line_number": 24, "usage_type": "attribute" }, { "api_name": "PyQt5.QtCore.Qt", "line_number": 24, "usage_type": "name" }, { "api_name": ...
71595627559
import sqlite3 import os from flask import jsonify class MyDBManager: base_dir = os.getcwd() db_path = os.path.join(base_dir, "9lessondb.db") def __init__(self, db): self._db = db def __enter__(self): self.conn = sqlite3.connect(self._db) return self.conn def __exit__(se...
C0nstanta/one
9Lesson(1assignment)/dbmanager.py
dbmanager.py
py
15,374
python
en
code
0
github-code
18
[ { "api_name": "os.getcwd", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "sqlite3.connect", "line_number":...
72972128999
"""This module provides functions for plotting and analysing historical water level data for monitoring stations""" import matplotlib.pyplot as plt import numpy as np from datetime import datetime, timedelta from floodsystem.analysis import polyfit from matplotlib.dates import date2num def plot_water_levels(station,...
fpervaiz/cam-ia-flood-warning-system
floodsystem/plot.py
plot.py
py
1,366
python
en
code
0
github-code
18
[ { "api_name": "matplotlib.pyplot.plot", "line_number": 14, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 14, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.axhline", "line_number": 17, "usage_type": "call" }, { "api_name": "ma...
23493960004
import time import cv2 import numpy as np import pyautogui from PIL import ImageGrab #from directkeys import A, D, PressKey, S, W def process_img(image): original_image=image processed_image= cv2.cvtColor(image, cv2.COLOR_BGR2GRAY) processed_image=cv2.Canny(processed_image,threshold1=200,th...
HaniaGhouse0407/Lane-detection-
2.edge_detection.py
2.edge_detection.py
py
674
python
en
code
0
github-code
18
[ { "api_name": "cv2.cvtColor", "line_number": 13, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2GRAY", "line_number": 13, "usage_type": "attribute" }, { "api_name": "cv2.Canny", "line_number": 14, "usage_type": "call" }, { "api_name": "time.time", "line_...
34342751526
import matplotlib.pyplot as plt import numpy as np N = 7 noUsed = (41, 72, 167, 1039, 562, 693, 1518) Used = (3, 109, 580, 411, 526, 237, 282) xticklabels=('辽源','雄安', '仙桃', '松原' , '四平', '白山', '吉林') ind1 = np.arange(N) # the x locations for the groups width = 0.35 ...
chizengkun/pytest
pd/tphs.py
tphs.py
py
733
python
en
code
0
github-code
18
[ { "api_name": "numpy.arange", "line_number": 9, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.bar", "line_number": 12, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 12, "usage_type": "name" }, { "api_name": "matplotlib.pyplot...
13622937678
import requests from bs4 import BeautifulSoup endPage = 50 def scrapper(endPage): count = 1 page = 1 while (count <= endPage): print("Started new page: "+str(count)) print("- - - - - - - - - - - - - - - - - - - - -") URL = "https://www.eba...
EdwardOmondi/simple-web-scrapper
jijiScrapper.py
jijiScrapper.py
py
1,295
python
en
code
0
github-code
18
[ { "api_name": "requests.get", "line_number": 16, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 17, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 28, "usage_type": "call" } ]
34583557639
from sqlalchemy import Column, Integer, String, DateTime, func from sqlalchemy.ext.declarative import declarative_base, declared_attr from example.db import utils from example import log class BaseModel(object): @declared_attr def __tablename__(cls): return cls.__name__.lower() created_at = Colum...
dimoynwa/falcon-example
example/db/models.py
models.py
py
2,987
python
en
code
0
github-code
18
[ { "api_name": "sqlalchemy.ext.declarative.declared_attr", "line_number": 8, "usage_type": "name" }, { "api_name": "sqlalchemy.Column", "line_number": 12, "usage_type": "call" }, { "api_name": "sqlalchemy.DateTime", "line_number": 12, "usage_type": "argument" }, { ...
75457330599
from app import app from models import db from flask import render_template ''' GESTOR DE ERRORES, CON ESTO EN CASO DE QUE ALGUNA PAGINA NOS DEVUELVA ALGUNOS DE LOS SIGUIENTES ERRORES EN VEZ DE SALIR UNA PESTAÑA POR DEFECTO HACEMOS QUE SALGA UNA DE NUESTRAS PAGINAS ''' @app.errorhandler(500) def internal_server_error(e...
Danekar/Proyectos-Unversitarios
Programación Web II Servidor/ProyectoWebServidorDanielKhomyakov/errors.py
errors.py
py
628
python
es
code
0
github-code
18
[ { "api_name": "models.db.session.rollback", "line_number": 10, "usage_type": "call" }, { "api_name": "models.db.session", "line_number": 10, "usage_type": "attribute" }, { "api_name": "models.db", "line_number": 10, "usage_type": "name" }, { "api_name": "flask.ren...
13003234312
from selenium import webdriver import smtplib import time class Coronavirus(): def __init__(self): while(1): self.driver = webdriver.Firefox() self.driver.get('https://www.worldometers.info/coronavirus/') table = self.driver.find_element_by_xpath('//*[@id="main_table_countries"]/tbody[1]')...
willi79/coronaVirus
scrap.py
scrap.py
py
1,966
python
en
code
0
github-code
18
[ { "api_name": "selenium.webdriver.Firefox", "line_number": 7, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 7, "usage_type": "name" }, { "api_name": "time.sleep", "line_number": 34, "usage_type": "call" }, { "api_name": "smtplib.SMTP",...
7554254642
import cv2 as cv import timeit import numpy as np def read_objnames(objname_file): coconames = [] with open(objname_file) as file: for line in file: coconames.append(line.rstrip()) return coconames class run_yolo: def __init__(self, cfg_file, weight_file, objname_file, confidence_t...
pattylo/mypython_playground
yolo/yolo.py
yolo.py
py
2,900
python
en
code
0
github-code
18
[ { "api_name": "cv2.dnn.readNetFromDarknet", "line_number": 21, "usage_type": "call" }, { "api_name": "cv2.dnn", "line_number": 21, "usage_type": "attribute" }, { "api_name": "cv2.dnn", "line_number": 22, "usage_type": "attribute" }, { "api_name": "cv2.dnn", "l...
17072090732
""" Flask app configuration settings. """ from datetime import timedelta from labonneboite.conf import settings class Config(object): DEBUG = settings.DEBUG ASSETS_DEBUG = settings.DEBUG TESTING = settings.TESTING SERVER_NAME = settings.SERVER_NAME PREFERRED_URL_SCHEME = settings.PREFERRED_URL_S...
StartupsPoleEmploi/labonneboite
labonneboite/web/config.py
config.py
py
3,342
python
en
code
42
github-code
18
[ { "api_name": "labonneboite.conf.settings.DEBUG", "line_number": 10, "usage_type": "attribute" }, { "api_name": "labonneboite.conf.settings", "line_number": 10, "usage_type": "name" }, { "api_name": "labonneboite.conf.settings.DEBUG", "line_number": 11, "usage_type": "att...
26526310925
from absl.testing import absltest import chex import jax import jax.numpy as jnp from jax_privacy.src.training import metrics class AccuracyTest(absltest.TestCase): def test_distinct(self): logits = jnp.array([ [0.1, 0.5, 0.2], [-0.3, -0.2, 0.0], ]) labels = jnp.array([1, 2]) labe...
deepmind/jax_privacy
jax_privacy/src/training/metrics_test.py
metrics_test.py
py
1,608
python
en
code
72
github-code
18
[ { "api_name": "absl.testing.absltest.TestCase", "line_number": 9, "usage_type": "attribute" }, { "api_name": "absl.testing.absltest", "line_number": 9, "usage_type": "name" }, { "api_name": "jax.numpy.array", "line_number": 13, "usage_type": "call" }, { "api_name"...
39545518281
from flask import Blueprint, jsonify, request from flask_expects_json import expects_json from flask_jwt_extended import (create_access_token, current_user, get_jwt, get_jwt_identity, jwt_required, set_access_cookies, unset_jwt_cookies) from ..models impor...
wlmchen/mindful
backend/routes/journal.py
journal.py
py
2,441
python
en
code
0
github-code
18
[ { "api_name": "flask.Blueprint", "line_number": 12, "usage_type": "call" }, { "api_name": "json.load", "line_number": 15, "usage_type": "call" }, { "api_name": "flask.request.json", "line_number": 37, "usage_type": "attribute" }, { "api_name": "flask.request", ...
29424202196
# from Sarsa import Sarsa from QL import q_learning from Sarsa_new import Sarsa from DrawPath import drawpath import matplotlib.pyplot as plt if __name__ == '__main__': a = [0, 1, 2, 3] Cliff2 = q_learning(a, x_len=12, y_len=4, reward=0, gamma=0.99, alpha=0.5, epsilon=0.01) Cliff = Sarsa(a, x_len=12, y_len...
shy829/reinforcement-learning
A3/main.py
main.py
py
720
python
en
code
0
github-code
18
[ { "api_name": "QL.q_learning", "line_number": 9, "usage_type": "call" }, { "api_name": "Sarsa_new.Sarsa", "line_number": 10, "usage_type": "call" }, { "api_name": "DrawPath.drawpath", "line_number": 13, "usage_type": "call" }, { "api_name": "DrawPath.drawpath", ...
42036694907
#!/usr/bin/env python # coding=utf8 import logging, traceback, json, uuid, collections, urllib, urllib2, datetime, os from emsgadmin import fileserver_client from django.http import HttpResponse from django.template import Context, Template from django.views.decorators.csrf import csrf_exempt logger = logging.getLogg...
cc14514/emsgadmin
emsgadmin/views.py
views.py
py
1,107
python
en
code
0
github-code
18
[ { "api_name": "logging.getLogger", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 20, "usage_type": "call" }, { "api_name": "os.path", "line_number": 20, "usage_type": "attribute" }, { "api_name": "uuid.uuid4", "line_nu...
73015536999
from tech_news.database import search_news from datetime import datetime # Requisito 7 def search_by_title(title): """Seu código deve vir aqui""" retorno = search_news({"title": {"$regex": title, "$options": "i"}}) return [ (news["title"], news["url"]) for news in retorno ] # Requisito 8 def...
RenanAizawa/projeto-curso-trybe-tech-news
tech_news/analyzer/search_engine.py
search_engine.py
py
1,031
python
en
code
0
github-code
18
[ { "api_name": "tech_news.database.search_news", "line_number": 8, "usage_type": "call" }, { "api_name": "datetime.datetime.fromisoformat", "line_number": 20, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 20, "usage_type": "name" }, { "a...