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
40129160584
# included from snippets/main.py def debug(*x, msg=""): import sys print(msg, *x, file=sys.stderr) def solve_TLE(N, K): MOD = 1_000_000_007 D = 2 ** 16 less = [0] * D equal = 0 for digit in N: digit = int(digit, 16) new_less = [0] * D less[0] += less[1] les...
nishio/atcoder
abc194/f.py
f.py
py
3,317
python
en
code
1
github-code
6
[ { "api_name": "sys.stderr", "line_number": 5, "usage_type": "attribute" }, { "api_name": "doctest.testmod", "line_number": 137, "usage_type": "call" }, { "api_name": "doctest.run_docstring_examples", "line_number": 142, "usage_type": "call" }, { "api_name": "io.St...
22395443116
from fastapi import FastAPI from starlette.websockets import WebSocket, WebSocketDisconnect from db import database import logging import sys logger = logging.getLogger(__name__) logger.setLevel(logging.INFO) handler = logging.StreamHandler(sys.stdout) logger.addHandler(handler) app = FastAPI() @app.on_event("star...
tamanobi/supreme-potato
backend/main.py
main.py
py
1,915
python
en
code
0
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 9, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 10, "usage_type": "attribute" }, { "api_name": "logging.StreamHandler", "line_number": 11, "usage_type": "call" }, { "api_name": "sys.stdout",...
20235314008
import collections import numpy as np def build(words, vocab_size=None): # builds from a continuous document counts = [['UNK', -1]] if vocab_size is None: vocab_size = np.unique(words).size counts.extend(collections.Counter(words.icd9_code).most_common(vocab_size)) dictionary = dict() ...
mwalton/bdh22
notes/util.py
util.py
py
2,555
python
en
code
0
github-code
6
[ { "api_name": "numpy.unique", "line_number": 8, "usage_type": "call" }, { "api_name": "collections.Counter", "line_number": 10, "usage_type": "call" }, { "api_name": "collections.Counter", "line_number": 37, "usage_type": "call" }, { "api_name": "numpy.zeros", ...
39964481524
import logging import unittest import cv2 import matplotlib.pyplot as plt import numpy as np from PIL import Image logger = logging.getLogger(__name__) logger.setLevel(logging.DEBUG) logging.basicConfig() class HairSegmentationTestCase(unittest.TestCase): def test_inference(self): from face_segmentati...
IdeoG/ml-face-segmentation
tests/test_segmentation.py
test_segmentation.py
py
931
python
en
code
0
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 9, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 11, "usage_type": "attribute" }, { "api_name": "logging.basicConfig", "line_number": 12, "usage_type": "call" }, { "api_name": "unittest.Test...
8177676835
import logging from typing import List from uuid import UUID from acm_service.utils.logconf import DEFAULT_LOGGER from acm_service.utils.database.repository import AbstractRepository from acm_service.utils.events.producer import EventProducer from acm_service.agents.schema import Agent from acm_service.utils.h...
norkos/account-management
src/acm_service/agents/service.py
service.py
py
3,438
python
en
code
0
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 11, "usage_type": "call" }, { "api_name": "acm_service.utils.logconf.DEFAULT_LOGGER", "line_number": 11, "usage_type": "argument" }, { "api_name": "acm_service.utils.database.repository.AbstractRepository", "line_number": 16, ...
4313109790
from rest_framework import serializers from students import models class StudentModelSerializer(serializers.ModelSerializer): class Meta: models = models.Student fields='__all__' extra_kwargs={ 'age':{'min_value':0,'error_messages':"年龄不能为负数!"} } read_only_field...
woainia2/python
drfdemo/req/serializer.py
serializer.py
py
345
python
en
code
0
github-code
6
[ { "api_name": "rest_framework.serializers.ModelSerializer", "line_number": 5, "usage_type": "attribute" }, { "api_name": "rest_framework.serializers", "line_number": 5, "usage_type": "name" }, { "api_name": "students.models", "line_number": 7, "usage_type": "name" }, ...
24167728164
# http://arkouji.cocolog-nifty.com/blog/2017/07/yolotensorflow-.html import argparse from pathlib import Path import os import re import csv from xml.dom.minidom import parseString import cv2 import codecs import shutil import xml.etree.ElementTree as ET def find_all_files(directory): for root, dirs, files in os....
shigenius/tensorflow_works
tf-slim/script/convert_VOCformat.py
convert_VOCformat.py
py
6,637
python
en
code
0
github-code
6
[ { "api_name": "os.walk", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 18, "usage_type": "call" }, { "api_name": "os.path", "line_number": 18, "usage_type": "attribute" }, { "api_name": "pathlib.Path", "line_number": 2...
19886757190
import pytest import pendulum from unittest.mock import ANY from guardata.api.data import UserCertificateContent, DeviceCertificateContent, UserProfile from guardata.api.protocol import ( UserID, apiv1_organization_create_serializer, apiv1_organization_bootstrap_serializer, ) from guardata.api.protocol.han...
bitlogik/guardata
tests/backend/test_apiv1_organization.py
test_apiv1_organization.py
py
19,019
python
en
code
9
github-code
6
[ { "api_name": "guardata.api.protocol.apiv1_organization_create_serializer.req_dumps", "line_number": 21, "usage_type": "call" }, { "api_name": "guardata.api.protocol.apiv1_organization_create_serializer", "line_number": 21, "usage_type": "name" }, { "api_name": "guardata.api.prot...
19772257407
from __future__ import absolute_import, division, print_function import utool import numpy as np from ibeis.model.hots.smk import smk_core from ibeis.model.hots.hstypes import FLOAT_TYPE, VEC_DIM from vtool import clustering2 as clustertool from six.moves import zip (print, print_, printDBG, rrr, profile) = utool.injec...
smenon8/ibeis
_broken/smk_speed.py
smk_speed.py
py
5,781
python
en
code
null
github-code
6
[ { "api_name": "utool.inject", "line_number": 8, "usage_type": "call" }, { "api_name": "vtool.clustering2.group_indicies", "line_number": 26, "usage_type": "call" }, { "api_name": "vtool.clustering2", "line_number": 26, "usage_type": "name" }, { "api_name": "numpy....
75385620346
#!/usr/bin/env python3 import json import os from pathlib import Path import subprocess import typer # from qfutils.ds import union_json from settings import devcontainer_to_repository make = typer.Typer() def dockerhub(image: str, tag: str) -> str: return f"qfortier/{image}:{tag}" @make.command() def prune()...
fortierq/devcontainers
make.py
make.py
py
2,285
python
en
code
0
github-code
6
[ { "api_name": "typer.Typer", "line_number": 13, "usage_type": "call" }, { "api_name": "subprocess.run", "line_number": 20, "usage_type": "call" }, { "api_name": "subprocess.run", "line_number": 29, "usage_type": "call" }, { "api_name": "subprocess.run", "line_...
21815019193
from datetime import datetime from typing import List from sqlalchemy import or_, and_ from sqlalchemy.orm import Session from src.database.models import Contact, User from src.schemas import ContactModel, ContactUpdate, ContactStatusUpdate async def get_contacts(skip: int, limit: int, user: User, db: Session) -> Lis...
valerabad/IG-_App
src/repository/contacts.py
contacts.py
py
5,561
python
en
code
0
github-code
6
[ { "api_name": "src.database.models.User", "line_number": 9, "usage_type": "name" }, { "api_name": "sqlalchemy.orm.Session", "line_number": 9, "usage_type": "name" }, { "api_name": "src.database.models.Contact", "line_number": 24, "usage_type": "argument" }, { "api...
28379611807
# -*- coding: utf-8 -*- """ Created on Sun May 24 13:41:56 2020 @author: Trevor Ho """ # from opentrons import simulate # protocol = simulate.get_protocol_api(version = '2.4') from opentrons import protocol_api metadata = { 'apiLevel': '2.4' } def run(protocol: protocol_api.ProtocolContext): plate1 = prot...
tyhho/OT-2_APIv2_Workshop
Test_script.py
Test_script.py
py
960
python
en
code
5
github-code
6
[ { "api_name": "opentrons.protocol_api.ProtocolContext", "line_number": 17, "usage_type": "attribute" }, { "api_name": "opentrons.protocol_api", "line_number": 17, "usage_type": "name" } ]
11834107688
# essential from cgitb import text import tkinter as tk import numpy as np import tkinter.font as font import os, sys import cv2 import random # image from PIL import Image, ImageTk from collage_maker import Collage_Maker from archivid_scrapper import parse_and_save from utils import str_decode_to_Bytes...
PedroGGBM/Archivid
scripts/ui.py
ui.py
py
28,756
python
en
code
0
github-code
6
[ { "api_name": "collage_maker.Collage_Maker", "line_number": 25, "usage_type": "call" }, { "api_name": "user_crud.User_CRUD", "line_number": 28, "usage_type": "call" }, { "api_name": "studio_talent_crud.studio_talent_CRUD", "line_number": 29, "usage_type": "call" }, { ...
72278066749
from django.urls import path from rest_framework.urlpatterns import format_suffix_patterns from RomanianDepartment import views urlpatterns = [ path('romanian-group', views.RomanianGroupLister.as_view(), name='RomanianGroupLister'), path('romanian-group/<int:pk>', views.RomanianGroupDetails.as_view(),...
CiganOliviu/restapi-peer-to-peer
RomanianDepartment/urls.py
urls.py
py
882
python
en
code
1
github-code
6
[ { "api_name": "django.urls.path", "line_number": 6, "usage_type": "call" }, { "api_name": "RomanianDepartment.views.RomanianGroupLister.as_view", "line_number": 6, "usage_type": "call" }, { "api_name": "RomanianDepartment.views.RomanianGroupLister", "line_number": 6, "usa...
4314384960
""" =============================================================================== ENGR 13300 Fall 2021 Program Description Enrypts and Decrypts a file given a key string, utilizing pseudo random numbers. Assignment Information Assignment: Team Python Project Author: Pranav Srisankar, psrisan...
psrisank/Image-Decryption-Project
cipher2.py
cipher2.py
py
2,921
python
en
code
0
github-code
6
[ { "api_name": "matplotlib.pyplot.imread", "line_number": 38, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 38, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.hist", "line_number": 40, "usage_type": "call" }, { "api_name": "mat...
7782236077
import pygame.font from pygame.sprite import Group from ship import Ship class Scoreboard(): """ score display class """ def __init__(self, ai_settings, screen, stats): # init some socre info self.screen = screen self.screen_rect = screen.get_rect() self.ai_settings = ai...
fghnntp/pythonPracticeProject
AlianInvadation/score_board.py
score_board.py
py
2,862
python
en
code
0
github-code
6
[ { "api_name": "pygame.font.font.SysFont", "line_number": 17, "usage_type": "call" }, { "api_name": "pygame.font.font", "line_number": 17, "usage_type": "attribute" }, { "api_name": "pygame.font", "line_number": 17, "usage_type": "name" }, { "api_name": "pygame.spr...
18746600803
import unittest from corpus2graph.applications.naive_methods import graph_generator import configparser config = configparser.ConfigParser() config.read('config.ini') class TestGenerator(unittest.TestCase): """ ATTENTION Normally, data_folder and output_folder should be user defined paths (absolute paths). ...
zzcoolj/corpus2graph
corpus2graph/applications/naive_methods/graph_generator_test.py
graph_generator_test.py
py
1,390
python
en
code
23
github-code
6
[ { "api_name": "configparser.ConfigParser", "line_number": 5, "usage_type": "call" }, { "api_name": "unittest.TestCase", "line_number": 9, "usage_type": "attribute" }, { "api_name": "corpus2graph.applications.naive_methods.graph_generator.GraphGenerator", "line_number": 24, ...
70732561147
from typing import Type, Optional, Union, List, Generator, Iterable from sklearn.feature_extraction.text import ( CountVectorizer, TfidfVectorizer, ) import nmslib from ya_cup_2022.knn import dto from ya_cup_2022.utils.log import LogUnit from ya_cup_2022.utils.converter import ( TrackArtistConverter, ...
churilov-ns/ya_cup_22
ya_cup_2022/knn/model.py
model.py
py
5,359
python
en
code
0
github-code
6
[ { "api_name": "typing.Type", "line_number": 23, "usage_type": "name" }, { "api_name": "typing.Union", "line_number": 23, "usage_type": "name" }, { "api_name": "sklearn.feature_extraction.text.CountVectorizer", "line_number": 23, "usage_type": "name" }, { "api_name...
42602481023
#!/usr/bin/env python import numpy as np def argparse(): import argparse parser = argparse.ArgumentParser(description = """ Exclude specified images from the ASE readable atoms list file. """) # Positional arguments parser.add_argument('inp_file', type=str, help='ASE readable atoms list file na...
hitergelei/tools
ase-exclude-images.py
ase-exclude-images.py
py
2,082
python
en
code
0
github-code
6
[ { "api_name": "argparse.ArgumentParser", "line_number": 6, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 19, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 19, "usage_type": "attribute" }, { "api_name": "a...
13105963904
"""Executable script to run Bing search for subjects.""" import logging from configparser import ConfigParser from functools import partial from multiprocessing import Pool from typing import List from urllib.parse import quote_plus from nltk.corpus import wordnet as wn from nltk.corpus.reader.wordnet import Synset ...
phongnt570/ascent
src/pipeline/bing_search_module.py
bing_search_module.py
py
5,236
python
en
code
24
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 20, "usage_type": "call" }, { "api_name": "pipeline.module_interface.Module", "line_number": 23, "usage_type": "name" }, { "api_name": "configparser.ConfigParser", "line_number": 24, "usage_type": "name" }, { "api_...
40128571474
# included from snippets/main.py def debug(*x, msg=""): import sys print(msg, *x, file=sys.stderr) # included from libs/readMap.py """ read map from stdin into one-dimension list with sentinel """ def readMap(H, W, sentinel=1): global SENTINEL, HEIGHT, WIDTH global ORIGINAL_HEIGHT, ORIGINAL_WIDTH ...
nishio/atcoder
PAST4/g.py
g.py
py
2,641
python
en
code
1
github-code
6
[ { "api_name": "sys.stderr", "line_number": 5, "usage_type": "attribute" }, { "api_name": "doctest.testmod", "line_number": 111, "usage_type": "call" }, { "api_name": "doctest.run_docstring_examples", "line_number": 115, "usage_type": "call" }, { "api_name": "io.St...
37055257283
from typing import Callable, List import matplotlib.pyplot as plt def cumulative_sum(array: List[float]) -> List[float]: for i in range(1, len(array)): array[i] += array[i - 1] return array def plot( progress, change: Callable = None, xlabel: str = "Generation", ylabel: str = "Fitne...
nimaps/genetic
genetic/utils.py
utils.py
py
482
python
en
code
1
github-code
6
[ { "api_name": "typing.List", "line_number": 6, "usage_type": "name" }, { "api_name": "typing.Callable", "line_number": 14, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 20, "usage_type": "call" }, { "api_name": "matplotlib.pyplot",...
74083644029
""" Contains all views that are used in app. """ import json from django.shortcuts import render, redirect from django.http import HttpRequest, HttpResponse from django.contrib.auth import login, logout, authenticate from django.contrib import messages from django.contrib.auth.forms import UserCreationForm from django...
zigal0/lelang
lelang/views.py
views.py
py
7,815
python
en
code
0
github-code
6
[ { "api_name": "django.http.HttpRequest", "line_number": 18, "usage_type": "name" }, { "api_name": "django.contrib.auth.get_user_model", "line_number": 20, "usage_type": "call" }, { "api_name": "lelang.models.Language.objects.count", "line_number": 22, "usage_type": "call"...
27243748477
#!/usr/bin/python3 import time import traceback import paho.mqtt.client as mqtt import threading import json import urllib.request import eel import os import importlib from random import randrange ##### CONFIGURATION ##### host = "192.168.178.50" port = 1883 timeouttime = 10 ####### DEFAULTS ######## std_teams = 2 st...
ebinf/lasertag-server
lasertag_color.py
lasertag_color.py
py
38,952
python
en
code
0
github-code
6
[ { "api_name": "paho.mqtt.client.Client", "line_number": 58, "usage_type": "call" }, { "api_name": "paho.mqtt.client", "line_number": 58, "usage_type": "name" }, { "api_name": "json.load", "line_number": 70, "usage_type": "call" }, { "api_name": "json.load", "l...
2865626241
# -*- coding: utf-8 -*- import sys from io import open from math import ceil import numpy as np from keras.layers import Dense, Dropout, Input, Masking, Activation from keras.models import Model from keras.optimizers import Adam import utils from Encoder.Encoder_Predictor import Encoder_Predictor from Encoder.Encode...
ivodopyanov/HRNN
train_char.py
train_char.py
py
9,974
python
en
code
0
github-code
6
[ { "api_name": "io.open", "line_number": 24, "usage_type": "call" }, { "api_name": "utils.SENTENCES_FILENAME", "line_number": 24, "usage_type": "attribute" }, { "api_name": "utils.EOS_WORD", "line_number": 25, "usage_type": "attribute" }, { "api_name": "io.open", ...
4283657095
# Problem Statement: # Write a function, connected_components_count, that takes in the adjacency list of an undirected graph. # The function should return the number of connected components within the graph from collections import deque def connected_components_count(_graph): count = 0 visited = set() f...
divakarpatil51/competitive-programming
graph/connected_components_count.py
connected_components_count.py
py
884
python
en
code
0
github-code
6
[ { "api_name": "collections.deque", "line_number": 15, "usage_type": "call" } ]
38907341115
from sqlalchemy import Column, Integer, ForeignKey, Text from sqlalchemy.orm import relationship from app.core.database.base import Base class Review(Base): id = Column(Integer, primary_key=True, index=True) comment = Column(Text) stars = Column(Integer, nullable=False) user_id = Column(ForeignKey("u...
rasimatics/excursio-backend
app/apps/review/models.py
models.py
py
460
python
en
code
1
github-code
6
[ { "api_name": "app.core.database.base.Base", "line_number": 6, "usage_type": "name" }, { "api_name": "sqlalchemy.Column", "line_number": 7, "usage_type": "call" }, { "api_name": "sqlalchemy.Integer", "line_number": 7, "usage_type": "argument" }, { "api_name": "sql...
31132824161
import abc import copy import math from abc import ABC from typing import Union, List import matplotlib.pyplot as plt import numpy as np import torch from torch.nn import Module, BatchNorm2d, Conv2d from torch.utils.data import DataLoader from tqdm.auto import tqdm class Pruner(ABC): def __init__(self, model: M...
bnwiran/tinyml-benchmark
prune/pruner.py
pruner.py
py
9,612
python
en
code
0
github-code
6
[ { "api_name": "abc.ABC", "line_number": 15, "usage_type": "name" }, { "api_name": "torch.nn.Module", "line_number": 17, "usage_type": "name" }, { "api_name": "abc.abstractmethod", "line_number": 20, "usage_type": "attribute" }, { "api_name": "torch.nn.Module", ...
21635254502
import requests import json from whether import get_time, get_content, get_weather import hashlib,base64 from urllib import request from poem import get_poem time, count_down = get_time() jitang, translation, image_url = get_content() content = jitang+translation day_weather, day_temperature, day_wind = get_weather() ...
kwwgoo/whut_news
test/test4.py
test4.py
py
2,091
python
en
code
1
github-code
6
[ { "api_name": "whether.get_time", "line_number": 8, "usage_type": "call" }, { "api_name": "whether.get_content", "line_number": 9, "usage_type": "call" }, { "api_name": "whether.get_weather", "line_number": 11, "usage_type": "call" }, { "api_name": "poem.get_poem"...
19323116223
from .. import JOBS import os import sys import json def cadastrar_paises(app): print("[API][JOB] Populando a collections de paises...") arquivoJson = os.path.join(os.path.dirname(__file__), 'countriesJson_ptBR.json') paises = [] with open(arquivoJson,'r') as arquivo: paises = json.load...
eduardomp/pipa-dev-test
api/app/pais/jobs.py
jobs.py
py
844
python
pt
code
0
github-code
6
[ { "api_name": "os.path.join", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 10, "usage_type": "call" }, { "api_name": "json.load", "line_numbe...
27592762529
import scrapy import json from ..items import CommentItem class VnexpressSpiderSpider(scrapy.Spider): name = 'comment' allowed_domains = ['vnexpress.net'] start_urls = [] custom_settings = { 'ITEM_PIPELINES': {'vnexpress.pipelines.CommentPipeline': 300,}, # setting used CommentPipeline }...
thuy4tbn99/crawl_vnexpress
scrapy_vnexpress/vnexpress/vnexpress/spiders/comment_spider.py
comment_spider.py
py
2,459
python
en
code
0
github-code
6
[ { "api_name": "scrapy.Spider", "line_number": 4, "usage_type": "attribute" }, { "api_name": "scrapy.Request", "line_number": 30, "usage_type": "call" }, { "api_name": "scrapy.FormRequest", "line_number": 49, "usage_type": "call" }, { "api_name": "items.CommentItem...
20680565433
"""es.py Developer: Bayley King Date: 2-26-2022 Description: Individual for ES """ ################################## Imports ################################### from dataclasses import dataclass import os import tensorflow as tf import numpy as np import random from sklearn.metrics import accuracy_score, pr...
king2b3/ga_learn
src/ga_learn/individual.py
individual.py
py
8,182
python
en
code
0
github-code
6
[ { "api_name": "os.environ", "line_number": 16, "usage_type": "attribute" }, { "api_name": "tensorflow.random.set_seed", "line_number": 17, "usage_type": "call" }, { "api_name": "tensorflow.random", "line_number": 17, "usage_type": "attribute" }, { "api_name": "ten...
30138457545
# !/usr/local/python/bin/python # -*- coding: utf-8 -*- # (C) Wu Dong, 2020 # All rights reserved # @Author: 'Wu Dong <wudong@eastwu.cn>' # @Time: '2020-03-18 10:42' import json from flask import make_response, Flask from pre_request import pre, Rule app = Flask(__name__) app.config["TESTING"] = True rule = { "...
Eastwu5788/pre-request
tests/test_filter/test_length.py
test_length.py
py
2,548
python
en
code
55
github-code
6
[ { "api_name": "flask.Flask", "line_number": 12, "usage_type": "call" }, { "api_name": "pre_request.Rule", "line_number": 17, "usage_type": "call" }, { "api_name": "pre_request.Rule", "line_number": 18, "usage_type": "call" }, { "api_name": "pre_request.Rule", ...
31974549331
# -*- coding: utf-8 -*- import json import scrapy from auto_home_koubei.items import AutoHomeKoubeiItem from models.koubei import StructureStartUrl class KoubeiSpider(scrapy.Spider): name = 'koubei' base_url = "https://koubei.app.autohome.com.cn/autov9.1.0/alibi/seriesalibiinfos-pm2-ss%s-st0-p%s-s20-isstruc...
CY113/Cars
auto_home_koubei/auto_home_koubei/spiders/koubei.py
koubei.py
py
2,126
python
en
code
10
github-code
6
[ { "api_name": "scrapy.Spider", "line_number": 10, "usage_type": "attribute" }, { "api_name": "models.koubei.StructureStartUrl", "line_number": 13, "usage_type": "call" }, { "api_name": "auto_home_koubei.items.AutoHomeKoubeiItem", "line_number": 20, "usage_type": "call" ...
15511165599
import sys sys.path.append('.') import Packages.ClusteringHelper as ch from Packages.TimeEvolving import DataEvolver from textdistance import DamerauLevenshtein, JaroWinkler import numpy as np from sklearn.cluster import AgglomerativeClustering from Packages.TimeEvolving import Cluster from tqdm import tqdm import ma...
montis96/EntityClustering
evolving_clustering/OLD/script_one_step_incremental.py
script_one_step_incremental.py
py
4,353
python
en
code
1
github-code
6
[ { "api_name": "sys.path.append", "line_number": 3, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 3, "usage_type": "attribute" }, { "api_name": "sys.stdout", "line_number": 19, "usage_type": "attribute" }, { "api_name": "datetime.datetime.now", ...
72531839549
"""new project comments table Revision ID: af5de00bf4cf Revises: 71ea254837b0 Create Date: 2023-06-19 08:41:09.835411+00:00 """ import sqlalchemy as sa from alembic import op # revision identifiers, used by Alembic. revision = "af5de00bf4cf" down_revision = "71ea254837b0" branch_labels = None depends_on = None def...
ITISFoundation/osparc-simcore
packages/postgres-database/src/simcore_postgres_database/migration/versions/af5de00bf4cf_new_projects_comments_table.py
af5de00bf4cf_new_projects_comments_table.py
py
1,817
python
en
code
35
github-code
6
[ { "api_name": "alembic.op.create_table", "line_number": 20, "usage_type": "call" }, { "api_name": "alembic.op", "line_number": 20, "usage_type": "name" }, { "api_name": "sqlalchemy.Column", "line_number": 22, "usage_type": "call" }, { "api_name": "sqlalchemy.BigIn...
21257132026
r"""Portrait de phase d'un pendule Déscription ----------- Ce programme permet de représenter partiellement le portrait de phase d'une solution de l'équation d'un pendule simple. Seules les trajectoires commençant à theta=0 (avec une grande gamme de vitesses initiales) sont tracées, d'où un portrait de phase non ...
juliecorjon/Agreg-Github
python_agregation-master/programmes_lecons/portrait_de_phase.py
portrait_de_phase.py
py
3,244
python
fr
code
0
github-code
6
[ { "api_name": "numpy.linspace", "line_number": 46, "usage_type": "call" }, { "api_name": "numpy.linspace", "line_number": 50, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 61, "usage_type": "call" }, { "api_name": "numpy.sin", "line_numbe...
11276903778
# -*- coding: utf-8 -*- """ Created on Thu Sep 3 07:09:39 2020 @author: N3koSempai """ from io import open def textinsert(initialcaract, myline, urlfile): """initialcaracter is the caracter for start the change text remember is a int (). myline is your custom line of text you need add in the midle of text fil...
N3koSempai/textinsert-module
textinsertion.py
textinsertion.py
py
932
python
en
code
1
github-code
6
[ { "api_name": "io.open", "line_number": 20, "usage_type": "call" }, { "api_name": "io.open", "line_number": 33, "usage_type": "call" } ]
74545304828
from sqlalchemy.orm import Session from typing import List from sqlalchemy import func from fastapi import FastAPI, Depends, HTTPException from database import SessionLocal from schema import UserGet, PostGet, FeedGet from table_user import User from table_post import Post from table_feed import Feed from loguru im...
jijaken/SQLAlchemy-FastAPI
app.py
app.py
py
3,005
python
ru
code
0
github-code
6
[ { "api_name": "fastapi.FastAPI", "line_number": 18, "usage_type": "call" }, { "api_name": "database.SessionLocal", "line_number": 24, "usage_type": "call" }, { "api_name": "fastapi.HTTPException", "line_number": 32, "usage_type": "call" }, { "api_name": "sqlalchem...
70895854267
import pandas as pd from stanza.nlp.corenlp import CoreNLPClient import re client = CoreNLPClient(server='http://localhost:9000', default_annotators=['ssplit', 'tokenize', 'pos']) fields = ['Tweet', 'Target', 'Stance'] train = pd.read_csv('/Users/krishna/Desktop/PycharmProjects/cla5/train.csv', engine='python', usec...
krishnaravichandran/claproject
test.py
test.py
py
2,374
python
en
code
0
github-code
6
[ { "api_name": "stanza.nlp.corenlp.CoreNLPClient", "line_number": 5, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 9, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 10, "usage_type": "call" }, { "api_name": "re.sub...
28472941354
import torch import random import numpy as np from collections import deque from AIgame import PaddleGame from model import LinQNetwork, Trainer from helper import plot # Game Parameters WIDTH, HEIGHT = 450, 500 # Adjust these parameters to modify exploration vs. exploitation MAX_EXP_RATE = 1 MIN_EXP_RATE = 0.01 EXP_DE...
MBDur12/BattleShips---Simple-RLGame
SimplePaddleGame/agent.py
agent.py
py
7,286
python
en
code
0
github-code
6
[ { "api_name": "collections.deque", "line_number": 24, "usage_type": "call" }, { "api_name": "model.LinQNetwork", "line_number": 27, "usage_type": "call" }, { "api_name": "model.Trainer", "line_number": 28, "usage_type": "call" }, { "api_name": "numpy.array", "...
35725789234
import config as cfg import cv2 import numpy as np from keras.models import load_model from keras.preprocessing.image import img_to_array class predict_emotions: def __init__(self): """ Initialize by loading the model for the emotion detection """ self.model = load_model(cfg.path_...
Clementee/Liveness-Secure-KYC
emotion_detection/f_emotion_detection.py
f_emotion_detection.py
py
1,841
python
en
code
0
github-code
6
[ { "api_name": "keras.models.load_model", "line_number": 14, "usage_type": "call" }, { "api_name": "config.path_model", "line_number": 14, "usage_type": "attribute" }, { "api_name": "cv2.resize", "line_number": 25, "usage_type": "call" }, { "api_name": "cv2.cvtColo...
37430232478
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' name: phpstudy探针 referer: unknown author: Lucifer description: phpstudy默认存在探针l.php,泄露敏感信息。 ''' import sys import requests class phpstudy_probe_BaseVerify: def __init__(self, url): self.url = url def run(self): headers = { "User-Ag...
iceyhexman/onlinetools
scanner/plugins/cms/phpstudy/phpstudy_probe.py
phpstudy_probe.py
py
957
python
en
code
1,626
github-code
6
[ { "api_name": "requests.get", "line_number": 25, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 34, "usage_type": "attribute" } ]
23797254
import csv from datetime import datetime # Path to file where CSV data, in the format of the # Kaggle/Components dataset, is saved BASE_CSV_PATH = "data_raw" class ArticleSet: """Class to handle set of articles while fetching from remote.""" def _filename(self): datetime_now = datetime.now().strftim...
csaguiar/media-bias-political-news
data_collection/article_set.py
article_set.py
py
1,496
python
en
code
5
github-code
6
[ { "api_name": "datetime.datetime.now", "line_number": 13, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 13, "usage_type": "name" }, { "api_name": "csv.writer", "line_number": 43, "usage_type": "call" } ]
26776108190
"""Discovery plugin.""" import logging import os import subprocess import sys from typing import Any, List, Optional, Union from yapsy.IPlugin import IPlugin from statick_tool.exceptions import Exceptions from statick_tool.package import Package from statick_tool.plugin_context import PluginContext class DiscoveryP...
sscpac/statick
statick_tool/discovery_plugin.py
discovery_plugin.py
py
3,757
python
en
code
66
github-code
6
[ { "api_name": "yapsy.IPlugin.IPlugin", "line_number": 15, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 20, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 24, "usage_type": "name" }, { "api_name": "typing.Any", "l...
14975427820
"""Constants for dueros.""" from logging import Logger, getLogger LOGGER: Logger = getLogger(__package__) NAME = "DuerOS" DOMAIN = "dueros" VERSION = "0.0.1" ATTRIBUTION = "Data provided by http://jsonplaceholder.typicode.com/" BDUSS = "bduss" BOT_ID_APPLIANCE_ID_SEPARATOR = "/" BRIGHTNESS_MAX = 255
zsy056/dueros-ha
custom_components/dueros/const.py
const.py
py
306
python
en
code
0
github-code
6
[ { "api_name": "logging.Logger", "line_number": 4, "usage_type": "name" }, { "api_name": "logging.getLogger", "line_number": 4, "usage_type": "call" } ]
3848864210
from typing import Union, Optional from torch_geometric.typing import OptPairTensor, Adj, OptTensor import torch from torch import Tensor import torch.nn.functional as F from torch.nn import Parameter from torch_geometric.nn.dense.linear import Linear from torch_geometric.nn.conv import MessagePassing from torch_geome...
hans66hsu/GATS
src/calibrator/attention_ts.py
attention_ts.py
py
4,795
python
en
code
13
github-code
6
[ { "api_name": "torch_geometric.nn.conv.MessagePassing", "line_number": 14, "usage_type": "name" }, { "api_name": "torch_geometric.typing.OptTensor", "line_number": 15, "usage_type": "name" }, { "api_name": "torch_geometric.typing.Adj", "line_number": 21, "usage_type": "na...
30355497442
import re import APIKey import requests import argparse from PIL import Image from io import BytesIO import subprocess from typing import List, Tuple # Obtain Path from command line arguments and parse it parser = argparse.ArgumentParser( description='Generate subtitles and overlay them on a video file') parser....
Brotherswords/Video-Creation-Tool
overlay_generation/ImageGeneration.py
ImageGeneration.py
py
8,822
python
en
code
0
github-code
6
[ { "api_name": "argparse.ArgumentParser", "line_number": 13, "usage_type": "call" }, { "api_name": "re.findall", "line_number": 33, "usage_type": "call" }, { "api_name": "re.findall", "line_number": 35, "usage_type": "call" }, { "api_name": "typing.List", "line...
45997984626
from email.headerregistry import Group from django.contrib import admin from . models import Contact, End_Section_Of_Products, Home,Settings,About,Testimonial,Our_Works,Product_Type_1,Product_Type_2,Product_Type1_Features,Product_Type1_Assurances,Product_Type1_Structure,Product_Type2_Assurance,Product_Type2_Features,Cu...
NitenSapkota175/Sapphire_Main
Sapphire/admin.py
admin.py
py
7,157
python
en
code
0
github-code
6
[ { "api_name": "django.contrib.admin.ModelAdmin", "line_number": 24, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 24, "usage_type": "name" }, { "api_name": "models.Home", "line_number": 25, "usage_type": "name" }, { "api_name": ...
43200142527
"""empty message Revision ID: 506e478e0611 Revises: 5b1f1d56cb45 Create Date: 2019-06-03 19:04:16.345696 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '506e478e0611' down_revision = '5b1f1d56cb45' branch_labels = None depends_on = None def upgrade(): # ...
tgalvinjr/blog-ip
migrations/versions/506e478e0611_.py
506e478e0611_.py
py
828
python
en
code
0
github-code
6
[ { "api_name": "alembic.op.drop_constraint", "line_number": 21, "usage_type": "call" }, { "api_name": "alembic.op", "line_number": 21, "usage_type": "name" }, { "api_name": "alembic.op.drop_column", "line_number": 22, "usage_type": "call" }, { "api_name": "alembic....
36370861989
import numpy as np import csv import matplotlib.pyplot as plt from numpy.polynomial.polynomial import polyfit from scipy import optimize with open("airline_delay.csv") as csvfile: reader = csv.DictReader(csvfile) data = [r for r in reader] NUM = len(data) #print NUM totalyear=17 totalmonth = 12 delay_cause...
dongzhang84/Flight_delay
old_folder/project_code4.py
project_code4.py
py
9,028
python
en
code
0
github-code
6
[ { "api_name": "csv.DictReader", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 33, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 34, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number"...
39673256744
import copy from typing import TYPE_CHECKING, Dict, Type from craft_parts import errors from .autotools_plugin import AutotoolsPlugin from .base import Plugin from .dump_plugin import DumpPlugin from .make_plugin import MakePlugin from .nil_plugin import NilPlugin from .properties import PluginProperties if TYPE_CHE...
cmatsuoka/craft-parts-orig
craft_parts/plugins/plugins.py
plugins.py
py
1,976
python
en
code
0
github-code
6
[ { "api_name": "typing.TYPE_CHECKING", "line_number": 13, "usage_type": "name" }, { "api_name": "typing.Type", "line_number": 18, "usage_type": "name" }, { "api_name": "base.Plugin", "line_number": 18, "usage_type": "name" }, { "api_name": "typing.Dict", "line_...
11004328838
from typing import List class Solution: def findItinerary(self, tickets: List[List[str]]) -> List[str]: edge = collections.defaultdict(list) for fro, to in tickets: edge[fro].append(to) for frm, to in edge.items(): to.sort(reverse=True) res = [] self...
xixihaha1995/CS61B_SP19_SP20
temp/toy/python/332. Reconstruct Itinerary.py
332. Reconstruct Itinerary.py
py
533
python
en
code
0
github-code
6
[ { "api_name": "typing.List", "line_number": 5, "usage_type": "name" } ]
32488893469
#! /usr/bin/env python # -*- coding: UTF-8 -*- import fasttext def isResultValid(result,katman): if(float(result[1])<0.88): print("Alakasız bir yanıt girdininiz") answer2 = input("Lütfen Tekrar bir yanıt girin ") detectAnswer(katman,answer2) return result[0][0][9:] def detectAnswer(...
umuteroll/grad-project-kou
detectAnswerWithML.py
detectAnswerWithML.py
py
575
python
tr
code
0
github-code
6
[ { "api_name": "fasttext.train_supervised", "line_number": 16, "usage_type": "call" } ]
71578019067
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Defines the ``@typechecked`` decorator. """ import os import inspect from typing import Any, Set, Dict, Tuple from oxentiel import Oxentiel from sympy.core.expr import Expr from asta.utils import astasolver from asta.config import get_ox from asta.display import get_h...
langfield/asta
asta/decorators.py
decorators.py
py
6,056
python
en
code
14
github-code
6
[ { "api_name": "typing.Dict", "line_number": 18, "usage_type": "name" }, { "api_name": "typing.Any", "line_number": 18, "usage_type": "name" }, { "api_name": "typing.Tuple", "line_number": 18, "usage_type": "name" }, { "api_name": "inspect.signature", "line_num...
5143889391
from django.test.utils import override_settings from django.conf import settings from selenium.webdriver.common.keys import Keys import os from .base import FunctionalTest class CreateCharityTest(FunctionalTest): # Setting DEBUG to True prevents an error whereby # the admin site doesn't load any static ...
rtcharity/receipt_generator_app
functional_tests/test_create_charity.py
test_create_charity.py
py
1,667
python
en
code
1
github-code
6
[ { "api_name": "base.FunctionalTest", "line_number": 9, "usage_type": "name" }, { "api_name": "django.test.utils.override_settings", "line_number": 13, "usage_type": "call" } ]
196718576
import jinja2 import os import sys import yaml import pdb # add the parent directory to sys.path import os,sys,inspect currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) parentdir = os.path.dirname(currentdir) sys.path.append(parentdir) # a bit of a hack for developing -- run m4 to...
xmaruto/mcord
xos/tosca/makedocs.py
makedocs.py
py
2,592
python
en
code
0
github-code
6
[ { "api_name": "os.path.dirname", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 9, "usage_type": "call" }, { "api_name": "inspect.getfile", "line...
811859656
# Longest Substring with At Most Two Distinct Characters - https://leetcode.com/problems/longest-substring-with-at-most-two-distinct-characters/ '''Given a string s , find the length of the longest substring t that contains at most 2 distinct characters.''' # Input: "eceba" # Output: 3 # Explanation: t is "ece" which...
Saima-Chaity/Leetcode
Sliding_Window/LongestSubstringWithAtMostTwoDistinctCharacters.py
LongestSubstringWithAtMostTwoDistinctCharacters.py
py
884
python
en
code
0
github-code
6
[ { "api_name": "collections.OrderedDict", "line_number": 14, "usage_type": "call" } ]
74437096828
from django.contrib.auth import authenticate, login, logout from django.contrib.auth.decorators import login_required from django.shortcuts import render, HttpResponse, redirect, get_object_or_404 from .models import Advertisement from django.contrib.auth.models import User from django.contrib import messages from .for...
dipeshkhatiwada/newsportal
advertisement/views.py
views.py
py
1,813
python
en
code
0
github-code
6
[ { "api_name": "models.Advertisement.objects.all", "line_number": 12, "usage_type": "call" }, { "api_name": "models.Advertisement.objects", "line_number": 12, "usage_type": "attribute" }, { "api_name": "models.Advertisement", "line_number": 12, "usage_type": "name" }, ...
27028863206
import argparse import logging import os import signal import string import subprocess import sys from unittest.mock import patch from jawanndenn import DEFAULT_MAX_POLLS, DEFAULT_MAX_VOTES_PER_POLL _log = logging.getLogger(__name__) def _require_hash_randomization(): if not sys.flags.hash_randomization: ...
hartwork/jawanndenn
jawanndenn/__main__.py
__main__.py
py
6,434
python
en
code
174
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 12, "usage_type": "call" }, { "api_name": "sys.flags", "line_number": 16, "usage_type": "attribute" }, { "api_name": "os.environ.get", "line_number": 18, "usage_type": "call" }, { "api_name": "os.environ", "lin...
2734190084
""" @project ensepro @since 12/04/2018 @author Alencar Rodrigo Hentges <alencarhentges@gmail.com> """ from ensepro.elasticsearch.queries import Query from elasticsearch import Elasticsearch from ensepro.constantes import LoggerConstantes logger = LoggerConstantes.get_logger(LoggerConstantes.MODULO_ES_CONSULTA) def ...
Ensepro/ensepro-core
ensepro/elasticsearch/searches/search.py
search.py
py
701
python
en
code
1
github-code
6
[ { "api_name": "ensepro.constantes.LoggerConstantes.get_logger", "line_number": 11, "usage_type": "call" }, { "api_name": "ensepro.constantes.LoggerConstantes", "line_number": 11, "usage_type": "name" }, { "api_name": "ensepro.constantes.LoggerConstantes.MODULO_ES_CONSULTA", "...
7477249259
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 2017/7/18 15:34 # @Author : dueb # @Site : # @File : kq.py # @Software: PyCharm import requests import time import urllib import csv from bs4 import BeautifulSoup url = "https://www.zdao.com/user/ajaxlogin" headers = { "Host": "www.zdao.com", "C...
duerbin/python
p3/zdao/src/abctest.py
abctest.py
py
8,585
python
en
code
0
github-code
6
[ { "api_name": "requests.Session", "line_number": 39, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 43, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 46, "usage_type": "call" }, { "api_name": "csv.DictWriter", "line_num...
18399294792
#!/usr/bin/env /usr/bin/python3 import gi gi.require_version('Gtk', '3.0') from gi.repository import Gtk from gi.repository import Gdk from gi.repository import GLib from gi.repository import GdkPixbuf import dbus import dbus.mainloop.glib import datetime import signal import sys import os import time import logging ...
lrusak/shairport-display
shairport-display.py
shairport-display.py
py
8,735
python
en
code
0
github-code
6
[ { "api_name": "gi.require_version", "line_number": 4, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 23, "usage_type": "call" }, { "api_name": "logging.Formatter", "line_number": 25, "usage_type": "call" }, { "api_name": "logging.StreamH...
19376128052
"""Sensor worldtides.info.""" # Python library import logging _LOGGER = logging.getLogger(__name__) import time from datetime import datetime, timedelta # HA library import homeassistant.helpers.config_validation as cv import voluptuous as vol from homeassistant.components.sensor import ( PLATFORM_SCHEMA, Se...
jugla/worldtidesinfocustom
custom_components/worldtidesinfocustom/sensor.py
sensor.py
py
49,803
python
en
code
19
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 5, "usage_type": "call" }, { "api_name": "datetime.timedelta", "line_number": 140, "usage_type": "call" }, { "api_name": "const.SCAN_INTERVAL_SECONDS", "line_number": 140, "usage_type": "name" }, { "api_name": "hom...
16629890800
from gensim.models import Word2Vec from sa_logic.models import wor2vec_model from sa_logic.support import Support from sa_root import ROOT_DIR_DATA_EMBEDDING from sklearn.model_selection import train_test_split, cross_val_score import warnings warnings.filterwarnings(action='ignore', category=UserWarning, module='gensi...
EdwinPuertas/DomainSentimentAnalysis
sa_logic/word2vec.py
word2vec.py
py
2,935
python
en
code
0
github-code
6
[ { "api_name": "warnings.filterwarnings", "line_number": 7, "usage_type": "call" }, { "api_name": "sa_logic.support.Support", "line_number": 13, "usage_type": "call" }, { "api_name": "sa_root.ROOT_DIR_DATA_EMBEDDING", "line_number": 14, "usage_type": "name" }, { "a...
32726191819
import functools class Memoizer(object): def __init__(self, memoize_mem=None): self.memoize_mem = memoize_mem or dict() def __call__(self, func , keyfunc=lambda f, a, k: (f.__name__, a, tuple(sorted(k.items())))): """ >>> memoize = Memoizer() >>> x = 10 ...
wecacuee/floyd-warshal-rl
umcog/memoize.py
memoize.py
py
3,438
python
en
code
0
github-code
6
[ { "api_name": "functools.wraps", "line_number": 26, "usage_type": "call" }, { "api_name": "functools.wraps", "line_number": 52, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 102, "usage_type": "call" }, { "api_name": "random.randint", ...
30604118002
''' Created on May 7, 2019 @author: pascal ''' import getopt, sys import os from spif import spif from settings import context from utils import usage, debug from rolewin import roleWin from PyQt5.QtWidgets import QApplication,QMainWindow, QWidget if __name__ == '__main__': currentSettings = context(os.path.ba...
pjakobi/spifManager
main.py
main.py
py
1,366
python
en
code
0
github-code
6
[ { "api_name": "settings.context", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path.basename", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path", "line_number": 17, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_n...
74372913147
from posts.models import Post from django import forms class PostForm(forms.ModelForm): class Meta: model = Post fields = ('text', 'group') label = {'text': 'Введите текст', 'group': 'Выберите группу'} help_text = {'text': 'Ваши мысли', 'group': 'Из уже существующих'}
danyamk/y_site
yatube/posts/forms.py
forms.py
py
359
python
ru
code
0
github-code
6
[ { "api_name": "django.forms.ModelForm", "line_number": 5, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 5, "usage_type": "name" }, { "api_name": "posts.models.Post", "line_number": 7, "usage_type": "name" } ]
27758445008
import requests import unittest import datetime import test_rest_resource from model.task import Task, get_task_from_json class TestTasks(test_rest_resource.TestRestResource): def setUp(self): super(TestTasks, self).setUp() self.resource_name = 'task' self.resources_uri = self.root_uri + ...
fernandezgonzalo/dose2014
implementations/group7/lets_go_project/backend_tests/test_tasks.py
test_tasks.py
py
1,711
python
en
code
0
github-code
6
[ { "api_name": "test_rest_resource.TestRestResource", "line_number": 8, "usage_type": "attribute" }, { "api_name": "model.task.Task", "line_number": 15, "usage_type": "call" }, { "api_name": "model.task.Task", "line_number": 28, "usage_type": "call" }, { "api_name"...
21748764432
#!/usr/bin/env python # -*- coding: utf-8 -*- """ live_citibike_feed requests the latest citibike feed and appends it to the postgreSQL database with historical live feed data. """ import requests import psycopg2 import os import json from dotenv import load_dotenv from datetime import datetime import time import py...
markhannel/InAPinch
src/data_collection/live_citibike_feed.py
live_citibike_feed.py
py
4,325
python
en
code
0
github-code
6
[ { "api_name": "dotenv.load_dotenv", "line_number": 20, "usage_type": "call" }, { "api_name": "os.environ.get", "line_number": 21, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 21, "usage_type": "attribute" }, { "api_name": "os.environ.get", ...
73590133949
# Filename : entry.py # Date : 2018/7/27 import json count = 0 # 载入用户数据 with open('./user_name.json', encoding='utf-8') as f: name_data = json.load(f) print(name_data) # 载入学生信息 with open('./student_info.json', encoding='utf-8') as f: info_data = json.load(f) load_name = '' # 登录账户名 user_info = [] # 账户下学...
gilgameshzzz/learn
day10Python_pygame/entry.py
entry.py
py
4,870
python
en
code
0
github-code
6
[ { "api_name": "json.load", "line_number": 10, "usage_type": "call" }, { "api_name": "json.load", "line_number": 15, "usage_type": "call" }, { "api_name": "json.dump", "line_number": 102, "usage_type": "call" } ]
29073524255
#!/usr/bin/env python # -*- coding: utf-8 -*- # pylint: disable-msg=import-error # pylint: disable=too-many-instance-attributes """ data_utils.py is writen for creating iterator and save field """ import json import logging import hazm import torch import numpy as np import pandas as pd from torchtext.legacy import d...
MaryNJ1995/Author_Attribution
src/author_attribution/utils/data_util.py
data_util.py
py
13,538
python
en
code
1
github-code
6
[ { "api_name": "author_attribution.config.config.get_config", "line_number": 28, "usage_type": "call" }, { "api_name": "logging.basicConfig", "line_number": 29, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 30, "usage_type": "attribute" }, { ...
19327073104
from collections import namedtuple StationInformation = namedtuple( 'StationInformation', [ 'country', 'city', 'wmoind' ] ) # using 6 o'clock time contains all needed data. -> otherwise some miss precipitation and other data # YYGGi IIiii iihVV Nddff 00fff 1sTTT 2sTTT 3PPPP 4PPPP 5appp 6RRRt 7wwWW 8NCCC 9GGgg # 222...
gsinekliev/FuzzyClimateModel
stations.py
stations.py
py
10,169
python
en
code
0
github-code
6
[ { "api_name": "collections.namedtuple", "line_number": 3, "usage_type": "call" } ]
71504116987
import hashlib import hmac from base64 import b64decode, b64encode from glob import glob from io import BufferedIOBase from os import unlink from os.path import exists from pbkdf2 import PBKDF2 from typing import Any, Dict, List, Optional, Tuple BASE58_ALPHABET = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstu...
jimmysong/minipy
helper.py
helper.py
py
13,863
python
en
code
1
github-code
6
[ { "api_name": "base64.b64encode", "line_number": 22, "usage_type": "call" }, { "api_name": "base64.b64decode", "line_number": 26, "usage_type": "call" }, { "api_name": "typing.List", "line_number": 31, "usage_type": "name" }, { "api_name": "typing.List", "line...
10422931001
#-*- coding: utf-8 -*- """ .. moduleauthor:: Jordi Fernández <jordi.fernandez@whads.com> """ import pickle from io import BytesIO from cocktail.pkgutils import get_full_name from cocktail.schema import Schema, Member from cocktail.persistence.persistentobject import PersistentObject def dumps(obj): src = BytesIO(...
marticongost/cocktail
cocktail/persistence/pickling.py
pickling.py
py
1,547
python
en
code
0
github-code
6
[ { "api_name": "io.BytesIO", "line_number": 13, "usage_type": "call" }, { "api_name": "pickle.Pickler", "line_number": 14, "usage_type": "call" }, { "api_name": "io.BytesIO", "line_number": 20, "usage_type": "call" }, { "api_name": "pickle.Unpickler", "line_num...
43622932630
# -*- coding: utf-8 -*- """image_handler.py - Image handler that takes care of cacheing and giving out images""" from __future__ import annotations from pathlib import Path from loguru import logger from mcomix.file_size import FileSize from mcomix.image_files import ImageFiles from mcomix.image_tools import Image...
thermitegod/mcomix-lite
mcomix/image_handler.py
image_handler.py
py
10,743
python
en
code
2
github-code
6
[ { "api_name": "mcomix.lib.metaclass.SingleInstanceMetaClass", "line_number": 22, "usage_type": "name" }, { "api_name": "mcomix.lib.events.Events", "line_number": 36, "usage_type": "call" }, { "api_name": "mcomix.lib.events.EventType.FILE_AVAILABLE", "line_number": 37, "us...
20578488114
from client_setup import create_service import base64 from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText from email.mime.base import MIMEBase from email import encoders import mimetypes import os def send_message(recipient, subject, text_message, attachments): CLIENT_SECRET_FILE = ...
Aaron8222/personal_assistant
send_email.py
send_email.py
py
2,006
python
en
code
0
github-code
6
[ { "api_name": "client_setup.create_service", "line_number": 16, "usage_type": "call" }, { "api_name": "email.mime.multipart.MIMEMultipart", "line_number": 19, "usage_type": "call" }, { "api_name": "email.mime.text.MIMEText", "line_number": 22, "usage_type": "call" }, ...
8026630580
import torch import torch.nn as nn import torch.nn.functional as F import math import argparse import numpy as np import sys,os sys.path.append(os.path.dirname(__file__) + os.sep + '../') from easydict import EasyDict from torchvision import models from .backbone import Decoder from .aspp import ASPP CHANNEL_EXPAND ...
nku-zhichengzhang/MPOT
libs/models/models.py
models.py
py
13,902
python
en
code
13
github-code
6
[ { "api_name": "sys.path.append", "line_number": 9, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "line_number...
5148212284
import struct from io import BytesIO import warnings import attr from .pe_info import ( IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ, DATA_DIRECTORY_IMPORT_TABLE, DATA_DIRECTORY_CERTIFICATE_TABLE, DATA_DIRECTORY_DELAY_IMPORT_DESCRIPTOR, COFF_HEADER, OPTIONAL_HEADER_32, OPTIONAL_HEADER_64,...
njsmith/machomachomangler
machomachomangler/pe.py
pe.py
py
15,958
python
en
code
43
github-code
6
[ { "api_name": "struct.unpack_from", "line_number": 80, "usage_type": "call" }, { "api_name": "pe_info.COFF_HEADER.view", "line_number": 83, "usage_type": "call" }, { "api_name": "pe_info.COFF_HEADER", "line_number": 83, "usage_type": "name" }, { "api_name": "pe_in...
23067835631
import argparse import yaml import os import time import requests from exceptions import LrException import network.terraform as tf import network.config EPILOG = """ Wait for all nodes of the network to be on the same block. This is useful for waiting to start a simulation until after the network has settled down a...
lntdev/raft_22Oct
sawtooth-ci/longrun/lrmgr/network/wait.py
wait.py
py
1,331
python
en
code
0
github-code
6
[ { "api_name": "network.terraform.config.load", "line_number": 28, "usage_type": "call" }, { "api_name": "network.terraform.config", "line_number": 28, "usage_type": "attribute" }, { "api_name": "network.terraform", "line_number": 28, "usage_type": "name" }, { "api...
38678672236
from __future__ import absolute_import from __future__ import division from __future__ import print_function import tensorflow as tf from ray.rllib.models.misc import linear, normc_initializer from ray.rllib.a3c.tfpolicy import TFPolicy from ray.rllib.models.catalog import ModelCatalog class SharedModel(TFPolicy): ...
ray-project/sandbox
python/ray/rllib/a3c/shared_model.py
shared_model.py
py
2,430
python
en
code
4
github-code
6
[ { "api_name": "ray.rllib.a3c.tfpolicy.TFPolicy", "line_number": 11, "usage_type": "name" }, { "api_name": "tensorflow.placeholder", "line_number": 21, "usage_type": "call" }, { "api_name": "tensorflow.float32", "line_number": 21, "usage_type": "attribute" }, { "ap...
43975136980
# -*- coding: utf-8 -*- import json import uuid from contextlib import contextmanager from datetime import datetime import mock from pyramid import testing from cliquet import initialization from cliquet.events import ResourceChanged, ResourceRead, ACTIONS from cliquet.listeners import ListenerBase from cliquet.stora...
mozilla-services/cliquet
cliquet/tests/test_listeners.py
test_listeners.py
py
7,171
python
en
code
65
github-code
6
[ { "api_name": "cliquet.tests.support.unittest.TestCase", "line_number": 17, "usage_type": "attribute" }, { "api_name": "cliquet.tests.support.unittest", "line_number": 17, "usage_type": "name" }, { "api_name": "mock.patch", "line_number": 19, "usage_type": "call" }, {...
71477019708
import sys from collections import deque input = sys.stdin.readline def path(x): answer = [] answer.append(x) while x != n: x = move[x] answer.append(x) print(*answer[::-1]) def BFS(now): q = deque() q.append(now) while q: x = q.popleft() if x == k: ...
YOONJAHYUN/Python
BOJ/13913.py
13913.py
py
703
python
en
code
2
github-code
6
[ { "api_name": "sys.stdin", "line_number": 3, "usage_type": "attribute" }, { "api_name": "collections.deque", "line_number": 17, "usage_type": "call" } ]
41550432784
import itertools, weakref from .. colors import make from .. util import color_list, log class Pixels: """ Wrap pixels attached to a layout for easy access and better error reporting. """ def __init__(self, builder): self.builder = weakref.ref(builder) def __getitem__(self, index): ...
ManiacalLabs/BiblioPixel
bibliopixel/builder/pixels.py
pixels.py
py
1,902
python
en
code
263
github-code
6
[ { "api_name": "weakref.ref", "line_number": 12, "usage_type": "call" }, { "api_name": "colors.make.color", "line_number": 29, "usage_type": "call" }, { "api_name": "colors.make", "line_number": 29, "usage_type": "name" }, { "api_name": "util.log.error", "line_...
8560619861
#!/usr/bin/env -S python3 -i # ruff: noqa: D103, F401 """Experimenting and Messy Code.""" __author__ = "Leona Gottfried" __version__ = "0.1.0" __license__ = "MIT" import logging import re from collections import Counter from collections.abc import Callable, Iterable from string import ascii_letters import rich from...
leogott/document-clustering
main.py
main.py
py
3,748
python
en
code
null
github-code
6
[ { "api_name": "logging.basicConfig", "line_number": 22, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 22, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 23, "usage_type": "call" }, { "api_name": "collections....
2511745975
import sys import asyncio import aiohttp from aiohttp.client_exceptions import InvalidURL import re # Получить веб-страницу (текстовая информация) async def fetch(session, url): try: async with session.get(url) as response: data = await response.text(encoding='utf-8') s...
svetlana-akb/matrix_from_web
main.py
main.py
py
2,618
python
en
code
0
github-code
6
[ { "api_name": "re.match", "line_number": 15, "usage_type": "call" }, { "api_name": "aiohttp.client_exceptions.InvalidURL", "line_number": 21, "usage_type": "name" }, { "api_name": "aiohttp.ClientSession", "line_number": 65, "usage_type": "call" }, { "api_name": "s...
21141311322
from collections import Counter from functools import wraps import pandas as pd from lucky.apps import backends def valid(d): def wrap(func): @wraps(func) def _wrap(*args, **kwargs): for key, value in d.items(): if key in kwargs: if kwargs[key] no...
onecans/my
mystockservice/lucky/apps/k/query.py
query.py
py
9,403
python
en
code
2
github-code
6
[ { "api_name": "functools.wraps", "line_number": 12, "usage_type": "call" }, { "api_name": "functools.wraps", "line_number": 28, "usage_type": "call" }, { "api_name": "functools.wraps", "line_number": 44, "usage_type": "call" }, { "api_name": "pandas.date_range", ...
40093827373
from django.conf.urls import patterns, include, url from . import views urlpatterns = [ url(r'^$', views.index), url(r'^login/$', views.login), url(r'^logout/$', views.logout), url(r'^project/(?P<pid>[0-9]+)/$', views.projectPosts), url(r'^developer/(?P<did>[0-9]+)/$', views.developerProfile), ...
tehsmeely/devBlag
devBlag/urls.py
urls.py
py
1,238
python
en
code
1
github-code
6
[ { "api_name": "django.conf.urls.url", "line_number": 6, "usage_type": "call" }, { "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.co...
9271022007
# Get statistics of homograph distribution in LibriSpeech data and their Festival prons import pickle from collections import defaultdict import csv import pandas as pd from matplotlib_venn import venn3 from matplotlib import pyplot as plt def get_homograph_dist(WHD_df, src_fn, tgt_fn): with open(src_fn, "r") as ...
eilishnewmark/msc_diss
libri_analysis.py
libri_analysis.py
py
9,053
python
en
code
0
github-code
6
[ { "api_name": "pickle.load", "line_number": 18, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 23, "usage_type": "call" }, { "api_name": "matplotlib_venn.venn3", "line_number": 162, "usage_type": "call" }, { "api_name": "matplotlib...
11638445163
""" index """ from flask import jsonify from api.v1.views import app_views @app_views.route("/status", methods=['GET'], strict_slashes=False) def status(): """ status route :return: response with json """ data = { "status": "OK" } resp = jsonify(data) resp.status_code = 200 ...
glyif/gift-card
api/v1/views/index.py
index.py
py
336
python
en
code
0
github-code
6
[ { "api_name": "flask.jsonify", "line_number": 19, "usage_type": "call" }, { "api_name": "api.v1.views.app_views.route", "line_number": 9, "usage_type": "call" }, { "api_name": "api.v1.views.app_views", "line_number": 9, "usage_type": "name" } ]
22938532604
import line_profiler profile=line_profiler.LineProfiler() import atexit atexit.register(profile.print_stats) import numpy as np import cv2 #from openvino.inference_engine import IENetwork from openvino.inference_engine import IECore import argparse def preprocess_frame(image_input_shape): image=cv2.imread('images/...
SamyTahar/Computer-Pointer-Controller
src/metrics.py
metrics.py
py
1,373
python
en
code
0
github-code
6
[ { "api_name": "line_profiler.LineProfiler", "line_number": 2, "usage_type": "call" }, { "api_name": "atexit.register", "line_number": 4, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 12, "usage_type": "call" }, { "api_name": "cv2.resize", ...
17891253319
import torch.nn INTERESTING_STATES_COUNT = 4 HORIZONTAL_KERNELS_COUNT = 5 * 2 VERTICAL_KERNELS_COUNT = 5 * 2 DIAGONAL_KERNELS_COUNT = 5 * 4 class LinearValue(torch.nn.Module): def __init__(self, field_h, field_w): super(LinearValue, self).__init__() self.name = 'Linear model for game value on ...
nkorobkov/virus-game
rl/model/LinearValue.py
LinearValue.py
py
1,848
python
en
code
1
github-code
6
[ { "api_name": "torch.nn.nn", "line_number": 10, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 10, "usage_type": "name" }, { "api_name": "torch.nn.nn.Linear", "line_number": 27, "usage_type": "call" }, { "api_name": "torch.nn.nn", "line_...
1835146416
# -*- coding: utf-8 -*- """ Created on Thu Jan 27 10:59:19 2022 @author: 86186 """ import numpy as np import torch data=np.array([1,2,3]) t1=torch.Tensor(data) t2=torch.tensor(data,dtype=torch.float64) t3=torch.as_tensor(data) t4=torch.from_numpy(data) data[0]=0 data[1]=0 data[2]=0 print(t1) #copy一个data作为数据来源 print(t...
guorruizhhang/Pytorch-learning
tensor/test01.py
test01.py
py
435
python
en
code
0
github-code
6
[ { "api_name": "numpy.array", "line_number": 10, "usage_type": "call" }, { "api_name": "torch.Tensor", "line_number": 11, "usage_type": "call" }, { "api_name": "torch.tensor", "line_number": 12, "usage_type": "call" }, { "api_name": "torch.float64", "line_numbe...
37377562206
from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import sys import cv2 import random import signal import time import json import gym import atexit import subprocess import traceback import numpy as np from collections import deque from datetime impo...
fangchuan/carla-DRL
environment/carla_gym/envs/carla_env.py
carla_env.py
py
32,142
python
en
code
0
github-code
6
[ { "api_name": "os.environ.get", "line_number": 23, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 23, "usage_type": "attribute" }, { "api_name": "os.path.expanduser", "line_number": 23, "usage_type": "call" }, { "api_name": "os.path", "line...
72826331068
from setuptools import setup from torch.utils.cpp_extension import CppExtension, BuildExtension import os openfst_path = "../openfst" if "OPENFST_PATH" in os.environ: openfst_path = os.environ["OPENFST_PATH"] if not os.path.exists(os.path.join(openfst_path, "lib", "libfst.so")): raise SystemExit("Could not f...
YiwenShaoStephen/pychain
openfst_binding/setup.py
setup.py
py
930
python
en
code
215
github-code
6
[ { "api_name": "os.environ", "line_number": 7, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 8, "usage_type": "attribute" }, { "api_name": "os.path.exists", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path", "line_numb...
21717052133
import sys import os sys.path.append(os.getcwd()) import numpy as np import torch import config from src.dataset.dataloader import make_dataset, img_to_tensor from src.model.loss import * from src.util.printer import DecayVarPrinter from tqdm import tqdm import skimage.io as io from src.faceutil import mesh class Bas...
lhyfst/DSFNet
src/run/predict.py
predict.py
py
3,605
python
en
code
39
github-code
6
[ { "api_name": "sys.path.append", "line_number": 3, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 3, "usage_type": "attribute" }, { "api_name": "os.getcwd", "line_number": 3, "usage_type": "call" }, { "api_name": "src.model.DSFNet.get_model", ...
43589988205
#!/usr/bin/env python # coding: utf-8 # # TSF TASK-2 # Perform ‘Exploratory Data Analysis’ on the provided dataset ‘SampleSuperstore’ # In[20]: # importing required packages import pandas as pd import pandas_profiling import numpy as np import matplotlib.pyplot as plt import seaborn as sns import scipy.stats as st...
sanjaynair20/TSF-task
Superstore.py
Superstore.py
py
4,449
python
en
code
1
github-code
6
[ { "api_name": "pandas.read_csv", "line_number": 23, "usage_type": "call" }, { "api_name": "pandas_profiling.ProfileReport", "line_number": 88, "usage_type": "call" }, { "api_name": "seaborn.heatmap", "line_number": 129, "usage_type": "call" }, { "api_name": "seabo...
20992831387
from Data.id_pattern import IdPattern import clingo from Data.pattern_type import PatternType from collections import defaultdict from typing import Dict, List, Tuple from Miner.type import Type from Data.pattern import Pattern import time from abc import ABC, abstractmethod class CleanupBase(ABC): def __init__(s...
optzGuitar/music_analysis
Miner/Cleanup/cleanup_base.py
cleanup_base.py
py
2,483
python
en
code
2
github-code
6
[ { "api_name": "abc.ABC", "line_number": 12, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 13, "usage_type": "name" }, { "api_name": "Data.pattern.Pattern", "line_number": 13, "usage_type": "name" }, { "api_name": "Data.pattern_type.PatternTyp...
36521147021
# -*- coding: utf-8 -*- """ Created on Tue Sep 02 21:18:17 2014 @author: Andreas """ import numpy as np import gdal from osgeo import osr class NDVI(): def __init__(self, inFile, outFile, bandRed, bandIR): self.infile = str(inFile) self.outfile = str(outFile) self.band_red ...
AndyLoewe/CityEx
modul/module_ndvi.py
module_ndvi.py
py
3,151
python
en
code
0
github-code
6
[ { "api_name": "gdal.Open", "line_number": 21, "usage_type": "call" }, { "api_name": "gdal.GA_ReadOnly", "line_number": 21, "usage_type": "attribute" }, { "api_name": "gdal.GDT_Float32", "line_number": 29, "usage_type": "attribute" }, { "api_name": "osgeo.osr.Spati...
12298377592
import os from collections import deque from PySide2 import QtCore, QtGui, QtWidgets from PySide2.QtCore import Signal, Slot import Application.Settings import Application.Utils.FileOperations from Application.Models.MainWindowModel import MainWindowModel from Application.Views.MainWindowView import MainWindowView fr...
unitbvcv/image_processing_platform
Application/Presenters/MainWindowPresenter.py
MainWindowPresenter.py
py
9,770
python
en
code
1
github-code
6
[ { "api_name": "PySide2.QtCore.QObject", "line_number": 14, "usage_type": "attribute" }, { "api_name": "PySide2.QtCore", "line_number": 14, "usage_type": "name" }, { "api_name": "PySide2.QtCore.Signal", "line_number": 15, "usage_type": "call" }, { "api_name": "PySi...