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
32847920764
import numpy as np import cv2 from hog_fitures import HOG_fitures from utils import * fhog = HOG_fitures() class KCFTracker: def __init__(self, hog=False, fixed_window=True, multiscale=False): self.lambda_reg = 0.0001 # регуляризация self.padding = 2.5 # дополнительная об...
ra1nyy/TrackerForNir
tracker.py
tracker.py
py
10,534
python
en
code
0
github-code
97
[ { "api_name": "hog_fitures.HOG_fitures", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.ogrid", "line_number": 51, "usage_type": "attribute" }, { "api_name": "numpy.cos", "line_number": 53, "usage_type": "call" }, { "api_name": "numpy.pi", "lin...
1758781075
#! /usr/bin/env python """ Module with fake companion injection functions. """ __author__ = 'Carlos Alberto Gomez Gonzalez, Valentin Christiaens' __all__ = ['collapse_psf_cube', 'normalize_psf', 'cube_inject_companions', 'generate_cube_copies_with_injections', 'frame_inject...
vortex-exoplanet/VIP
vip_hci/fm/fakecomp.py
fakecomp.py
py
34,145
python
en
code
67
github-code
97
[ { "api_name": "packaging.version.parse", "line_number": 24, "usage_type": "call" }, { "api_name": "packaging.version", "line_number": 24, "usage_type": "name" }, { "api_name": "photutils.__version__", "line_number": 24, "usage_type": "attribute" }, { "api_name": "...
42849798110
"""Estimation of number of seats in CZ parliament based on pollsters' potentials.""" # !!! NOTE: HTML in /home/michal/dev/dark_corners/flow/test4/ import copy import csv import datetime import json import numpy import operator path = "/home/michal/project/mandaty.cz/seats/" # date = "2019-10-01" datestring = datetim...
michalskop/mandaty.cz
seats/calc2.py
calc2.py
py
7,612
python
en
code
13
github-code
97
[ { "api_name": "datetime.datetime.today", "line_number": 14, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 14, "usage_type": "attribute" }, { "api_name": "csv.DictReader", "line_number": 50, "usage_type": "call" }, { "api_name": "csv.Dic...
30288555281
from netaddr import IPAddress __all__ = [ 'to_server_dict', 'to_dns_zone_dict', 'to_dns_record_dict' ] def to_server_dict(server): public_ips = [ip['addr'] for ip in server.addresses['public']] private_ips = [ip['addr'] for ip in server.addresses['private']] # Pick out first public IPv4 and ...
StackStorm/st2contrib
packs/rackspace/actions/lib/formatters.py
formatters.py
py
1,500
python
en
code
154
github-code
97
[ { "api_name": "netaddr.IPAddress", "line_number": 20, "usage_type": "call" } ]
10842862706
import os import base64 from datetime import datetime from flask import Blueprint, render_template, request, flash, redirect, url_for, current_app from flask_login import current_user, login_user, logout_user, login_required from microblog.models import db, User from microblog.forms import LoginForm, RegistrationForm...
mustafa-baser/flask-ders
microblog/views/auth.py
auth.py
py
3,140
python
en
code
0
github-code
97
[ { "api_name": "flask.Blueprint", "line_number": 12, "usage_type": "call" }, { "api_name": "microblog.forms.LoginForm", "line_number": 17, "usage_type": "call" }, { "api_name": "flask.request.method", "line_number": 19, "usage_type": "attribute" }, { "api_name": "f...
34719848725
from django.contrib import admin from django.contrib.admin import ModelAdmin from backend.hume.models import Hume, ValidHume class ValidHumeAdmin(ModelAdmin): model = ValidHume list_display = ('uuid', ) class HumeAdmin(ModelAdmin): model = Hume list_display = ('uuid', ) admin.site.register(Valid...
open-home-iot/hint
backend/hume/admin.py
admin.py
py
379
python
en
code
1
github-code
97
[ { "api_name": "django.contrib.admin.ModelAdmin", "line_number": 8, "usage_type": "name" }, { "api_name": "backend.hume.models.ValidHume", "line_number": 9, "usage_type": "name" }, { "api_name": "django.contrib.admin.ModelAdmin", "line_number": 13, "usage_type": "name" }...
9513922036
import sqlite3 con = sqlite3.connect("sample.db") cursor = con.cursor() create_history_table_query = """ CREATE TABLE IF NOT EXISTS History( Name TXET, Age INTEGER ) """ cursor.execute(create_history_table_query) target_name = input("whose 'age' do you want to update?") new_age = input("Tell me new age:") upd...
MoTo-LaBo/Python-Guideline
database/rollback.py
rollback.py
py
1,080
python
ja
code
0
github-code
97
[ { "api_name": "sqlite3.connect", "line_number": 3, "usage_type": "call" }, { "api_name": "sqlite3.Error", "line_number": 20, "usage_type": "attribute" } ]
167638007
import json with open('misleading.json','r') as f: results = json.load(f) """ res = { 'margins':list(margins), 'min_round_sizes':list(round_sizes), 'prov_sprobs':list(prov_sprobs), 'so_sprobs':list(so_sprobs), 'eor_sprobs':list(eor_sprobs) } """ s = "\\begin{tabular}{ |c|c|c|c|c| } \n\\hline \n...
obroadrick/providence
old/latex_misleading.py
latex_misleading.py
py
1,353
python
en
code
0
github-code
97
[ { "api_name": "json.load", "line_number": 4, "usage_type": "call" } ]
12553802266
from django.shortcuts import render, redirect,get_object_or_404, HttpResponseRedirect from .models import Category, Photo from django.contrib import messages # Create your views here. def welcome(request): return render(request, 'photos/base.html') def gallery(request): category = request.GET.get('category'...
Brian569/personal-gallery
photos/views.py
views.py
py
2,162
python
en
code
0
github-code
97
[ { "api_name": "django.shortcuts.render", "line_number": 9, "usage_type": "call" }, { "api_name": "models.Photo.objects.all", "line_number": 14, "usage_type": "call" }, { "api_name": "models.Photo.objects", "line_number": 14, "usage_type": "attribute" }, { "api_nam...
25759746636
import numpy as np import torch # # # refere to the pseudocode available at https://arxiv.org/src/1911.08265v2/anc/pseudocode.py class Node(object): def __init__(self, prior: float): self.visit_count = 0 self.prior = prior self.value_sum = 0 self.children = {} se...
DHDev0/Muzero
monte_carlo_tree_search.py
monte_carlo_tree_search.py
py
10,701
python
en
code
13
github-code
97
[ { "api_name": "torch.equal", "line_number": 128, "usage_type": "call" }, { "api_name": "numpy.random.dirichlet", "line_number": 140, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 140, "usage_type": "attribute" }, { "api_name": "numpy.log", ...
44824500218
from functools import reduce def read_input(): with open('input') as f: lines = f.read().splitlines() return lines def main1(right=3, down=1): lines = read_input() tree = '#' pos = right found = 0 for line in lines[down::down]: if line[pos] == tree: found += 1...
valerii-vorobiov/adventofcode2020
day3/solution.py
solution.py
py
636
python
en
code
0
github-code
97
[ { "api_name": "functools.reduce", "line_number": 25, "usage_type": "call" } ]
19088780585
from selenium import webdriver from bs4 import BeautifulSoup import time base_url ="https://search.naver.com/search.naver?where=view&sm=tab_jum&query=" keyword=input("검색어 입력하세요 : ") url =base_url + keyword driver = webdriver.Chrome() driver.get(url) time.sleep(3) #page불러오는데 시간이 걸리므로 time을 자주 사용하게 된다 ''' 자바스크립트 기능...
Polar-jaesung/crawling_python
09_2_selenium_naver.py
09_2_selenium_naver.py
py
1,376
python
ko
code
0
github-code
97
[ { "api_name": "selenium.webdriver.Chrome", "line_number": 10, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 10, "usage_type": "name" }, { "api_name": "time.sleep", "line_number": 13, "usage_type": "call" }, { "api_name": "time.sleep", ...
74748505919
# SPDX-License-Identifier: MIT from __future__ import annotations from sqlalchemy.types import ( INT, TypeDecorator, UserDefinedType, ) from ..data.cvss import CvssSeverity class CvssSeverityType(TypeDecorator): cache_ok = True impl = INT def process_bind_param(self, value: CvssSeverity | ...
gardenlinux/glvd
src/glvd/database/types.py
types.py
py
735
python
en
code
1
github-code
97
[ { "api_name": "sqlalchemy.types.TypeDecorator", "line_number": 14, "usage_type": "name" }, { "api_name": "sqlalchemy.types.INT", "line_number": 16, "usage_type": "name" }, { "api_name": "data.cvss.CvssSeverity", "line_number": 18, "usage_type": "name" }, { "api_na...
17003479136
import os import json import shutil import argparse import datetime from dataclasses import dataclass, asdict from dacite import from_dict @dataclass class Asset: m_FileID: int m_PathID: int @dataclass class OneLiner: characterProgressTokens: list[Asset] worldProgressTokens: list[Asset] priority: i...
YufeiG/extra-dialogue-mod
scripts/format.py
format.py
py
5,270
python
en
code
0
github-code
97
[ { "api_name": "dataclasses.dataclass", "line_number": 8, "usage_type": "name" }, { "api_name": "dataclasses.dataclass", "line_number": 13, "usage_type": "name" }, { "api_name": "dataclasses.dataclass", "line_number": 20, "usage_type": "name" }, { "api_name": "data...
17357762941
#coding=utf-8 from selenium import webdriver import time import random from PIL import Image from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.support.wait import WebDriverWait from selenium.webdriver.common.by import By ''' for i in range(5): user_email = ''.join(random.sam...
eason-chen705/SeleniumPython
ImoocSelenium/start_browsers.py
start_browsers.py
py
1,926
python
en
code
0
github-code
97
[ { "api_name": "selenium.webdriver.Chrome", "line_number": 16, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 16, "usage_type": "name" }, { "api_name": "time.sleep", "line_number": 20, "usage_type": "call" }, { "api_name": "selenium.webd...
8778723434
import requests from bs4 import BeautifulSoup from pylibz import log, deepcopy from pylibz.func import base64_encode from .config import get_javdb_host, get_local from .func import get_cache, write_cache def get_values(item): values = [] contents = item.select("a") for i in range(len(contents)): v...
nanjozy/javcapture_dsm
javapi/javdb.py
javdb.py
py
4,331
python
en
code
5
github-code
97
[ { "api_name": "requests.Session", "line_number": 17, "usage_type": "attribute" }, { "api_name": "pylibz.deepcopy", "line_number": 18, "usage_type": "call" }, { "api_name": "config.get_javdb_host", "line_number": 19, "usage_type": "call" }, { "api_name": "bs4.Beaut...
20414974880
from prefect import task, Flow from prefect.executors import LocalDaskExecutor from prefect.storage import Docker from prefect.run_configs import DockerRun from research.example_pkg import things @task#(log_stdout=True) def run_thing1(): if things.thing1(): return True @task#(log_stdout=True) def run_thi...
aquanauts/prefect_logger_repro
research/flow.py
flow.py
py
927
python
en
code
0
github-code
97
[ { "api_name": "research.example_pkg.things.thing1", "line_number": 10, "usage_type": "call" }, { "api_name": "research.example_pkg.things", "line_number": 10, "usage_type": "name" }, { "api_name": "prefect.task", "line_number": 8, "usage_type": "name" }, { "api_na...
20352774012
#!/usr/bin/env python3 import sys import argparse import json parser = argparse.ArgumentParser(description="Average piecewise-constant function") parser.add_argument("--N",type=int,default=100,help="Number of points in reconstruction") args = parser.parse_args() N = args.N def get_piecewise_fn_value(intervals,x): ...
bredelings/BAli-Phy
tests/prob_prog/coal_mining/average_time_course.py
average_time_course.py
py
1,298
python
en
code
41
github-code
97
[ { "api_name": "argparse.ArgumentParser", "line_number": 7, "usage_type": "call" }, { "api_name": "sys.stdin", "line_number": 32, "usage_type": "attribute" }, { "api_name": "json.loads", "line_number": 41, "usage_type": "call" } ]
3823388358
import pandas as pd import matplotlib.pyplot as plt from sklearn.model_selection import TimeSeriesSplit from statsmodels.tsa.arima.model import ARIMA import tensorflow as tf from tensorflow.keras.models import Sequential from tensorflow.keras.layers import LSTM, Dense #Using oop class TemperatureData: de...
TexNas1/Redi_Project
temperature_Data.py
temperature_Data.py
py
4,612
python
en
code
0
github-code
97
[ { "api_name": "pandas.read_csv", "line_number": 17, "usage_type": "call" }, { "api_name": "pandas.errors", "line_number": 20, "usage_type": "attribute" }, { "api_name": "pandas.errors", "line_number": 22, "usage_type": "attribute" }, { "api_name": "matplotlib.pypl...
27511447661
# coding: utf-8 from keras.preprocessing.text import Tokenizer samples = ['the cat sat on the mat.', 'the dog ate my homework.'] # 出現頻度がもっとも高い1000個の単語だけを処理するトークナイザー tokenizer = Tokenizer(num_words=1000) # 単語のインデックスを構築 tokenizer.fit_on_texts(samples) # 文字列を整数のインデックスのリストに変換 #sequences = tokenizer.texts_to_sequences(s...
ishigero/nlp
encode_sample/one_hot_word_with_keras.py
one_hot_word_with_keras.py
py
864
python
ja
code
0
github-code
97
[ { "api_name": "keras.preprocessing.text.Tokenizer", "line_number": 7, "usage_type": "call" } ]
887188882
from marshmallow import Schema, fields, EXCLUDE class BookSchema(Schema): title = fields.Str() author = fields.Str() description = fields.Str() class Book: def __init__(self, title, author): self.title = title self.author = author incoming_book_data = { "title": "Clean Code", ...
maxkhrichtchatyi/Practice-Python
Python/general/marshmallow/deserialization.py
deserialization.py
py
462
python
en
code
3
github-code
97
[ { "api_name": "marshmallow.Schema", "line_number": 4, "usage_type": "name" }, { "api_name": "marshmallow.fields.Str", "line_number": 5, "usage_type": "call" }, { "api_name": "marshmallow.fields", "line_number": 5, "usage_type": "name" }, { "api_name": "marshmallow...
29931024728
from flask import Blueprint, render_template, request from app import db from products.models import TV, Fridge products = Blueprint('products', __name__, template_folder='templates', static_folder='static') def sort(data): # Сортируем по параметру выбранном пользователем if request.form["sort"] == "click_a...
IrNV/EVO_web_test
products/blueprint.py
blueprint.py
py
2,181
python
ru
code
0
github-code
97
[ { "api_name": "products.models", "line_number": 6, "usage_type": "name" }, { "api_name": "flask.Blueprint", "line_number": 6, "usage_type": "call" }, { "api_name": "flask.request.form", "line_number": 11, "usage_type": "attribute" }, { "api_name": "flask.request",...
72901555200
import logging import inspect import sys active_breakpoints = [] func_breakpoints = {} def activate_breakpoint(tags): """ Active the breakpoints for a given list of tags Parameters ---------- tags: list List of tag names to activate Returns ------- activate_break_poi...
fred3m/ipydebug
ipydebug/core.py
core.py
py
7,078
python
en
code
4
github-code
97
[ { "api_name": "inspect.stack", "line_number": 154, "usage_type": "call" }, { "api_name": "inspect.isfunction", "line_number": 159, "usage_type": "call" }, { "api_name": "logging.debug", "line_number": 163, "usage_type": "call" }, { "api_name": "logging.warning", ...
6730231998
import logging import re from django.utils.translation import ugettext_lazy as _ from horizon import tables from horizon.templatetags.sizeformat import filesizeformat, float_format LOG = logging.getLogger(__name__) class StringWithPlusOperation(str): """Override "+" operation for string object to make.""" ...
suyan/ceilometer-horizon
ceilometer_horizon/admin/tables.py
tables.py
py
13,348
python
en
code
3
github-code
97
[ { "api_name": "logging.getLogger", "line_number": 11, "usage_type": "call" }, { "api_name": "re.search", "line_number": 25, "usage_type": "call" }, { "api_name": "horizon.templatetags.sizeformat.filesizeformat", "line_number": 77, "usage_type": "call" }, { "api_na...
30910270731
#!/usr/bin/env python3 import queue, datetime, re try: from tkinter import * from tkinter.ttk import * import tkinter.font as tkFont except: from Tkinter import * import Tkinter.font as tkFont from Tkinter.ttk import * def time(s):#this was defined somewhere already if re.search('^\\d\\d:\\d\\d$', s): ...
DHS-Computer-Science/DHS-HSPC-2015-2016
Grading_Program/Gui.py
Gui.py
py
8,887
python
en
code
0
github-code
97
[ { "api_name": "re.search", "line_number": 15, "usage_type": "call" }, { "api_name": "datetime.datetime.strptime", "line_number": 16, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 16, "usage_type": "attribute" }, { "api_name": "datetime....
27853015831
# -*- coding: utf-8 -*- import collections from ZODB.POSException import POSKeyError from zope.component import adapts from zope.interface import implements from bika.lims import api from bika.lims.utils import get_link from bika.coa import is_installed from bika.coa import _ from senaite.app.listing.interfaces impor...
bikalims/bika.coa
src/bika/coa/browser/listingview/report_listing.py
report_listing.py
py
2,729
python
en
code
0
github-code
97
[ { "api_name": "zope.component.adapts", "line_number": 17, "usage_type": "call" }, { "api_name": "senaite.app.listing.interfaces.IListingView", "line_number": 17, "usage_type": "argument" }, { "api_name": "zope.interface.implements", "line_number": 18, "usage_type": "call"...
16761957571
import pandas as pd import numpy as np import tensorflow as tf from sklearn import preprocessing, model_selection def get_data(): bc = pd.read_csv('data/wdbc.data', header=None) print(bc) bc.info() enc = preprocessing.LabelEncoder() y = enc.fit_transform(bc[1]) y = y.resha...
MerryBad/python_learn
Day_25_01_BreastCancer.py
Day_25_01_BreastCancer.py
py
2,029
python
en
code
0
github-code
97
[ { "api_name": "pandas.read_csv", "line_number": 7, "usage_type": "call" }, { "api_name": "sklearn.preprocessing.LabelEncoder", "line_number": 12, "usage_type": "call" }, { "api_name": "sklearn.preprocessing", "line_number": 12, "usage_type": "name" }, { "api_name"...
18187019958
""" A utility for building a QM config file (which is a highly nested Python dict) from the attributes of Quantum Element objects. We use the QM config schema (available at https://qm-docs.s3.amazonaws.com/v0.8/config/index.html) to first create a schema dict from whose structure the config file for the given elements ...
qcrew-lab/qcore
codebase/instruments/quantum_machines/qm_config_builder.py
qm_config_builder.py
py
11,661
python
en
code
0
github-code
97
[ { "api_name": "pathlib.Path", "line_number": 55, "usage_type": "call" }, { "api_name": "yaml.safe_load", "line_number": 57, "usage_type": "call" }, { "api_name": "codebase.instruments.QuantumElement", "line_number": 60, "usage_type": "name" }, { "api_name": "copy....
9248819847
import pymysql from dotenv import load_dotenv import os import app products_sign = """ __ __ ___ _______ ___/ /_ ______/ /____ / _ \/ __/ _ \/ _ / // / __/ __(_-< / .__/_/ \___/\_,_/\_,_/\__/\__/___/ /_/_________________________________/ """ def database_connection(...
rafsimo/generation-mini-project
source/products.py
products.py
py
6,244
python
en
code
0
github-code
97
[ { "api_name": "dotenv.load_dotenv", "line_number": 15, "usage_type": "call" }, { "api_name": "os.environ.get", "line_number": 16, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 16, "usage_type": "attribute" }, { "api_name": "os.environ.get", ...
31510555029
from hamcrest.core import assert_that from nose.plugins.attrib import attr from mdts.lib.binding_manager import BindingManager from mdts.lib.physical_topology_manager import PhysicalTopologyManager from mdts.lib.virtual_topology_manager import VirtualTopologyManager from mdts.tests.utils.asserts import receives from m...
xavileon/mdts
mdts/tests/functional_tests/test_l4state.py
test_l4state.py
py
8,574
python
en
code
0
github-code
97
[ { "api_name": "logging.getLogger", "line_number": 22, "usage_type": "call" }, { "api_name": "mdts.lib.physical_topology_manager.PhysicalTopologyManager", "line_number": 23, "usage_type": "call" }, { "api_name": "mdts.lib.virtual_topology_manager.VirtualTopologyManager", "line...
22608185645
""" Crop image randomly based on original size """ import os import cv2 import numpy as np import random from torchvision import transforms class RandomCropDramaticlly(object): def __init__(self, minimum_percent=0.7, maximum_percent=0.85, p=0.5): """ random crop input image by percent, returned im...
RiDang/JMLN
util/smart_crop_transforms.py
smart_crop_transforms.py
py
5,972
python
en
code
8
github-code
97
[ { "api_name": "random.random", "line_number": 29, "usage_type": "call" }, { "api_name": "numpy.where", "line_number": 69, "usage_type": "call" }, { "api_name": "numpy.where", "line_number": 71, "usage_type": "call" }, { "api_name": "numpy.where", "line_number"...
10241650426
import gi gi.require_version ('Astroid', '0.2') gi.require_version ('Gtk', '3.0') from gi.repository import GObject, Gtk, Astroid import os, os.path import sys import json import colorsys import struct from hashlib import md5 print ("hls-hsv-tag-color: plugin loading..") class HlsHsvTagColorPlugin (GObject.Object): ...
astroidmail/astroid-plugin-hls-hsv-tagcolor
hls-hsv-tag-color.py
hls-hsv-tag-color.py
py
4,574
python
en
code
1
github-code
97
[ { "api_name": "gi.require_version", "line_number": 2, "usage_type": "call" }, { "api_name": "gi.require_version", "line_number": 3, "usage_type": "call" }, { "api_name": "gi.repository.GObject.Object", "line_number": 15, "usage_type": "attribute" }, { "api_name": ...
11523349316
from googleapiclient import errors import os import math from googleapiclient.discovery import build from google_auth_oauthlib.flow import InstalledAppFlow from google.auth.transport.requests import Request from google.oauth2.credentials import Credentials class FileCopyError(Exception): pass class FileAccessErr...
shivamhw/foogle
app/gdrive.py
gdrive.py
py
7,757
python
en
code
5
github-code
97
[ { "api_name": "os.path.exists", "line_number": 33, "usage_type": "call" }, { "api_name": "os.path", "line_number": 33, "usage_type": "attribute" }, { "api_name": "google.oauth2.credentials.Credentials.from_authorized_user_file", "line_number": 34, "usage_type": "call" }...
24045818516
import sys from PySide2.QtCore import Qt from PySide2.QtGui import QBrush, QPainter, QPen, QColor from PySide2.QtWidgets import ( QGraphicsRectItem, QGraphicsScene, QGraphicsView, QHBoxLayout, QWidget, ) from PySide2 import QtWidgets, QtCore, QtGui # It's a subclass of QGraphicsRectItem that emit...
timsmolyanin/work_examples
fug_control_application/qgraphics_widget.py
qgraphics_widget.py
py
4,031
python
en
code
0
github-code
97
[ { "api_name": "PySide2.QtWidgets.QGraphicsRectItem", "line_number": 16, "usage_type": "name" }, { "api_name": "PySide2.QtCore.Signal", "line_number": 17, "usage_type": "call" }, { "api_name": "PySide2.QtCore", "line_number": 17, "usage_type": "name" }, { "api_name...
24122938047
import datetime import logging import os import ashapp.utildatainsertion as udi from ashapp.ashruninterface import ModelCollectionInterface from ashapp.runemittimes import RunEmitTimes from utilhysplit.metfiles import gefs_suffix_list from utilhysplit.runhandler import ProcessList from utilvolc.runhelper import is_inp...
noaa-oar-arl/utilhysplit
ashapp/collectemittimes.py
collectemittimes.py
py
7,370
python
en
code
9
github-code
97
[ { "api_name": "logging.getLogger", "line_number": 12, "usage_type": "call" }, { "api_name": "ashapp.ashruninterface.ModelCollectionInterface", "line_number": 15, "usage_type": "name" }, { "api_name": "ashapp.runemittimes.RunEmitTimes.ilist", "line_number": 32, "usage_type...
22177495161
from fastapi import FastAPI from pydantic import BaseModel from typing import List app = FastAPI() # Datos de prueba users = [] boards = [] cards = [] class User(BaseModel): name: str email: str password: str class Board(BaseModel): name: str class Card(BaseModel): tit...
camilomtt/API
users-pomokan.py
users-pomokan.py
py
1,406
python
en
code
0
github-code
97
[ { "api_name": "fastapi.FastAPI", "line_number": 5, "usage_type": "call" }, { "api_name": "pydantic.BaseModel", "line_number": 13, "usage_type": "name" }, { "api_name": "pydantic.BaseModel", "line_number": 19, "usage_type": "name" }, { "api_name": "pydantic.BaseMod...
35097105091
import unittest try: from unittest.mock import Mock except ImportError: from mock import Mock from cartoframes.viz import helpers, Source class TestColorContinuousLayerHelper(unittest.TestCase): def setUp(self): self.orig_compute_query_bounds = Source._compute_query_bounds Source._compute_...
idriss554/cartoframes
test/viz/helpers/test_color_continuous_layer.py
test_color_continuous_layer.py
py
5,502
python
en
code
null
github-code
97
[ { "api_name": "unittest.TestCase", "line_number": 9, "usage_type": "attribute" }, { "api_name": "cartoframes.viz.Source._compute_query_bounds", "line_number": 11, "usage_type": "attribute" }, { "api_name": "cartoframes.viz.Source", "line_number": 11, "usage_type": "name" ...
21815127869
import copy import os from tqdm import tqdm from yaml import safe_load, YAMLError from game.hex import Hex from game.nim import Nim from rl.anet_agent import ANETAgent from rl.topp import play_game, anet_tournament from rl.uniform_agent import UniformAgent ROOT_DIR = os.path.dirname(os.path.abspath(__file__)) def sa...
P1NHE4D/it3105_hex_ai
main.py
main.py
py
2,337
python
en
code
0
github-code
97
[ { "api_name": "os.path.dirname", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path", "line_number": 11, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 11, "usage_type": "call" }, { "api_name": "tqdm.tqdm", "line_nu...
6843943625
""" This is the home function for the app """ import os from functools import cache from flask import Flask from redis import Redis, RedisError app = Flask(__name__) # redis = Redis() def connect_to_redis(): """ Connects to the Redis server """ return Redis.from_url(os.getenv("REDIS_URL", "redi...
funsojoba/flask_devop
tracker/page_tracker/app.py
app.py
py
862
python
en
code
0
github-code
97
[ { "api_name": "flask.Flask", "line_number": 11, "usage_type": "call" }, { "api_name": "redis.Redis.from_url", "line_number": 19, "usage_type": "call" }, { "api_name": "redis.Redis", "line_number": 19, "usage_type": "name" }, { "api_name": "os.getenv", "line_nu...
8665243145
import cv2 as cv import numpy as np from handDetector import HandDetector def main(): # 保存图片的个数 save_nums = 0 # 打开摄像头,参数为0时表示打开内置摄像头 cap = cv.VideoCapture(0) # 创建手势识别对象 detector = HandDetector() # 手指头列表 tip_idx = [4, 8, 12, 16, 20] # 手势图片路径 fingersImgPath = [f'./data/fingers/{i...
77zzl/noteKnight
code/project/opencv/hand/main.py
main.py
py
3,244
python
zh
code
0
github-code
97
[ { "api_name": "cv2.VideoCapture", "line_number": 10, "usage_type": "call" }, { "api_name": "handDetector.HandDetector", "line_number": 12, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 18, "usage_type": "call" }, { "api_name": "cv2.flip", ...
14129585401
from __future__ import print_function, unicode_literals import urllib import base64 import voodoo.log as log from voodoo.log import logged from flask import request, make_response, redirect from weblab.core.login.web import weblab_api from weblab.core.login.web import ExternalSystemManager import weblab.core.login....
weblabdeusto/weblabdeusto
server/src/weblab/core/login/web/uned_sso.py
uned_sso.py
py
3,784
python
en
code
37
github-code
97
[ { "api_name": "urllib.unquote", "line_number": 29, "usage_type": "call" }, { "api_name": "base64.decodestring", "line_number": 33, "usage_type": "call" }, { "api_name": "M2Crypto.BIO.MemoryBuffer", "line_number": 40, "usage_type": "call" }, { "api_name": "M2Crypto...
1825565759
import argparse from functools import partial, update_wrapper import torch from scipy.stats.distributions import binom, uniform import sys sys.path.append("./DeepOBS/") import deepobs from deepobs import config from deepobs.tuner import RandomSearch from deepobs.tuner.sampler import log_uniform, negative_log_uniform,...
idiap/hypaobp
main_runner.py
main_runner.py
py
6,690
python
en
code
2
github-code
97
[ { "api_name": "sys.path.append", "line_number": 8, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "deepobs.config.set_framework", "line_number": 13, "usage_type": "call" }, { "api_name": "deepobs.conf...
41621390779
import os import platform from distutils.errors import CCompilerError from distutils.errors import DistutilsExecError from distutils.errors import DistutilsPlatformError from setuptools import Extension from setuptools import setup from setuptools.command.build_ext import build_ext class optional_build_ext(build_ext...
zopefoundation/zope.proxy
setup.py
setup.py
py
3,810
python
en
code
5
github-code
97
[ { "api_name": "setuptools.command.build_ext.build_ext", "line_number": 12, "usage_type": "name" }, { "api_name": "setuptools.command.build_ext.build_ext.run", "line_number": 19, "usage_type": "call" }, { "api_name": "setuptools.command.build_ext.build_ext", "line_number": 19,...
43072288047
import inspect import os import re import time from collections import OrderedDict from collections.abc import Generator from typing import Any, Callable, ClassVar, NoReturn, Optional, TypeVar, Union, overload import requests from . import humanity from .ponyfill import bisect_left CallableT = TypeVar("CallableT", b...
satgo1546/pykinezumiko
pykinezumiko/__init__.py
__init__.py
py
22,247
python
zh
code
1
github-code
97
[ { "api_name": "typing.TypeVar", "line_number": 14, "usage_type": "call" }, { "api_name": "typing.Callable", "line_number": 14, "usage_type": "name" }, { "api_name": "typing.ClassVar", "line_number": 36, "usage_type": "name" }, { "api_name": "typing.Union", "li...
9338781484
import cv2 import numpy as np img = cv2.imread("Documents/python/images/lena-1.jpg") lr1 = cv2.pyrDown(img) lr2 = cv2.pyrDown(lr1) hr2 = cv2.pyrUp(lr2) cv2.imshow("original image", img) cv2.imshow("pyrDown1 image", lr1) cv2.imshow("pyrDown2 image", lr2) cv2.imshow("pyrUp 1 image", hr2) #this image has bad qual...
marzitayebi/pyDown-pyUp
pyDown.Pyup.py
pyDown.Pyup.py
py
420
python
en
code
0
github-code
97
[ { "api_name": "cv2.imread", "line_number": 5, "usage_type": "call" }, { "api_name": "cv2.pyrDown", "line_number": 6, "usage_type": "call" }, { "api_name": "cv2.pyrDown", "line_number": 7, "usage_type": "call" }, { "api_name": "cv2.pyrUp", "line_number": 8, ...
73136159680
import sys from awsglue.transforms import * from awsglue.utils import getResolvedOptions from pyspark.context import SparkContext from awsglue.context import GlueContext from awsglue.job import Job from pyspark.sql import functions as f from pyspark.sql.functions import udf from pyspark.sql import types as t from pyspa...
aws-samples/aws-sagemaker-pytorch-shop-by-style
src/etl/gremlin/zappos50k-edges.py
zappos50k-edges.py
py
2,380
python
en
code
23
github-code
97
[ { "api_name": "awsglue.utils.getResolvedOptions", "line_number": 13, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 13, "usage_type": "attribute" }, { "api_name": "pyspark.context.SparkContext", "line_number": 14, "usage_type": "call" }, { "api_n...
31261361504
from django.urls import path from . import views urlpatterns = [ #for the login page path('login/', views.admin_login, name='login'), #for the logout page path('logout/', views.admin_logout, name='logout'), #for the dashboard page path('', views.dash, name='dash'), #for the docume...
uzair02/Employee_Management_System-django
dashboard/urls.py
urls.py
py
408
python
en
code
0
github-code
97
[ { "api_name": "django.urls.path", "line_number": 6, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 8, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 10, "usage_type": "call" }, { "api_name": "django.urls.path", ...
36647661442
import zipfile import os import requests import argparse from tqdm import tqdm parser = argparse.ArgumentParser(description='Download From Google Drive helper') parser.add_argument('--path', type=str, default='./') def download_file_from_google_drive(id, destination): URL = "https://docs.google.com/uc?export=dow...
ruiliu-ai/mytools
download_from_google_drive.py
download_from_google_drive.py
py
1,907
python
en
code
0
github-code
97
[ { "api_name": "argparse.ArgumentParser", "line_number": 8, "usage_type": "call" }, { "api_name": "requests.Session", "line_number": 13, "usage_type": "call" }, { "api_name": "tqdm.tqdm", "line_number": 35, "usage_type": "call" }, { "api_name": "os.makedirs", "...
29904947790
from django.conf.urls import url from . import views urlpatterns = [ url(r'bloglist',views.BlogList,name='list'), url(r'^detail/(?P<slug>[-\w]+)$',views.BlogDetail,name='detail'), url(r'^authorlist/',views.BlogAuthors,name='authorlist'), url(r'^author/(?P<id>\d+)$', views.BlogListByAutho...
SardarDawar/Django-blog
blog/blogs/urls.py
urls.py
py
840
python
en
code
0
github-code
97
[ { "api_name": "django.conf.urls.url", "line_number": 7, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 8, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 9, "usage_type": "call" }, { "api_name": "django.co...
14633212539
"""Line Drawing Algorithms (2D)""" import math from typing import List, Tuple def bresenham(x1: int, y1: int, x2: int, y2: int) -> List[Tuple[int, int]]: """Breshenham's line algorithm - 2D version.""" result = [(x1, y1)] dx, dy = abs(x2 - x1), abs(y2 - y1) x_inc, y_inc = 1, 1 x, y = x1, y1 ...
ArchTangent/fov-visualization
src/lines.py
lines.py
py
6,852
python
en
code
0
github-code
97
[ { "api_name": "typing.List", "line_number": 6, "usage_type": "name" }, { "api_name": "typing.Tuple", "line_number": 6, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 48, "usage_type": "name" }, { "api_name": "typing.Tuple", "line_number": ...
22274873075
from mongo_database.mongo import export_to_mong, mongo_to_sheet from scrapers.scraper import Amazon import asyncio import time if __name__ == '__main__': async def main(): base_url = "https://www.amazon.com/s?k=sexy+dresses&rh=n%3A1045024%2Cn%3A11006703011&dc&ds=v1%3A%2B%2B%2BeqnlN6RopN%2BQAazKtqRPqLIOR...
Dev0109/scraper-aws
main.py
main.py
py
1,285
python
en
code
1
github-code
97
[ { "api_name": "mongo_database.mongo.export_to_mong", "line_number": 14, "usage_type": "call" }, { "api_name": "time.time", "line_number": 22, "usage_type": "call" }, { "api_name": "asyncio.run", "line_number": 25, "usage_type": "call" }, { "api_name": "time.time",...
30152298747
""" Retrieves history data for a given numeric (either int or float) item_id """ from pyzabbix import ZabbixAPI from datetime import datetime import time import my_sort class zabbix_api: def __init__(self, zabbix_server, zabbix_user, zabbix_passwd): # The hostname at which the Zabbix web interface is ava...
alec131/zabbix
tools/zabbix_report/zabbix_report.py
zabbix_report.py
py
11,013
python
en
code
0
github-code
97
[ { "api_name": "pyzabbix.ZabbixAPI", "line_number": 17, "usage_type": "call" }, { "api_name": "my_sort.Stats", "line_number": 52, "usage_type": "call" }, { "api_name": "my_sort.Stats", "line_number": 53, "usage_type": "call" }, { "api_name": "my_sort.Stats", "l...
9247275710
import numpy as np import torch def denormalization(x): mean = np.array([0.5, 0.5, 0.5]) std = np.array([0.5, 0.5, 0.5]) x = (((x.transpose(1, 2, 0) * std) + mean) * 255.).astype(np.uint8) # x = (x.transpose(1, 2, 0) * 255.).astype(np.uint8) return x def denorm(x): """Convert the range from ...
Absolute-Value/Clothes-RIAD-pytorch
modules/funcs.py
funcs.py
py
3,469
python
en
code
0
github-code
97
[ { "api_name": "numpy.array", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.uint8", "line_number": 8, "usage_type": "attribute" }, { "api_name": "numpy.Inf", "line_number": ...
10277244470
import re import collections coord_to_erosion = {} def calc_erosion(x, y): pos = (x,y) if pos in coord_to_erosion: return coord_to_erosion[pos] if x == 0 and y == 0 or x == target_x and y == target_y: geo_id = 0 elif y == 0: geo_id = x * 16807 elif x == 0: geo_id =...
philgeb/AoC2018
task22.py
task22.py
py
2,469
python
en
code
1
github-code
97
[ { "api_name": "re.search", "line_number": 26, "usage_type": "call" }, { "api_name": "re.findall", "line_number": 27, "usage_type": "call" }, { "api_name": "collections.namedtuple", "line_number": 39, "usage_type": "call" } ]
676962611
""" Program: employee.py Author: Rachael Wolf Last date modified: 11/1/2020 This program contains a Class called Employee and some functions relating to it The functions included are: set_last_name(), set_first_name(), display(), str(), and repr() """ import datetime class Employee: """A class representing an em...
raswolf/Python
module10/class_definitions/employee.py
employee.py
py
2,325
python
en
code
0
github-code
97
[ { "api_name": "datetime.date.today", "line_number": 58, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 58, "usage_type": "attribute" } ]
7022037810
import errno import os import random import signal import socket from time import sleep import unittest from unittest import mock try: from time import monotonic as time except ImportError: from time import time as time try: import resource except ImportError: resource = None import zmq from aiozmq.se...
aio-libs/aiozmq
tests/selectors_test.py
selectors_test.py
py
14,434
python
en
code
414
github-code
97
[ { "api_name": "socket.socketpair", "line_number": 25, "usage_type": "attribute" }, { "api_name": "socket.AF_INET", "line_number": 28, "usage_type": "attribute" }, { "api_name": "socket.SOCK_STREAM", "line_number": 28, "usage_type": "attribute" }, { "api_name": "so...
33317592074
import matplotlib.pyplot as plt import numpy as np def part1(x, y, theta): plt.figure() plt.plot(x, y, 'x', color='b') line = np.linspace(-50, 40, 2) plt.plot(line, theta[0] + theta[1] * line) plt.xlim(-50, 40) plt.ylim(-5, 40) plt.show() plt.savefig('data/fig1.png') def parte2(errTr...
jenmiu2/Aprendizaje-Automatico
practica5/models/showData.py
showData.py
py
1,111
python
en
code
0
github-code
97
[ { "api_name": "matplotlib.pyplot.figure", "line_number": 6, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 6, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 7, "usage_type": "call" }, { "api_name": "matplo...
70334936959
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Exports a document. """ import json import sys import shlex import subprocess from collections import namedtuple from util import parse_psql_array def query_psql(sql): """ Sends a query to psql. """ cmd = r"""psql -h localhost -p 4242 kbp kbp -c "COP...
arunchaganty/kbp-online
scripts/export_document.py
export_document.py
py
3,548
python
en
code
4
github-code
97
[ { "api_name": "subprocess.check_output", "line_number": 20, "usage_type": "call" }, { "api_name": "shlex.split", "line_number": 20, "usage_type": "call" }, { "api_name": "util.parse_psql_array", "line_number": 33, "usage_type": "argument" }, { "api_name": "json.du...
41274964512
from bs4 import BeautifulSoup as bs from urllib.request import urlopen as uReq import requests import logging from flask import Flask, render_template, request logging.basicConfig(filename="scrapper.log" , level=logging.INFO) app = Flask(__name__) @app.route("/review" , methods = ['POST' , 'GET']) def index(): if...
dhruvg13/flipkart_reviews_scrapper
app.py
app.py
py
2,946
python
en
code
1
github-code
97
[ { "api_name": "logging.basicConfig", "line_number": 7, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 7, "usage_type": "attribute" }, { "api_name": "flask.Flask", "line_number": 9, "usage_type": "call" }, { "api_name": "flask.request.method",...
74493571197
import sys import json # Magical list of ip addresses and ports which cannot exist in terraform test_var = dict() test_var["dev"] = "10.0.0.1:8081" test_var["qa"] = "10.0.0.2:8082" test_var["uat"] = "10.0.0.3:8083" test_var["stage"] = "10.0.0.4:8084" test_var["prod"] = "10.0.0.5:8085" # Step#1 - Parse the inp...
chavo1/ext-terraform
scripts/get_ip_port.py
get_ip_port.py
py
748
python
en
code
0
github-code
97
[ { "api_name": "sys.stdin.read", "line_number": 13, "usage_type": "call" }, { "api_name": "sys.stdin", "line_number": 13, "usage_type": "attribute" }, { "api_name": "json.loads", "line_number": 14, "usage_type": "call" }, { "api_name": "json.dumps", "line_numbe...
31744566204
from os import remove, path from argparse import ArgumentParser from datetime import datetime, timedelta from json import dumps from flask import Flask, request from dateutil.parser import isoparse from peewee import * from modules import config, model # Set up the reset flag parser = ArgumentParser("An API for ther...
OwenTourlamain/AppointmentAPI
main.py
main.py
py
2,586
python
en
code
0
github-code
97
[ { "api_name": "argparse.ArgumentParser", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path", "line_number": 17, "usage_type": "name" }, { "api_name": "modules.config.DB_PATH...
2896067347
from github import Github, GithubIntegration import os def get_connection(owner, repo_name): app_id=335683 # Read the bot certificate with open( os.path.normpath(os.path.expanduser('./test-pr-labeler.2023-05-18.private-key.pom')), 'r' ) as cert_file: app_key = cert_file...
schneiderl/test-pr-labeler
connection.py
connection.py
py
614
python
en
code
0
github-code
97
[ { "api_name": "os.path.normpath", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "os.path.expanduser", "line_number": 9, "usage_type": "call" }, { "api_name": "github.GithubIntegratio...
74097568320
import requests import json from time import time url = 'https://raw.githubusercontent.com/joemulberry/parallel/main/data/opensea_parallel_dumps.json' resp = requests.get(url) os_data = json.loads(resp.text) url = 'https://raw.githubusercontent.com/joemulberry/w_or_e/main/ask_bids.json' resp = requests.get(url) w_or_...
joemulberry/w_or_e
w_or_e.py
w_or_e.py
py
969
python
en
code
1
github-code
97
[ { "api_name": "requests.get", "line_number": 6, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 7, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 10, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 11...
34477213461
from django.test import TestCase from django.core.management import call_command from django.contrib.sessions.models import Session from django.utils import timezone from datetime import timedelta from myuw.management.commands.clear_expired_sessions import ( get_cut_off_params, run_delete) class TestClearSessions...
uw-it-aca/myuw
myuw/test/management/commands/test_clear_expired_sessions.py
test_clear_expired_sessions.py
py
1,506
python
en
code
13
github-code
97
[ { "api_name": "django.test.TestCase", "line_number": 10, "usage_type": "name" }, { "api_name": "django.contrib.sessions.models.Session.objects.create", "line_number": 13, "usage_type": "call" }, { "api_name": "django.contrib.sessions.models.Session.objects", "line_number": 13...
21139625831
from gi.repository import GLib try: import RPi.GPIO as GPIO except RuntimeError: print("Error importing RPi.GPIO! This is probably because you need superuser privileges. You can achieve this by using 'sudo' to run your script") import picamera import datetime import dailymotion import subprocess camera = pic...
tintou/projet-2A
src/projet.py
projet.py
py
2,013
python
en
code
0
github-code
97
[ { "api_name": "picamera.PiCamera", "line_number": 11, "usage_type": "call" }, { "api_name": "dailymotion.Dailymotion", "line_number": 13, "usage_type": "call" }, { "api_name": "subprocess.call", "line_number": 21, "usage_type": "call" }, { "api_name": "datetime.da...
36922980294
import os import argparse from model import ConvBlock, Wav2Letter import torch import time import numpy as np import torch import torchaudio import torch.nn as nn from torch.nn.utils.rnn import * from torch.utils.data import DataLoader, Dataset from utils.transcript_utils import * import os import sys import numpy as...
ukenia/quantization-cnn
evaluate.py
evaluate.py
py
5,856
python
en
code
0
github-code
97
[ { "api_name": "argparse.ArgumentParser", "line_number": 34, "usage_type": "call" }, { "api_name": "model.eval", "line_number": 58, "usage_type": "call" }, { "api_name": "model.get_inputs", "line_number": 60, "usage_type": "call" }, { "api_name": "time.time", "...
42431392776
from PIL import Image, ImageFont, ImageDraw import requests from io import BytesIO def currentHeight(text, font): return font.getsize(text)[1] def currentWidth(text, font): return font.getsize(text)[0] fontFamily = "impact.ttf" class Meme: def __init__(self): self.requestFileName() self.r...
skyrockprojects/draft-python-course
Project-meme-generator/meme.py
meme.py
py
2,577
python
en
code
1
github-code
97
[ { "api_name": "requests.get", "line_number": 27, "usage_type": "call" }, { "api_name": "PIL.Image.open", "line_number": 28, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 28, "usage_type": "name" }, { "api_name": "io.BytesIO", "line_number":...
21109589290
#!/usr/bin/env python import sys import click import numpy as np import pandas as pd import tifffile as tiff from rich import print, traceback @click.command() @click.option("-m", "--meta", required=True, type=str, help="Path to metadata file") @click.option("-r", "--ratios", required=True, type=str, help="Path to...
qbic-pipelines/root-tissue-analysis
bin/rtastat.py
rtastat.py
py
1,912
python
en
code
1
github-code
97
[ { "api_name": "rich.print", "line_number": 21, "usage_type": "call" }, { "api_name": "rich.print", "line_number": 27, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 28, "usage_type": "call" }, { "api_name": "click.command", "line_numbe...
10101713941
from collections import Counter class Solution: def findAnagrams(self, s, p): targetHM = Counter(p) sw = len(p) result = [] i = 0 j = i+sw-1 tempHM = Counter(s[i:j]) while i<(len(s)-sw+1): tempHM[s[j]]+=1 match = True for k,...
fedhako7/Competitive-Programming
Find all anagram in string.py
Find all anagram in string.py
py
601
python
en
code
0
github-code
97
[ { "api_name": "collections.Counter", "line_number": 4, "usage_type": "call" }, { "api_name": "collections.Counter", "line_number": 9, "usage_type": "call" } ]
31464085281
from django.http import HttpResponse from django.views.decorators.csrf import csrf_exempt from . import api # Create your views here. @csrf_exempt def index(request): wx = api.Base() data = request.GET try: echostr = data['echostr'] result = wx.check_sign(data) if result: ...
ChanMo/django_wechat
wechat/views.py
views.py
py
544
python
en
code
10
github-code
97
[ { "api_name": "django.http.HttpResponse", "line_number": 16, "usage_type": "call" }, { "api_name": "django.http.HttpResponse", "line_number": 18, "usage_type": "call" }, { "api_name": "django.http.HttpResponse", "line_number": 22, "usage_type": "call" }, { "api_na...
3165637708
import dynet as dy import argparse import time import random import numpy as np from collections import defaultdict import math import pickle import json from tqdm import tqdm from model import LM parser = argparse.ArgumentParser() parser.add_argument("--dynet-mem", help="allocate memory for dynet") parser.add_argumen...
sikfeng/language-modelling-for-code-switching
rank_lstm_alts/get_scores.py
get_scores.py
py
8,062
python
en
code
0
github-code
97
[ { "api_name": "argparse.ArgumentParser", "line_number": 13, "usage_type": "call" }, { "api_name": "json.load", "line_number": 96, "usage_type": "call" }, { "api_name": "tqdm.tqdm", "line_number": 97, "usage_type": "call" }, { "api_name": "tqdm.tqdm", "line_num...
2716122487
import sys import math from io import open from conllu import parse def load_conll_file(filename): text = open(filename, "r", encoding="utf-8").read() return parse(text) def save_tb(tb): for sent in tb: if sent.metadata: for key, value in sent.metadata.items(): if va...
aymara/lima-ud-depparser
split_long_sentences.py
split_long_sentences.py
py
10,062
python
en
code
0
github-code
97
[ { "api_name": "io.open", "line_number": 9, "usage_type": "call" }, { "api_name": "conllu.parse", "line_number": 10, "usage_type": "call" }, { "api_name": "math.floor", "line_number": 68, "usage_type": "call" }, { "api_name": "sys.stderr.write", "line_number": ...
40321251863
# encoding: utf-8 # (C) 2001 - 2020 Rajkumar Palani <rajkumarpalani07@gmail.com> import pytest from tamil import utf8 def test_get_tamil_utf_count(): expected = 364 assert(utf8.get_tamil_utf_count() == expected) def test_get_tamil_utf(): expected = 364 assert(len(utf8.get_tamil_utf()) == expected) ...
rajkumarpal07/powertamil
tests/test_utf8.py
test_utf8.py
py
1,027
python
en
code
3
github-code
97
[ { "api_name": "tamil.utf8.get_tamil_utf_count", "line_number": 10, "usage_type": "call" }, { "api_name": "tamil.utf8", "line_number": 10, "usage_type": "name" }, { "api_name": "tamil.utf8.get_tamil_utf", "line_number": 15, "usage_type": "call" }, { "api_name": "ta...
37888491191
import IAFlow as flw from scipy import ndimage from matplotlib.pyplot import imshow, show import random import numpy as np def load_data(): data = np.loadtxt("Data.txt", dtype='float32') return data def num(y): resultRaw = [] for i in range(len(y)): resultRaw.append(np.where(y[i] == y[i].max()...
davidhrra/IAFlow
ex4.py
ex4.py
py
2,364
python
en
code
0
github-code
97
[ { "api_name": "numpy.loadtxt", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.where", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.argmax", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.reshape", "line_numbe...
19574226139
#!/usr/bin/env python """ Global Average Plot =================== Using cartopy_ we can easily visualize gridded model output on maps with different cartographic projections, and then configure them with any aesthetics or features such as continents, geopolitical borders, gridlines, and more. .. _cartopy: http://scit...
darothen/gcpy
examples/plotting/plot_global.py
plot_global.py
py
2,179
python
en
code
1
github-code
97
[ { "api_name": "matplotlib.pyplot.style.use", "line_number": 17, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.style", "line_number": 17, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot", "line_number": 17, "usage_type": "name" }, { "api_na...
13592634542
from django.contrib import admin from .models import Category, Question class QuestionAdmin(admin.ModelAdmin): fieldsets = [ (None, {'fields': ['question_text']}), ] admin.site.register(Question, QuestionAdmin) admin.site.register(Category) # Register your models here.
rohit-raj/Job_Done
testproject/quest/admin.py
admin.py
py
304
python
en
code
1
github-code
97
[ { "api_name": "django.contrib.admin.ModelAdmin", "line_number": 5, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 5, "usage_type": "name" }, { "api_name": "django.contrib.admin.site.register", "line_number": 10, "usage_type": "call" },...
29171678044
import matplotlib.pyplot as plt import itertools from sklearn.cluster import KMeans from sklearn import metrics from time import time from sklearn.ensemble import RandomForestClassifier from sklearn.datasets import make_classification import numpy as np import matplotlib.pyplot as plt from sklearn.naive_bayes import Ga...
turnersr/modulation-distinguishing
utilities.py
utilities.py
py
4,280
python
en
code
1
github-code
97
[ { "api_name": "numpy.linspace", "line_number": 22, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 63, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 63, "usage_type": "name" }, { "api_name": "matplotlib....
72941681918
import string from bs4 import BeautifulSoup from classObj import * import requests class SubjectObj: #Holds to top level URL mainURL = 'https://catalog.unc.edu/courses/' def __init__(self, name, abb, href): self.name = name self.abbreviation = abb self.href = href self.cl...
iadams749/UNC-Class-Info-Scraper
subjectObj.py
subjectObj.py
py
5,742
python
en
code
3
github-code
97
[ { "api_name": "requests.get", "line_number": 25, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 26, "usage_type": "call" }, { "api_name": "string.ascii_letters", "line_number": 140, "usage_type": "attribute" } ]
36040116871
#!/usr/bin/env python3 import argparse from mlagents_envs.environment import UnityEnvironment from mlagents_envs.side_channel.engine_configuration_channel import EngineConfigurationChannel from gym_unity.envs import UnityToGymWrapper from lib import model from PIL import Image import numpy as np import torch ENV_ID...
MarcielDechert/Robotic-RL
Lernalgorithmen/SAC-Algorithmus/SAC_Player.py
SAC_Player.py
py
2,265
python
de
code
0
github-code
97
[ { "api_name": "argparse.ArgumentParser", "line_number": 21, "usage_type": "call" }, { "api_name": "mlagents_envs.side_channel.engine_configuration_channel.EngineConfigurationChannel", "line_number": 27, "usage_type": "call" }, { "api_name": "mlagents_envs.environment.UnityEnviron...
72909486718
import logging import pytorch_lightning as pl import torch import torchmetrics from torch.nn import functional as F from nevermore.data import NYUv2Dataset from nevermore.metric import Abs_CosineSimilarity from nevermore.model.network import SingleSegNet __all__ = ['SingleSegnetNYUv2Model'] logger = logging.getLogg...
mmmmmddddd/nevermore
nevermore/model/module/single_segnet_nyuv2.py
single_segnet_nyuv2.py
py
4,464
python
en
code
2
github-code
97
[ { "api_name": "logging.getLogger", "line_number": 14, "usage_type": "call" }, { "api_name": "pytorch_lightning.LightningModule", "line_number": 17, "usage_type": "attribute" }, { "api_name": "nevermore.data.NYUv2Dataset.CLASSES", "line_number": 30, "usage_type": "attribut...
6329015806
from __future__ import absolute_import from __future__ import division from __future__ import print_function import itertools import os import shutil import tensorflow as tf from tensorflow_recommenders_addons import dynamic_embedding as de from tensorflow.core.protobuf import config_pb2 from tensorflow.python.fram...
tensorflow/recommenders-addons
tensorflow_recommenders_addons/dynamic_embedding/python/kernel_tests/horovod_sync_train_test.py
horovod_sync_train_test.py
py
14,018
python
en
code
520
github-code
97
[ { "api_name": "tensorflow.core.protobuf.config_pb2.ConfigProto", "line_number": 30, "usage_type": "call" }, { "api_name": "tensorflow.core.protobuf.config_pb2", "line_number": 30, "usage_type": "name" }, { "api_name": "tensorflow.core.protobuf.config_pb2.GPUOptions", "line_nu...
4187673623
import logging import os import shutil import subprocess import tempfile import multiprocessing as mp from autometa.common.exceptions import ExternalToolError logger = logging.getLogger(__name__) def sort(sam, bam, cpus=mp.cpu_count()): """ Views then sorts sam file by leftmost coordinates and outputs to ba...
KwanLab/Autometa
autometa/common/external/samtools.py
samtools.py
py
2,810
python
en
code
34
github-code
97
[ { "api_name": "logging.getLogger", "line_number": 10, "usage_type": "call" }, { "api_name": "multiprocessing.cpu_count", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 38, "usage_type": "call" }, { "api_name": "os.path", ...
11592016945
from django.shortcuts import render from django.conf import settings from django.core.mail import send_mail # Create your views here. def index(request): return render(request,'email/index.html',context=None) def send_email(request): subject='Django mail' message='trying to send mail' from_email=setti...
subhamMishra14/DJANGO-DEPLOYMENT-MINDFIRE
DJANGO-DEPLOYMENT-MINDFIRE/level_4_project_mindfire_SEND_EMAILS/SEND_EMAILS/views.py
views.py
py
518
python
en
code
0
github-code
97
[ { "api_name": "django.shortcuts.render", "line_number": 7, "usage_type": "call" }, { "api_name": "django.conf.settings.EMAIL_HOST_USER", "line_number": 12, "usage_type": "attribute" }, { "api_name": "django.conf.settings", "line_number": 12, "usage_type": "name" }, { ...
17204244677
import os import sys import pandas as pd import pytest import shutil from datetime import datetime sys.path.append(os.path.abspath(os.path.dirname(__file__)+'/../..')) from src import todos @pytest.fixture(scope="function") def tmp_dir(tmpdir_factory): my_tmpdir = tmpdir_factory.mktemp("pytestdata") todos.PAT...
RoSaav/modulo_II
todos/tests/integration/test_integration.py
test_integration.py
py
1,976
python
en
code
0
github-code
97
[ { "api_name": "sys.path.append", "line_number": 7, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 7, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path", "line_number...
25101885579
#!/usr/bin/env python """Copy random files form source to the destination""" import logging import os def parseArgs(): """Parse arguments from command line""" from argparse import ArgumentParser from sys import exit parser = ArgumentParser( description='Copy random files from source to destin...
asenci/fillrandom
fillrandom.py
fillrandom.py
py
4,628
python
en
code
1
github-code
97
[ { "api_name": "argparse.ArgumentParser", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 32, "usage_type": "call" }, { "api_name": "os.path", "line_number": 32, "usage_type": "attribute" }, { "api_name": "sys.exit", "l...
15768578144
import requests import json_extract from bs4 import BeautifulSoup # Create session s = requests.session() # Extract data from JSON files site = json_extract.extract('site.json')[0] urls = site.urls widgets = site.widgets ext = site.app_window_ext login_data = json_extract.extract('login_data.json')[0] keywords = json...
Puratinamu/Application-Document-Generator
auto-apply.py
auto-apply.py
py
1,677
python
en
code
1
github-code
97
[ { "api_name": "requests.session", "line_number": 6, "usage_type": "call" }, { "api_name": "json_extract.extract", "line_number": 9, "usage_type": "call" }, { "api_name": "json_extract.extract", "line_number": 13, "usage_type": "call" }, { "api_name": "json_extract...
27153454438
import websocket import json import requests from config import username, password, rooms, header, admin, avatar from battle import Battle current_battle = None current_information = None opp_pokemon = { "name": None, "hp": None } def parser(wsapp, message): #websocket.enableTrace(True) # fo...
Emboar02/Embot02
main.py
main.py
py
3,789
python
en
code
0
github-code
97
[ { "api_name": "battle.Battle", "line_number": 25, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 30, "usage_type": "call" }, { "api_name": "config.username", "line_number": 50, "usage_type": "name" }, { "api_name": "config.password", "line_...
41233794022
from selenium import webdriver from selenium.webdriver.support.wait import WebDriverWait import time import requests def geturl(url): res = requests.head(url) url = res.headers.get('location') return url a = 1 with open('id.txt', 'r') as x: for line in x: id = line.replace('\n', '') url = 'http://cli...
jingtaiboke/google-crx-download
run.py
run.py
py
598
python
en
code
0
github-code
97
[ { "api_name": "requests.head", "line_number": 7, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 18, "usage_type": "call" } ]
29791168901
# coding=utf-8 # auther:Liul5 # date:2019/4/26 13:08 # tools:PyCharm # Python:2.7.15 # https://py.checkio.org/en/mission/sendgrid-daily-spam/ # https://github.com/sendgrid/sendgrid-python/blob/master/USAGE.md#api-keys import sendgrid import json from datetime import datetime from datetime import timedelta # need to r...
lucas234/leetcode-checkio
Checkio/sendGrid_spam_reports.py
sendGrid_spam_reports.py
py
802
python
en
code
0
github-code
97
[ { "api_name": "sendgrid.SendGridAPIClient", "line_number": 17, "usage_type": "call" }, { "api_name": "datetime.datetime.strptime", "line_number": 21, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 21, "usage_type": "name" }, { "api_name"...
29244517817
import torch import torch.nn as nn import os class Model1(torch.nn.Module): def __init__(self): super().__init__() self.conv = nn.Conv2d(1, 1, 3, stride=1, padding=1,bias=True) self.conv.weight.data.fill_(1) self.conv.bias.data.fill_(0) def forward(self, x): x = self.c...
LittleSheepy/MyMLStudy
09ONNX/01examples/00shape节点处理.py
00shape节点处理.py
py
1,192
python
en
code
3
github-code
97
[ { "api_name": "torch.nn", "line_number": 5, "usage_type": "attribute" }, { "api_name": "torch.nn.Conv2d", "line_number": 9, "usage_type": "call" }, { "api_name": "torch.nn", "line_number": 9, "usage_type": "name" }, { "api_name": "torch.nn", "line_number": 18,...
26336778504
"""OT-3 Module and it's attributes.""" from typing import Optional from pydantic import Field from typing_extensions import Literal from emulation_system.compose_file_creator.config_file_settings import ( EmulationLevels, Hardware, OpentronsRepository, SourceRepositories, ) from emulation_system.compo...
Opentrons/opentrons-emulation
emulation_system/emulation_system/compose_file_creator/input/hardware_models/robots/ot3_model.py
ot3_model.py
py
2,990
python
en
code
12
github-code
97
[ { "api_name": "robot_model.RobotAttributes", "line_number": 24, "usage_type": "name" }, { "api_name": "emulation_system.compose_file_creator.pipette_utils.get_valid_ot3_pipettes", "line_number": 27, "usage_type": "call" }, { "api_name": "emulation_system.compose_file_creator.pipe...
714991217
import sys import ply.yacc as yacc import turtle import copy from gramatica import tokens class CalcError(Exception): def __init__(self, message): self.message = message variables = {"main": {"type": "void", "param": {}, "run": [], "var": {"cont sys": 0}}} # Cubo semantico con las...
Mike-Castro/ProyectoFinal-Compiladores
sintaxis.py
sintaxis.py
py
26,272
python
en
code
0
github-code
97
[ { "api_name": "copy.deepcopy", "line_number": 350, "usage_type": "call" }, { "api_name": "copy.deepcopy", "line_number": 363, "usage_type": "call" }, { "api_name": "copy.deepcopy", "line_number": 375, "usage_type": "call" }, { "api_name": "ply.yacc.yacc", "lin...
33216690174
"""AtomRhoOrbitalRadialSlater and AtomRhoOrbitalRadialSlaterL classes.""" from typing import NoReturn import os import os.path import math import numpy import scipy import scipy.optimize from pycifstar import to_data from cryspy.A_functions_base.function_1_objects import \ form_items_by_dictionary from cryspy.A_...
ikibalin/cryspy
cryspy/C_item_loop_classes/cl_2_atom_rho_orbital_radial_slater.py
cl_2_atom_rho_orbital_radial_slater.py
py
10,135
python
en
code
5
github-code
97
[ { "api_name": "cryspy.B_parent_classes.cl_1_item.ItemN", "line_number": 23, "usage_type": "name" }, { "api_name": "typing.NoReturn", "line_number": 91, "usage_type": "name" }, { "api_name": "numpy.array", "line_number": 107, "usage_type": "attribute" }, { "api_nam...
30787421163
# -*- coding: utf-8 -*- """ @author: Nashrah """ import pandas as pd monthly_death=pd.read_csv('monthly_deaths.csv') monthly_death['Year']=[d.split('-')[0] for d in monthly_death['date']] #print(type(monthly_death['deaths'])) sum_deaths1841=0 sum_births1841=0 year1841=monthly_death.loc[monthly_d...
Nashrahkhan22/Medical-Advancement
medical_advancement.py.py
medical_advancement.py.py
py
3,482
python
en
code
0
github-code
97
[ { "api_name": "pandas.read_csv", "line_number": 9, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 118, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 123, "usage_type": "call" }, { "api_name": "matplotlib.p...
763381551
import fnmatch import os import glob from pathlib import Path class Tesztolok: def __init__(self, lepath=None, lofilter=None, izfolder=False): self.folderz = os.scandir(lepath) self.pathz = Path(lepath if lepath is not None else "/") self.lofilter = lofilter self.izfolder = izfold...
disconnect5852/Pythonos
helloworld/__init__.py
__init__.py
py
974
python
en
code
1
github-code
97
[ { "api_name": "os.scandir", "line_number": 10, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path.isdir", "line_number": 21, "usage_type": "call" }, { "api_name": "os.path", "line_number": 21...
23347120528
from gtts import gTTS import os import pyglet from time import * import sys f = open(os.devnull, 'w') sys.stdout = f def say(text): tts = gTTS(text=text, lang='en-uk') filename = '/tmp/temp.mp3' tts.save(filename) start2=time() music = pyglet.media.load(filename, streaming=False) music.play() ...
grantpauker/baby-speak
babies.py
babies.py
py
799
python
en
code
0
github-code
97
[ { "api_name": "os.devnull", "line_number": 6, "usage_type": "attribute" }, { "api_name": "sys.stdout", "line_number": 7, "usage_type": "attribute" }, { "api_name": "gtts.gTTS", "line_number": 9, "usage_type": "call" }, { "api_name": "pyglet.media.load", "line_...
2824696353
from typing import List class Solution: def longestCommonPrefix(self, strs: List[str]) -> str: common = strs[0] for i in range(1, len(strs)): right = 0 while right < len(strs[i]) and right < len(common) and strs[i][right] == common[right]: right = right + 1 ...
EmisonLu/LeetCode
Python/String/14_LongestCommonPrefix/solution.py
solution.py
py
507
python
en
code
0
github-code
97
[ { "api_name": "typing.List", "line_number": 5, "usage_type": "name" } ]
19342165139
import keras from wnn_layer import WNN from keras.models import Sequential from keras.layers import Dense, Dropout, Activation from keras.optimizers import SGD from keras.utils import plot_model import matplotlib.pyplot as plt # Generate dummy data import numpy as np x = [] y = [] x_test = [] y_test = [] x_n = 0.01 l...
kenoma/KerasWaveletNN
KerasWaveletNeuralNetwork/case1_logistic_mapping.py
case1_logistic_mapping.py
py
1,494
python
en
code
0
github-code
97
[ { "api_name": "numpy.array", "line_number": 35, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 36, "usage_type": "call" }, { "api_name": "keras.models.Sequential", "line_number": 38, "usage_type": "call" }, { "api_name": "wnn_layer.WNN", "...
27943518194
from PIL import Image from io import BytesIO import requests import sys import numpy as np import tflite_runtime.interpreter as tflite # import time img = Image.open(requests.get(sys.argv[1], stream=True).raw) w, h = img.size image = Image.new('RGB', (512, 512), "WHITE") # RGM 스케일의 흰 정사각형 배경 이미지 생성 if w >= h: # 리사이징...
cjh980402/Soyabot
util/python/gl2face_portrait.py
gl2face_portrait.py
py
1,941
python
en
code
3
github-code
97
[ { "api_name": "PIL.Image.open", "line_number": 9, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 9, "usage_type": "name" }, { "api_name": "requests.get", "line_number": 9, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 9, ...
1439515743
import os import wave import nltk import logging import contextlib import environment as env import speech_recognition as sr from os import path from recognizers import sphinx # Duration, opens a wave file and finds the number of frames per rate # Input: a filename with a .wav file # Output: returns the framerate de...
vanities/SoundCount
utils.py
utils.py
py
4,514
python
en
code
1
github-code
97
[ { "api_name": "contextlib.closing", "line_number": 17, "usage_type": "call" }, { "api_name": "wave.open", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 29, "usage_type": "call" }, { "api_name": "os.path", "line_number"...