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
26606119063
#!/usr/bin/env python # coding: utf-8 # # Import Library # In[387]: import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns from glob import glob from sklearn.metrics import mean_absolute_error from sklearn.linear_model import LinearRegression from sklearn.linear_model import L...
tamerelateeq/Titanc
titank.py
titank.py
py
8,173
python
en
code
0
github-code
6
[ { "api_name": "pandas.read_csv", "line_number": 34, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 45, "usage_type": "call" }, { "api_name": "pandas_profiling.ProfileReport", "line_number": 101, "usage_type": "call" }, { "api_name": "matpl...
36060029870
import numpy as np import torch import torch.nn as nn import torch.nn.functional as F device = torch.device('cuda' if torch.cuda.is_available() else 'cpu') class LocalizationNetwork(nn.Module): def __init__(self, numOfControlPoints=10): super().__init__() self.numOfControlPoints = numOfControlPoi...
xpiste05/knn_projekt
models/localizationNetwork.py
localizationNetwork.py
py
1,925
python
en
code
0
github-code
6
[ { "api_name": "torch.device", "line_number": 6, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", "line_number": 6, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 6, "usage_type": "attribute" }, { "api_name": "torch.nn.Module", ...
32841420589
import pandas as pd import numpy as np import pickle as pkl import matplotlib.pyplot as plt import re import jieba import subprocess from gensim.test.utils import get_tmpfile, common_texts from gensim.models import Word2Vec, KeyedVectors from sklearn.metrics.pairwise import cosine_similarity from sklearn.manifold impo...
kartd0094775/IdentifyKOL
util/preprocessing.py
preprocessing.py
py
1,846
python
en
code
0
github-code
6
[ { "api_name": "jieba.load_userdict", "line_number": 16, "usage_type": "call" }, { "api_name": "pickle.load", "line_number": 20, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 40, "usage_type": "call" }, { "api_name": "re.compile", "line_num...
19617294623
# _*_ coding: utf-8 _*_ import os import csv import time import json import logging import numpy as np import tensorflow as tf from sklearn.metrics import auc, roc_curve # calculate_auc : calculate AUC rate def calculate_auc(labels, predicts): fpr, tpr, _ = roc_curve(labels, predicts, pos_label=1) AUC = auc(f...
wangcong15/go-clone
Go-CloneF/src/tfrecord2test.py
tfrecord2test.py
py
15,894
python
en
code
5
github-code
6
[ { "api_name": "sklearn.metrics.roc_curve", "line_number": 14, "usage_type": "call" }, { "api_name": "sklearn.metrics.auc", "line_number": 15, "usage_type": "call" }, { "api_name": "tensorflow.to_float", "line_number": 19, "usage_type": "call" }, { "api_name": "ten...
6575851777
from time import sleep from digitemp.master import UART_Adapter from digitemp.device import DS18B20 import random import asyncio import logging class TemperatureMonitor: def __init__(self): self.bus = UART_Adapter('/dev/ttyUSB0') self.sensor = DS18B20(self.bus) self.listeners = [] def...
SchrodingersCat00/vuurwachter
src/temp_monitor.py
temp_monitor.py
py
1,091
python
en
code
0
github-code
6
[ { "api_name": "digitemp.master.UART_Adapter", "line_number": 11, "usage_type": "call" }, { "api_name": "digitemp.device.DS18B20", "line_number": 12, "usage_type": "call" }, { "api_name": "logging.info", "line_number": 28, "usage_type": "call" }, { "api_name": "asy...
18164640711
import pickle import nltk from nltk.corpus import stopwords from nltk.stem import WordNetLemmatizer # Download NLTK data (you only need to do this once) nltk.download('stopwords') nltk.download('wordnet') # Load the trained model and vectorizer with open('check_spam_classifier.pkl', 'rb') as clf_file: ...
GOVINDFROMINDIA/Twitter-Scam-Victims
dsg.py
dsg.py
py
1,596
python
en
code
0
github-code
6
[ { "api_name": "nltk.download", "line_number": 7, "usage_type": "call" }, { "api_name": "nltk.download", "line_number": 8, "usage_type": "call" }, { "api_name": "pickle.load", "line_number": 12, "usage_type": "call" }, { "api_name": "pickle.load", "line_number"...
39729133373
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('store', '0010_auto_20151113_1608'), ] operations = [ migrations.AddField( model_name='review', name=...
midnitehighways/shop
store/migrations/0011_review_author.py
0011_review_author.py
py
420
python
en
code
0
github-code
6
[ { "api_name": "django.db.migrations.Migration", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 7, "usage_type": "name" }, { "api_name": "django.db.migrations.AddField", "line_number": 14, "usage_type": "call" }, { ...
36867613594
from datetime import datetime from sqlalchemy import Column, TIMESTAMP class TimestampsMixin: __abstract__ = True __created_at_name__ = 'created_at' __updated_at_name__ = 'updated_at' __datetime_func__ = datetime.now() created_at = Column( __created_at_name__, TIMESTAMP(timezone=...
siarie/fastapi-start
app/db/mixins.py
mixins.py
py
581
python
en
code
0
github-code
6
[ { "api_name": "datetime.datetime.now", "line_number": 10, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 10, "usage_type": "name" }, { "api_name": "sqlalchemy.Column", "line_number": 12, "usage_type": "call" }, { "api_name": "sqlalchemy....
14555529648
from time import sleep import btc import click from core import BitcoinTwitterProfile import schedule @click.group() def bitc0in_twitter(): """ Syncs your twitter profile with bitcoin's volatility. """ @bitc0in_twitter.command() def run(): """Start Program""" bitcoin_percent_change = btc.get...
dgnsrekt/bitc0in-twitter
bitc0in_twitter/cli.py
cli.py
py
1,335
python
en
code
1
github-code
6
[ { "api_name": "click.group", "line_number": 12, "usage_type": "call" }, { "api_name": "btc.get_percent_change", "line_number": 22, "usage_type": "call" }, { "api_name": "core.BitcoinTwitterProfile", "line_number": 23, "usage_type": "call" }, { "api_name": "btc.get...
6401924379
# version: python 3.7 # zID: z5052292 from socket import * from datetime import datetime import time import sys serverIP = sys.argv[1] serverPort = int(sys.argv[2]) clientSocket = socket(AF_INET, SOCK_DGRAM) list_rtts = [] packets_lost = 0 for i in range(10): time_stamp = datetime.now().isoformat(s...
YuanG1944/COMP9331-Computer-Networks-and-Applications
Lab2/PingClient_zhou.py
PingClient_zhou.py
py
1,235
python
en
code
4
github-code
6
[ { "api_name": "sys.argv", "line_number": 10, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 11, "usage_type": "attribute" }, { "api_name": "datetime.datetime.now", "line_number": 17, "usage_type": "call" }, { "api_name": "datetime.datetime",...
10426011052
"""Conceptual model page.""" from django.db import models from wagtail.core.models import Page from wagtail.core.fields import RichTextField from wagtail.admin.edit_handlers import FieldPanel from wagtail.images.edit_handlers import ImageChooserPanel class CMPage(Page): template = "ecos_cm/cm_page.html" E...
CNR-ISMAR/ecoads
ecos_cm/models.py
models.py
py
1,600
python
en
code
0
github-code
6
[ { "api_name": "wagtail.core.models.Page", "line_number": 10, "usage_type": "name" }, { "api_name": "django.db.models.CharField", "line_number": 22, "usage_type": "call" }, { "api_name": "django.db.models", "line_number": 22, "usage_type": "name" }, { "api_name": "...
34600680585
import numpy as np import matplotlib.pyplot as plt def sigmoid(Z): """sigmoid Arguments: Z {[np.array]} -- [Wx + b] Returns: A - [np.array] -- [1 / 1+exp(- Wx + b)] cache - Z """ A = 1/(1+np.exp(-Z)) cache = Z return A, cache def relu(Z): """rectified linear unit Arguments: Z {[np.array]} --...
anantsrivastava30/deeplearning
dnn_utils.py
dnn_utils.py
py
1,924
python
en
code
2
github-code
6
[ { "api_name": "numpy.exp", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.maximum", "line_number": 29, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 49, "usage_type": "call" }, { "api_name": "numpy.exp", "line_number": 72...
38030500642
import numpy as np import matplotlib.pyplot as plt from tqdm.auto import tqdm """ Reads Siemens rawdata file and returns the DICOs values Author: Ali Aghaeifar <ali.aghaeifar@tuebingen.mpg.de> """ def read_dico(twixObj): mdb_vop = [mdb for mdb in twixObj[-1]['mdb'] if mdb.is_flag_set('MDH_VOP')] # concatenate...
aghaeifar-publications/RFPA_drift
dico_tools.py
dico_tools.py
py
2,283
python
en
code
0
github-code
6
[ { "api_name": "tqdm.auto.tqdm", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.concatenate", "line_number": 18, "usage_type": "call" }, { "api_name": "tqdm.auto.tqdm", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.stack", "li...
29282262756
# -*- coding: utf-8 -*- import ispformat.schema as _schema from jsonschema import Draft4Validator, RefResolver, draft4_format_checker from jsonschema.exceptions import RefResolutionError, ValidationError from urlparse import urlsplit class MyRefResolver(RefResolver): def resolve_remote(self, uri): # Prev...
Psycojoker/isp-format
ispformat/validator/schemavalidator.py
schemavalidator.py
py
4,121
python
en
code
0
github-code
6
[ { "api_name": "jsonschema.RefResolver", "line_number": 9, "usage_type": "name" }, { "api_name": "jsonschema.exceptions.RefResolutionError", "line_number": 12, "usage_type": "call" }, { "api_name": "ispformat.schema.load_schema", "line_number": 31, "usage_type": "call" }...
41237359815
import os, sys import multiprocessing as mp def pipeline(config, genome, protocol, cells, minreads, name, fq1, fq2, dir, top_million_reads, step, parallel): """ Run the Data Processing Pipeline... #. Stats and count the barcode from pair-end 1 sequences; #. Read the barcode counts files; ...
beiseq/baseqDrops
package/baseqDrops/pipeline.py
pipeline.py
py
6,329
python
en
code
13
github-code
6
[ { "api_name": "os.path.exists", "line_number": 65, "usage_type": "call" }, { "api_name": "os.path", "line_number": 65, "usage_type": "attribute" }, { "api_name": "sys.exit", "line_number": 66, "usage_type": "call" }, { "api_name": "os.environ", "line_number": ...
31036723867
''' Source code modified from https://github.com/budzianowski/PyTorch-Beam-Search-Decoding/blob/master/decode_beam.py implementation of beam search on GPT-2's logits ''' import operator import torch import torch.nn as nn import torch.nn.functional as F from queue import PriorityQueue import sys class BeamSearchNode(...
HKUST-KnowComp/GEIA
decode_beam_search.py
decode_beam_search.py
py
6,377
python
en
code
22
github-code
6
[ { "api_name": "torch.unsqueeze", "line_number": 61, "usage_type": "call" }, { "api_name": "torch.unsqueeze", "line_number": 62, "usage_type": "call" }, { "api_name": "torch.tensor", "line_number": 74, "usage_type": "call" }, { "api_name": "queue.PriorityQueue", ...
50277551
from typing import * # ref https://leetcode.cn/problems/naming-a-company/solution/by-endlesscheng-ruz8/ from collections import defaultdict class Solution: def distinctNames(self, ideas: List[str]) -> int: group = defaultdict(int) for s in ideas: group[s[1:]] |= 1 << (ord(s[0]) - ord...
code-cp/leetcode
solutions/6094/main.py
main.py
py
1,093
python
en
code
0
github-code
6
[ { "api_name": "collections.defaultdict", "line_number": 7, "usage_type": "call" } ]
74492815226
"""Wrapper a los proceso de scrapping """ import tempfile import os from selenium import webdriver from selenium.webdriver.chrome.options import Options from selenium.webdriver.common.desired_capabilities import DesiredCapabilities # pylint: disable=unused-import from scrapper.procesos.patentes_inpi_novedades import...
pmoracho/scrapper-2
scrapper/scrapping.py
scrapping.py
py
3,958
python
en
code
0
github-code
6
[ { "api_name": "selenium.webdriver.chrome.options.Options", "line_number": 28, "usage_type": "call" }, { "api_name": "selenium.webdriver.common.desired_capabilities.DesiredCapabilities", "line_number": 43, "usage_type": "call" }, { "api_name": "selenium.webdriver.Chrome", "lin...
21669508962
import requests from common.log import GetLogger log = GetLogger().get_logger() class BaseRequest(): def __init__(self): pass def get(self,url,params=None,**kwargs): try: response=requests.get(url,params=params,**kwargs) log.info("==========接口API请求开始===========") ...
menghuai1995/PythonAutoCode
API_Autotest/common/baseRequest.py
baseRequest.py
py
1,787
python
en
code
0
github-code
6
[ { "api_name": "common.log.GetLogger", "line_number": 4, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 12, "usage_type": "call" }, { "api_name": "requests.post", "line_number": 23, "usage_type": "call" } ]
10775113939
import re import os from collections import Counter, defaultdict, namedtuple from itertools import combinations, product from pprint import pprint from parse import parse, findall from math import prod, sqrt dirname = os.path.dirname(__file__) data = open(f'{dirname}/21-input.txt').read().splitlines() data = [parse('{}...
knjmooney/Advent-Of-Code
2020/21-allergens.py
21-allergens.py
py
1,513
python
en
code
0
github-code
6
[ { "api_name": "os.path.dirname", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "parse.parse", "line_number": 10, "usage_type": "call" } ]
37111986575
#얘는 계속 실행이 되어야 해서, jupyter notebook에서는 안된다. #이걸 하는 목적 : dialog flow로부터 데이터를 받아, 여기서 처리한 후 다시 dialog flow로 반환 #그걸 위해서는 json으로 리턴해야 한다. import requests import urllib import IPython.display as ipd import json from bs4 import BeautifulSoup from flask import Flask, request, jsonify def getWeather(city) : url = "ht...
ssh6189/2020.02.05
server.py
server.py
py
3,365
python
ko
code
0
github-code
6
[ { "api_name": "urllib.parse.quote_plus", "line_number": 14, "usage_type": "call" }, { "api_name": "urllib.parse", "line_number": 14, "usage_type": "attribute" }, { "api_name": "bs4.BeautifulSoup", "line_number": 16, "usage_type": "call" }, { "api_name": "urllib.re...
41794735960
import datetime import unittest from pyspark import SparkConf from pyspark.sql import SparkSession import pyspark.sql.functions as f from pyspark.sql.types import StructType, StructField, IntegerType, StringType, MapType, ArrayType import json import csv from src.transformations import add_columns, running_total, gro...
SA01/spark-unittest-tutorial
tests/test_transformations.py
test_transformations.py
py
13,745
python
en
code
0
github-code
6
[ { "api_name": "unittest.TestCase", "line_number": 16, "usage_type": "attribute" }, { "api_name": "pyspark.SparkConf", "line_number": 19, "usage_type": "call" }, { "api_name": "pyspark.sql.SparkSession.builder.master", "line_number": 21, "usage_type": "call" }, { "...
71176383548
import boto3, datetime, time region = 'us-west-2' accesskey = os.environ['ACCESSKEY'] secretkey = os.environ['SECRET_ACCESSKEY'] def send_firehose(message: str): client = boto3.client('firehose', aws_access_key_id=accesskey, aws_secret_access_key=secretkey, region_name=region) # Send message to firehose respo...
kfunamizu/python_commonlib
firehose/src/firehose.py
firehose.py
py
479
python
en
code
0
github-code
6
[ { "api_name": "boto3.client", "line_number": 9, "usage_type": "call" } ]
12064640805
""" A Module for Encrypt and Decrypt message """ import ReadWriteFileManagement # Import the Fernet module from cryptography.fernet import Fernet DATABASE_DIR_PATH = "../../databases/chat_db/" FILE_NAME = "encryptKey.key" """ A function for generating an encryption key. the function generate the using Fernet class,...
RoyYotam/My-Chat
src/help classes/EncryptMessage.py
EncryptMessage.py
py
2,030
python
en
code
0
github-code
6
[ { "api_name": "cryptography.fernet.Fernet.generate_key", "line_number": 21, "usage_type": "call" }, { "api_name": "cryptography.fernet.Fernet", "line_number": 21, "usage_type": "name" }, { "api_name": "ReadWriteFileManagement.create_chat_file", "line_number": 23, "usage_t...
31973217705
"""filename and file size in file model Revision ID: 6d23296b922b Revises: 6ec29c8de008 Create Date: 2023-03-02 17:47:25.025321 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '6d23296b922b' down_revision = '6ec29c8de008' branch_labels = None depends_on = None ...
synzr/file-transfer-service
migrations/versions/6d23296b922b_filename_and_file_size_in_file_model.py
6d23296b922b_filename_and_file_size_in_file_model.py
py
952
python
en
code
0
github-code
6
[ { "api_name": "alembic.op.batch_alter_table", "line_number": 21, "usage_type": "call" }, { "api_name": "alembic.op", "line_number": 21, "usage_type": "name" }, { "api_name": "sqlalchemy.Column", "line_number": 22, "usage_type": "call" }, { "api_name": "sqlalchemy....
2931948188
from typing import Dict from network.api.base import BaseRepository import re from http.cookies import SimpleCookie import dukpy import requests import http.client from network.api.base_mainpage_cookies_loader import BaseMainPageCookiesLoader IPP_JS_PATH = 'resources/ipp.js' class PagesRepository(BaseRepository, Bas...
Emperator122/dns-shop_price_comparator
network/api/pages.py
pages.py
py
2,270
python
en
code
0
github-code
6
[ { "api_name": "network.api.base.BaseRepository", "line_number": 13, "usage_type": "name" }, { "api_name": "network.api.base_mainpage_cookies_loader.BaseMainPageCookiesLoader", "line_number": 13, "usage_type": "name" }, { "api_name": "typing.Dict", "line_number": 14, "usag...
20794460102
import numpy as np import matplotlib.pyplot as plt x = []; y = [] for i in range(100): x.append(np.sin(np.pi/48*i)) y.append(2-2*np.cos(np.pi/48*i)) plt.plot(x, y) plt.show()
duynamrcv/mpc_ros
test.py
test.py
py
185
python
en
code
1
github-code
6
[ { "api_name": "numpy.sin", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.pi", "line_number": 6, "usage_type": "attribute" }, { "api_name": "numpy.cos", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.pi", "line_number": 7, "...
12701288482
from collections import deque import sys d = deque() n = int(sys.stdin.readline().rstrip()) for i in range(n): order = sys.stdin.readline().rstrip().split() a = order[0] if a == "push": d.append(order[1]) elif a == "pop": if d: print(d.popleft()) else: p...
MinChoi0129/Algorithm_Problems
BOJ_Problems/18258.py
18258.py
py
647
python
en
code
2
github-code
6
[ { "api_name": "collections.deque", "line_number": 4, "usage_type": "call" }, { "api_name": "sys.stdin.readline", "line_number": 5, "usage_type": "call" }, { "api_name": "sys.stdin", "line_number": 5, "usage_type": "attribute" }, { "api_name": "sys.stdin.readline",...
73886255546
import psycopg2 import os import http.server import socketserver import logging import sys class IndexHandler(http.server.SimpleHTTPRequestHandler): def do_GET(self): self.path = 'index.html' return http.server.SimpleHTTPRequestHandler.do_GET(self) print("start app") app_port = os.environ.get("A...
hed854/tp3-kubernetes
frontend/app.py
app.py
py
978
python
en
code
0
github-code
6
[ { "api_name": "http.server.server", "line_number": 9, "usage_type": "attribute" }, { "api_name": "http.server", "line_number": 9, "usage_type": "name" }, { "api_name": "http.server.server.SimpleHTTPRequestHandler.do_GET", "line_number": 12, "usage_type": "call" }, { ...
73510645947
from collections import defaultdict N = int(input()) for i in range(N): forwared = defaultdict(int) reverse = defaultdict(int) m,n= map(int,input().split()) nums = [] ans = 0 for i in range(m): temp = list(map(int,input().split())) nums.append(temp) for i in range(m): ...
yonaSisay/a2sv-competitive-programming
xsum.py
xsum.py
py
627
python
en
code
0
github-code
6
[ { "api_name": "collections.defaultdict", "line_number": 4, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 5, "usage_type": "call" } ]
2046128502
import os import sys RASE_DIR = os.path.dirname(os.path.abspath(__file__)) sys.path.append(RASE_DIR) import time import threading from verify import Verify from scrapy import cmdline from multiprocessing import Process from Bearcat_ProxyPool.settings import SPIDER_TIME curPath = os.path.abspath(os.path.dirname(__file...
yuzhiyizhan/Bearcat_ProxyPool
main.py
main.py
py
1,261
python
en
code
2
github-code
6
[ { "api_name": "os.path.dirname", "line_number": 4, "usage_type": "call" }, { "api_name": "os.path", "line_number": 4, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 4, "usage_type": "call" }, { "api_name": "sys.path.append", "line...
8454082456
from uuid import uuid4 from sqlalchemy import text from critique_wheel.adapters.sqlalchemy import iam_repository from critique_wheel.critiques.models.critique import Critique from critique_wheel.members.models.IAM import MemberStatus from critique_wheel.members.value_objects import MemberId from critique_wheel.works....
davidjnevin/ddd_critiquewheel
critique_wheel/tests/integration/test_IAM_repository.py
test_IAM_repository.py
py
4,132
python
en
code
1
github-code
6
[ { "api_name": "critique_wheel.members.value_objects.MemberId", "line_number": 17, "usage_type": "call" }, { "api_name": "critique_wheel.adapters.sqlalchemy.iam_repository.SqlAlchemyMemberRepository", "line_number": 18, "usage_type": "call" }, { "api_name": "critique_wheel.adapter...
18525593045
import argparse import os import mmcv import torch from mmcv.runner import get_dist_info, init_dist, load_checkpoint from drp.apis import set_random_seed, single_gpu_test from drp.datasets import build_dataloader, build_dataset from drp.models import build_model from drp.datasets.pipelines.utils import get_weight ...
yivan-WYYGDSG/AGMI
tools/test.py
test.py
py
3,775
python
en
code
1
github-code
6
[ { "api_name": "argparse.ArgumentParser", "line_number": 17, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 43, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 44, "usage_type": "attribute" }, { "api_name": "mmcv.Config.f...
26986918036
# -*- coding: utf-8 -*- import base64 import pytest from nameko_grpc.headers import ( HeaderManager, check_decoded, check_encoded, comma_join, decode_header, encode_header, filter_headers_for_application, sort_headers_for_wire, ) class TestEncodeHeader: def test_binary(self): ...
nameko/nameko-grpc
test/test_headers.py
test_headers.py
py
6,536
python
en
code
57
github-code
6
[ { "api_name": "nameko_grpc.headers.encode_header", "line_number": 20, "usage_type": "call" }, { "api_name": "base64.b64encode", "line_number": 22, "usage_type": "call" }, { "api_name": "nameko_grpc.headers.encode_header", "line_number": 26, "usage_type": "call" }, { ...
5200005552
""" The production code for predicting smell events and sending push notifications (sending push notifications requires the rake script in the smell-pittsburgh-rails repository) """ import sys from util import log, generateLogger, computeMetric, isFileHere import pandas as pd from getData import getData fro...
CMU-CREATE-Lab/smell-pittsburgh-prediction
py/prediction/production.py
production.py
py
10,561
python
en
code
6
github-code
6
[ { "api_name": "util.generateLogger", "line_number": 60, "usage_type": "call" }, { "api_name": "util.log", "line_number": 61, "usage_type": "call" }, { "api_name": "util.log", "line_number": 62, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "li...
911733982
import pdfplumber import os,re file_path = "/home/FDDC_announcements_round2_train_pdf/" def pdf_tbl2txt(file): pdf = pdfplumber.open(file_path + "my.pdf") for i in pdf.pages: # page = pdf.pages[0] # i.extract_table() if i.find_tables(table_settings={}): i.crop(boundiipng_bo...
YankeeMarco/aliyun-FDDC-2018-Financial-Challenge-
pdf_to_text_with_table_tags.py
pdf_to_text_with_table_tags.py
py
322
python
en
code
14
github-code
6
[ { "api_name": "pdfplumber.open", "line_number": 6, "usage_type": "call" } ]
7705288630
import json import torch from transformers import GPT2Tokenizer from transformers import GPT2DoubleHeadsModel from MTDNN import MTDNN from tqdm import trange, tqdm from keras_preprocessing import sequence import pandas as pd import Utils import pickle import os from torch.utils.data import TensorDataset, Dat...
anandhperumal/ANA-at-SemEval-2020-Task-4-UNION
MTD-NCH.py
MTD-NCH.py
py
19,668
python
en
code
5
github-code
6
[ { "api_name": "datetime.datetime.now", "line_number": 22, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 22, "usage_type": "attribute" }, { "api_name": "torch.utils.tensorboard.SummaryWriter", "line_number": 24, "usage_type": "call" }, { ...
34042438403
from django.db.models import Q from django_filters.rest_framework import DjangoFilterBackend from rest_framework.decorators import action from rest_framework.response import Response from rest_framework.viewsets import ModelViewSet from gcloud.core.apis.drf.exceptions import ValidationException from gcloud.core.apis.d...
caiyj/bk-sops
gcloud/label/viewsets.py
viewsets.py
py
4,792
python
en
code
null
github-code
6
[ { "api_name": "iam.contrib.drf.shortcuts", "line_number": 15, "usage_type": "name" }, { "api_name": "gcloud.iam_auth.get_iam_client", "line_number": 15, "usage_type": "call" }, { "api_name": "gcloud.core.apis.drf.viewsets.ApiMixin", "line_number": 18, "usage_type": "name"...
31011028990
""" Name: Timothy James Duffy, Kevin Falconett File: metrics.py Class: CSc 483; Spring 2023 Project: TextSummarizer Provides methods to calculate the ROUGE metric and print the results. """ # Filter tensorflow warnings. import os os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' from database import * from rouge import Rouge ...
tjdaz/TextSummarizer
metrics.py
metrics.py
py
2,310
python
en
code
0
github-code
6
[ { "api_name": "os.environ", "line_number": 12, "usage_type": "attribute" }, { "api_name": "config.DATABASE_NAME", "line_number": 22, "usage_type": "argument" }, { "api_name": "database.get_data", "line_number": 23, "usage_type": "call" }, { "api_name": "summarizer...
26113055515
__authors__ = ["T. Vincent"] __license__ = "MIT" __date__ = "28/06/2018" import logging import numpy import weakref import functools from typing import Optional from ....utils.weakref import WeakList from ... import qt from .. import items from ..items import core from ...colors import rgba logger = logging.getLog...
silx-kit/silx
src/silx/gui/plot/items/_roi_base.py
_roi_base.py
py
27,769
python
en
code
106
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 19, "usage_type": "call" }, { "api_name": "items.ItemChangedType", "line_number": 61, "usage_type": "attribute" }, { "api_name": "functools.partial", "line_number": 179, "usage_type": "call" }, { "api_name": "items...
24528285056
import concurrent.futures import logging import time def thread_function(name): logging.info("Thread %s: starting", name) time.sleep(2) logging.info("Thread %s: finishing", name) class FakeDatabase: def __init__(self): self.value = 0 def update(self, name): logging.info("Thread ...
hiddenxx/Scripts
Learning/LearningThreads.py
LearningThreads.py
py
1,819
python
en
code
1
github-code
6
[ { "api_name": "logging.info", "line_number": 7, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 8, "usage_type": "call" }, { "api_name": "logging.info", "line_number": 9, "usage_type": "call" }, { "api_name": "logging.info", "line_number": 1...
70777980988
import random import re import matplotlib.pyplot as plt import numpy as np import tensorflow as tf from keras.preprocessing.text import Tokenizer import torch def transform_to_index_tensor(pairs,rus_w2i,en_w2i,device): rus_tensor = [] en_tensor = [] for word in range(len(pairs[0])): en_tensor.appe...
stefanos50/Seq2Seq-Machine-Translation
DataPreprocessing.py
DataPreprocessing.py
py
4,664
python
en
code
0
github-code
6
[ { "api_name": "random.sample", "line_number": 22, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 89, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 90, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.hist", "line_number...
13301085850
import requests from prettytable import PrettyTable #write this into terminal if using linux or cmd if using windows #pip3 install Prettytable requests city = input('Enter City => ')#City name here api = "your api here"#api of https://openweathermap.org get urs from the website response = requests.get(f"http:...
xavian1996/weatherpy
main.py
main.py
py
1,968
python
en
code
0
github-code
6
[ { "api_name": "requests.get", "line_number": 9, "usage_type": "call" }, { "api_name": "prettytable.PrettyTable", "line_number": 35, "usage_type": "call" } ]
23210233427
import pandas as pd from morpheus import SequentialComposition, ParallelComposition from morpheus.algo.selection import base_selection_algorithm, random_selection_algorithm from morpheus.utils.encoding import * from morpheus.utils import debug_print from sklearn.datasets import make_classification from sklearn.model_...
eliavw/morpheus
src/morpheus/tests/basics.py
basics.py
py
7,311
python
en
code
0
github-code
6
[ { "api_name": "sklearn.datasets.make_classification", "line_number": 23, "usage_type": "call" }, { "api_name": "sklearn.model_selection.train_test_split", "line_number": 33, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 37, "usage_type": "call" ...
4534058436
#!/usr/bin/env python # -*- coding: UTF-8 -*- import SPARQLWrapper # REF [site] >> https://sparqlwrapper.readthedocs.io/en/latest/main.html def select_example(): sparql = SPARQLWrapper.SPARQLWrapper("http://vocabs.ardc.edu.au/repository/api/sparql/csiro_international-chronostratigraphic-chart_geologic-time-scale-202...
sangwook236/SWDT
sw_dev/python/ext/test/database/sparqlwrapper_test.py
sparqlwrapper_test.py
py
7,970
python
en
code
17
github-code
6
[ { "api_name": "SPARQLWrapper.SPARQLWrapper", "line_number": 8, "usage_type": "call" }, { "api_name": "SPARQLWrapper.JSON", "line_number": 9, "usage_type": "attribute" }, { "api_name": "SPARQLWrapper.SPARQLWrapper", "line_number": 34, "usage_type": "call" }, { "api...
16292938825
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Mar 11 14:27:38 2021 @author: maximelucas """ import numpy as np import matplotlib.pyplot as plt rho_max=250 v_max=130 long=1000 A=150 B=40000 ga=[0 for i in range(B)] gb=[0 for i in range(B)] rho0=[200 for i in range(A//5)]+[0 for i in range(4*A//5)]...
Maksime0/Mod-lisation-et-mesures-pour-le-trafic-routier
Documents annexes/Godonov/godonov_anime.py
godonov_anime.py
py
1,309
python
en
code
0
github-code
6
[ { "api_name": "numpy.sqrt", "line_number": 48, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 62, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 62, "usage_type": "name" } ]
74787884667
# This file is part of "Junya's self learning project about Neural Network." # # "Junya's self learning project about Neural Network" # is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the L...
junyakaneko/learning-and-neural-network
chapter3/problem1.py
problem1.py
py
3,651
python
en
code
1
github-code
6
[ { "api_name": "numpy.exp", "line_number": 30, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 34, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 40, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.subplot", "li...
8927199604
import contextlib import os import shutil import tempfile import mandrel import unittest class TestCase(unittest.TestCase): def assertIs(self, a, b): # python 2.6/2.7 compatibility self.assertTrue(a is b) @contextlib.contextmanager def tempdir(dir=None): """Context manager that yields a tempor...
ethanrowe/python-mandrel
mandrel/test/utils.py
utils.py
py
1,612
python
en
code
4
github-code
6
[ { "api_name": "unittest.TestCase", "line_number": 8, "usage_type": "attribute" }, { "api_name": "os.path.realpath", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path", "line_number": 17, "usage_type": "attribute" }, { "api_name": "os.path.expanduse...
73676828986
import serial,os,sys ser = serial.Serial('/dev/ttyAMA1', 115200) drawPath = "/home/ubuntu/my_ws/src/test_odom_rap/drawLcd/drawLcd.py" byte_list = [0x55, 0x0E, 0x01, 0x02, int(0 / 256), int(0 % 256), 0,0, 0,0, 0, 0, 1] k = 0 for i in range(l...
caiyilian/INTELLIGENT-FOOD-DELIVERY-ROBOT
树莓派代码/drawLcd/auto_startup.py.py
auto_startup.py.py
py
1,524
python
en
code
2
github-code
6
[ { "api_name": "serial.Serial", "line_number": 3, "usage_type": "call" }, { "api_name": "os.popen", "line_number": 33, "usage_type": "call" }, { "api_name": "os.system", "line_number": 35, "usage_type": "call" }, { "api_name": "os.popen", "line_number": 36, ...
18023127994
import os import sqlite3 import shutil import sys import psutil def is_browser_running(browser_name): for process in psutil.process_iter(): try: if browser_name in process.name().lower(): return True except (psutil.NoSuchProcess, psutil.AccessDenied, psutil.ZombieProcess...
KIMJOONSIG/Reboot3
Linux/p3_BrowserHistory.py
p3_BrowserHistory.py
py
2,892
python
ko
code
0
github-code
6
[ { "api_name": "psutil.process_iter", "line_number": 8, "usage_type": "call" }, { "api_name": "psutil.NoSuchProcess", "line_number": 12, "usage_type": "attribute" }, { "api_name": "psutil.AccessDenied", "line_number": 12, "usage_type": "attribute" }, { "api_name": ...
29716875304
from basePlayer import BasePlayer import itertools from math import inf from random import choice import numpy as np from generals import State import pickle from minimaxPlayer import MinMaxPlayer from generals import PlayerEnum from game import Board from game import Controller from generals import g f...
Gbor97/TicTacToe
SVMPlayer.py
SVMPlayer.py
py
5,736
python
en
code
0
github-code
6
[ { "api_name": "basePlayer.BasePlayer", "line_number": 27, "usage_type": "name" }, { "api_name": "basePlayer.BasePlayer.__init__", "line_number": 29, "usage_type": "call" }, { "api_name": "basePlayer.BasePlayer", "line_number": 29, "usage_type": "name" }, { "api_na...
36180496136
""" Zimri Leisher and Luca Araujo Codeforces database, API and web app """ import sys import traceback import psycopg2 import json import config import flask from collections import defaultdict api = flask.Blueprint('api', __name__) def get_connection(): return psycopg2.connect(database=config.database, ...
LucaDantas/cs257
webapp/api.py
api.py
py
13,186
python
en
code
0
github-code
6
[ { "api_name": "flask.Blueprint", "line_number": 15, "usage_type": "call" }, { "api_name": "psycopg2.connect", "line_number": 19, "usage_type": "call" }, { "api_name": "config.database", "line_number": 19, "usage_type": "attribute" }, { "api_name": "config.user", ...
10062234348
import dataclasses import logging import typing import httpx from sequoia.exceptions import DiscoveryResourcesError, DiscoveryServicesError, ResourceNotFound, ServiceNotFound logger = logging.getLogger(__name__) __all__ = ["Resource", "ResourcesRegistry", "Service", "ServicesRegistry"] @dataclasses.dataclass clas...
pikselpalette/sequoia-python-client-sdk-async
sequoia/types.py
types.py
py
3,925
python
en
code
1
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 9, "usage_type": "call" }, { "api_name": "dataclasses.dataclass", "line_number": 14, "usage_type": "attribute" }, { "api_name": "sequoia.exceptions.ResourceNotFound", "line_number": 33, "usage_type": "call" }, { "a...
30578251026
import logging import itertools import math import sys import collections import datetime import shutil import click from .status import JobStatus, JOB_EVENT_STATUS_TRANSITIONS logger = logging.getLogger(__name__) logger.setLevel(logging.DEBUG) SYMBOLS = [" ", "I", "R", "X", "C", "H", "S"] STATUS_TO_SYMBOL = dict(...
JoshKarpel/condor_necropsy
condor_necropsy/state_graph.py
state_graph.py
py
5,724
python
en
code
0
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 14, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 15, "usage_type": "attribute" }, { "api_name": "status.JobStatus", "line_number": 18, "usage_type": "argument" }, { "api_name": "collections...
39830489884
from collections import deque def solution(n, info): answer = [] diff = 0 queue = deque() queue.append((0, [0,0,0,0,0,0,0,0,0,0,0])) while queue: idx, arr = queue.popleft() # 화살을 전부 쐈을경우 if sum(arr) == n: # 어피치와 라이언 점수 체크 apeach, lion = 0, 0 ...
omg7152/CodingTestPractice
kakaoBlindRecruitment2022/Q4.py
Q4.py
py
2,081
python
ko
code
0
github-code
6
[ { "api_name": "collections.deque", "line_number": 7, "usage_type": "call" } ]
21160883826
import os import math import torch import pytorch_lightning as pl import torch.nn.functional as F import torch.nn as nn from numpy import sqrt, argmax from torch.optim import lr_scheduler from .model import CNN import numpy as np import pandas as pd from sklearn.metrics import roc_curve, confusion_matrix, roc_auc_sco...
Junkkkk/ovarian_cancer_detection
models/lightning_model.py
lightning_model.py
py
12,263
python
en
code
1
github-code
6
[ { "api_name": "pytorch_lightning.LightningModule", "line_number": 22, "usage_type": "attribute" }, { "api_name": "model.CNN", "line_number": 31, "usage_type": "call" }, { "api_name": "model.CNN", "line_number": 33, "usage_type": "call" }, { "api_name": "model.CNN"...
32059806236
#!/usr/bin/env python3 """ led.py Notes ----- - Docstrings follow the numpydoc style: https://numpydoc.readthedocs.io/en/latest/format.html - Code follows the PEP 8 style guide: https://www.python.org/dev/peps/pep-0008/ """ import RPi.GPIO as GPIO from time import sleep import logging import constants as c LED_OU...
Hasan-Baig/SYSC3010_Home_Pixel
lightclapper/led.py
led.py
py
2,584
python
en
code
0
github-code
6
[ { "api_name": "constants.LED_OFF", "line_number": 55, "usage_type": "attribute" }, { "api_name": "RPi.GPIO.setmode", "line_number": 56, "usage_type": "call" }, { "api_name": "RPi.GPIO", "line_number": 56, "usage_type": "name" }, { "api_name": "RPi.GPIO.BCM", "...
40128251295
""" http://www.sphinx-doc.org/en/stable/ext/doctest.html https://github.com/sphinx-doc/sphinx/blob/master/sphinx/ext/doctest.py * TODO ** CLEANUP: use the sphinx directive parser from the sphinx project """ import doctest import enum import re import sys import textwrap import traceback from pathlib import Path from t...
thisch/pytest-sphinx
src/pytest_sphinx.py
pytest_sphinx.py
py
20,904
python
en
code
27
github-code
6
[ { "api_name": "typing.TYPE_CHECKING", "line_number": 34, "usage_type": "name" }, { "api_name": "io.StringIO", "line_number": 39, "usage_type": "attribute" }, { "api_name": "enum.Enum", "line_number": 42, "usage_type": "attribute" }, { "api_name": "pathlib.Path", ...
10808451041
from typing import Dict, Tuple from AnalysisOfUnstructuredData.helpers.hsc.publisher import Publisher class PublisherRelation: titles_types: Dict[str, str] _id: Tuple[int, int] def __init__(self, publisher_1: Publisher, publisher_2: Publisher): self.publisher_1 = publisher_1 self.publis...
TheDecks/Studies
AnalysisOfUnstructuredData/helpers/hsc/relation.py
relation.py
py
1,688
python
en
code
0
github-code
6
[ { "api_name": "typing.Dict", "line_number": 8, "usage_type": "name" }, { "api_name": "typing.Tuple", "line_number": 9, "usage_type": "name" }, { "api_name": "AnalysisOfUnstructuredData.helpers.hsc.publisher.Publisher", "line_number": 11, "usage_type": "name" }, { ...
40319717427
from ansible.module_utils.basic import AnsibleModule from ansible_collections.ansibleguy.opnsense.plugins.module_utils.base.handler import \ module_dependency_error, MODULE_EXCEPTIONS try: from ansible_collections.ansibleguy.opnsense.plugins.module_utils.base.api import single_post from ansible_collection...
ansibleguy/collection_opnsense
plugins/modules/system.py
system.py
py
2,071
python
en
code
158
github-code
6
[ { "api_name": "ansible_collections.ansibleguy.opnsense.plugins.module_utils.base.handler.MODULE_EXCEPTIONS", "line_number": 11, "usage_type": "name" }, { "api_name": "ansible_collections.ansibleguy.opnsense.plugins.module_utils.base.handler.module_dependency_error", "line_number": 12, "u...
4456513686
from dataclasses import dataclass from fnmatch import fnmatch from typing import cast, Optional from urllib.parse import urljoin from .config import Config from .download import DownloaderMixIn, HTTPXDownloaderMixIn from .exceptions import ( ArbitrarySoftwareAttack, DownloadNotFoundError, EndlessDataAttack...
trishankatdatadog/tuf-on-a-plane
src/tuf_on_a_plane/repository.py
repository.py
py
18,018
python
en
code
4
github-code
6
[ { "api_name": "models.common.Filepath", "line_number": 48, "usage_type": "name" }, { "api_name": "models.metadata.TargetFile", "line_number": 49, "usage_type": "name" }, { "api_name": "dataclasses.dataclass", "line_number": 46, "usage_type": "name" }, { "api_name"...
11322722554
from keras.models import * from keras.layers import * from model.model_basic import BasicDeepModel from keras.utils.vis_utils import plot_model from keras import regularizers dp = 7 filter_nr = 64 filter_size = 3 max_pool_size = 3 max_pool_strides = 2 dense_nr = 256 spatial_dropout = 0.2 dense_dropout = 0.5 conv_kern...
nlpjoe/daguan-classify-2018
src/model/dpcnn_model.py
dpcnn_model.py
py
5,042
python
en
code
154
github-code
6
[ { "api_name": "keras.regularizers.l2", "line_number": 16, "usage_type": "call" }, { "api_name": "keras.regularizers", "line_number": 16, "usage_type": "name" }, { "api_name": "keras.regularizers.l2", "line_number": 17, "usage_type": "call" }, { "api_name": "keras....
22906645455
import xlrd class XLDateInfo(object): def __init__(self, path=''): self.xl = xlrd.open_workbook(path) self.sheet = None def get_sheet_info_by_name(self, name): self.sheet = self.xl.sheet_by_name(name) return self.get_sheet_info() def get_sheet_info(self): infolist...
weijianhui011/uploadfile
public/read_excel.py
read_excel.py
py
659
python
en
code
0
github-code
6
[ { "api_name": "xlrd.open_workbook", "line_number": 6, "usage_type": "call" } ]
30980414030
from matplotlib.pyplot import draw import pygame from pygame.locals import * pygame.init() pygame.mixer.init() # set screen resolution resolution = (725,725) # open a screen of above resolution screen = pygame.display.set_mode(resolution) # storing screen variable values width = screen.get_width() height = screen....
jessica-leishman/high-rollers
analysis_static/manual slices/hrStatic4.py
hrStatic4.py
py
2,135
python
en
code
0
github-code
6
[ { "api_name": "pygame.init", "line_number": 6, "usage_type": "call" }, { "api_name": "pygame.mixer.init", "line_number": 7, "usage_type": "call" }, { "api_name": "pygame.mixer", "line_number": 7, "usage_type": "attribute" }, { "api_name": "pygame.display.set_mode"...
27959320759
import os from os import getenv from dotenv import load_dotenv load_dotenv() # FOR CODES API_ID = int(getenv("API_ID","2302493")) API_HASH = getenv("API_HASH","1bf8344851a88633343fde339f2eee20") SUDO_USERS = list(map(int, getenv("SUDO_USERS", "5366284852").split())) LOGGER = int(getenv("LOGGER","-1001804302628"))...
Anirudh1212121/DcSpamBot
config.py
config.py
py
899
python
en
code
null
github-code
6
[ { "api_name": "dotenv.load_dotenv", "line_number": 5, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 10, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 11, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": ...
31350011958
import unittest from seleniumwire import webdriver from webdriver_manager.chrome import ChromeDriverManager from selenium.webdriver.common.by import By #This code uses the google chrome browser to conduct a single test on the python.org website #It uses the website search bar to search for "pycon" # Selenium installa...
Kitchlew/Summer
SQA/sel.py
sel.py
py
1,254
python
en
code
0
github-code
6
[ { "api_name": "unittest.TestCase", "line_number": 11, "usage_type": "attribute" }, { "api_name": "seleniumwire.webdriver.Chrome", "line_number": 14, "usage_type": "call" }, { "api_name": "seleniumwire.webdriver", "line_number": 14, "usage_type": "name" }, { "api_n...
16407449430
import mysql.connector import csv import matplotlib.pyplot as plt import matplotlib from matplotlib import colors as mcolors import datetime import nltk from nltk.sentiment.vader import SentimentIntensityAnalyzer colors = dict(mcolors.BASE_COLORS, **mcolors.CSS4_COLORS) # Sort colors by hue, saturation, value and n...
natashaarmbrust/github-sentiment
pr_sentiments.py
pr_sentiments.py
py
3,745
python
en
code
0
github-code
6
[ { "api_name": "matplotlib.colors.BASE_COLORS", "line_number": 10, "usage_type": "attribute" }, { "api_name": "matplotlib.colors", "line_number": 10, "usage_type": "name" }, { "api_name": "matplotlib.colors.CSS4_COLORS", "line_number": 10, "usage_type": "attribute" }, ...
10136905988
import cv2 as cv import copy import numpy as np from matplotlib import pyplot as plt img = cv.imread("/home/arkaprabha/CViiing/photos/cameron.jpeg") cv.imshow("image",img) def reframe(frame=None,scale=0.75): width= int(frame.shape[1] + scale) height = int(frame.shape[0] + scale) dimen = (width,height) ...
ArkaprabhaChakraborty/CViiing
python/basics.py
basics.py
py
4,193
python
en
code
1
github-code
6
[ { "api_name": "cv2.imread", "line_number": 6, "usage_type": "call" }, { "api_name": "cv2.imshow", "line_number": 7, "usage_type": "call" }, { "api_name": "cv2.resize", "line_number": 13, "usage_type": "call" }, { "api_name": "cv2.INTER_AREA", "line_number": 13...
36615991000
import asyncio import logging import random import sys from time import sleep def run_async(): async def mytask(tid: str): n = random.randint(1, 3) for i in range(n): logging.info(f"task {tid} {i} of {n}") await asyncio.sleep(1) logging.info(f"finished {tid} {n}") ...
wwagner4/pymultiworker
tryout.py
tryout.py
py
1,397
python
en
code
0
github-code
6
[ { "api_name": "random.randint", "line_number": 10, "usage_type": "call" }, { "api_name": "logging.info", "line_number": 12, "usage_type": "call" }, { "api_name": "asyncio.sleep", "line_number": 13, "usage_type": "call" }, { "api_name": "logging.info", "line_nu...
9887556442
import cv2, sys, time def start_split(filename): start = time.time() video = cv2.VideoCapture(filename) if not video: print("无法读取视频文件") sys.exit(1) count = 0 while video.isOpened(): print("\r正在处理第{0}帧图像".format(count), end="") ret, frame = video.read()...
Temperature6/BadAppleVideoProcess
VideoSplit.py
VideoSplit.py
py
825
python
en
code
1
github-code
6
[ { "api_name": "time.time", "line_number": 5, "usage_type": "call" }, { "api_name": "cv2.VideoCapture", "line_number": 6, "usage_type": "call" }, { "api_name": "sys.exit", "line_number": 9, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 18...
27322987878
from __future__ import print_function, division, absolute_import, unicode_literals import logging import os from inspect import isclass from tempfile import NamedTemporaryFile from collections import OrderedDict from fontTools.misc.py23 import tobytes, tounicode, UnicodeIO from fontTools.feaLib.parser import Parser fr...
Torneo-Tipografico-Comunidad/Torneo-2020
Calmadita /05_SOURCES/sources/venv/lib/python3.7/site-packages/ufo2ft/featureCompiler.py
featureCompiler.py
py
10,497
python
en
code
7
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 23, "usage_type": "call" }, { "api_name": "fontTools.misc.py23.tounicode", "line_number": 30, "usage_type": "call" }, { "api_name": "ufo2ft.featureWriters.ast.FeatureFile", "line_number": 32, "usage_type": "call" }, { ...
26260800957
import pygame class Item: def __init__(self, image, x, y, id, player): self.image = pygame.image.load(image) self.x, self.y = x, y self.player = player self.id = id def draw(self, screen): screen.blit(self.image, (self.x, self.y)) def onPlayerCollision(self): pygame.mixer.music.load("other\...
SeaPickle754/zeldaish
item.py
item.py
py
588
python
en
code
0
github-code
6
[ { "api_name": "pygame.image.load", "line_number": 5, "usage_type": "call" }, { "api_name": "pygame.image", "line_number": 5, "usage_type": "attribute" }, { "api_name": "pygame.mixer.music.load", "line_number": 13, "usage_type": "call" }, { "api_name": "pygame.mixe...
20546789103
import discord from discord.ext import commands from discord.ext.commands import Command from chime.main import prefix from chime.misc.CustomCommand import CustomCommand from chime.misc.StyledEmbed import StyledEmbed class EmbedHelpCommand(commands.HelpCommand): """This is an example of a HelpCommand that utiliz...
realmayus/chime
chime/cogs/HelpCommandCog.py
HelpCommandCog.py
py
4,233
python
en
code
1
github-code
6
[ { "api_name": "discord.ext.commands.HelpCommand", "line_number": 10, "usage_type": "attribute" }, { "api_name": "discord.ext.commands", "line_number": 10, "usage_type": "name" }, { "api_name": "discord.colour.Color.from_rgb", "line_number": 23, "usage_type": "call" }, ...
19202891943
#!/usr/bin/python3 """ A module that include the parent class Basemodel """ import models from datetime import datetime from uuid import uuid4 class BaseModel: """ class BaseModel that defines all common attributes/methods for other classes. """ def __init__(self, *args, **kwargs): """ ...
sanotogii/AirBnB_clone
models/base_model.py
base_model.py
py
2,261
python
en
code
0
github-code
6
[ { "api_name": "uuid.uuid4", "line_number": 25, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 26, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 26, "usage_type": "name" }, { "api_name": "datetime.datetime....
18801821077
import requests requests.packages.urllib3.disable_warnings() # noqa url = "https://api.github.com/repos/milvus-io/milvus/actions/workflows" payload = {} token = "" # your token headers = { "Authorization": f"token {token}", } response = requests.request("GET", url, headers=headers, data=payload) def analysis_w...
milvus-io/milvus
tests/python_client/chaos/scripts/workflow_analyse.py
workflow_analyse.py
py
1,895
python
en
code
24,190
github-code
6
[ { "api_name": "requests.packages.urllib3.disable_warnings", "line_number": 2, "usage_type": "call" }, { "api_name": "requests.packages", "line_number": 2, "usage_type": "attribute" }, { "api_name": "requests.request", "line_number": 11, "usage_type": "call" }, { "...
29285921224
from rply import LexerGenerator # type: ignore # lexer for the "calc" command lg = LexerGenerator() lg.add('NUMBER', r'[0-9]+[\.]?[0-9]*') # number token lg.add('ADDITION', r'\+') # operator tokens lg.add('SUBTRACTION', r'-') lg.add('MULTIPLICATION', r'\*') lg.add('EXPONENT', r'\^') lg.add('DIVISION', r'\/') lg.add(...
Chrovo/Productivity
cogs/utils/lexer.py
lexer.py
py
582
python
en
code
0
github-code
6
[ { "api_name": "rply.LexerGenerator", "line_number": 4, "usage_type": "call" } ]
22021920480
''' Jessica Dutton Store Manager (user entity) ''' from google.cloud import datastore from flask import Blueprint, Flask, request, make_response import json import constants from google.oauth2 import id_token from google.auth.transport import requests client = datastore.Client() bp = Blueprint('store_manager', __nam...
jdutt25/dvd_store
store_manager.py
store_manager.py
py
1,310
python
en
code
0
github-code
6
[ { "api_name": "google.cloud.datastore.Client", "line_number": 14, "usage_type": "call" }, { "api_name": "google.cloud.datastore", "line_number": 14, "usage_type": "name" }, { "api_name": "flask.Blueprint", "line_number": 15, "usage_type": "call" }, { "api_name": "...
3670374638
import math from collections import defaultdict from typing import Union, Callable, Tuple, List import gevent from gevent.queue import Queue from requests import PreparedRequest, Response from lib.utils.logger import Logger from lib.utils.request_helper import RequestHelper, RequestInfo class BaseFinder(RequestHelp...
medalahonor/suseeker
lib/finders/base_finder.py
base_finder.py
py
13,362
python
ru
code
3
github-code
6
[ { "api_name": "lib.utils.request_helper.RequestHelper", "line_number": 13, "usage_type": "name" }, { "api_name": "collections.defaultdict", "line_number": 16, "usage_type": "call" }, { "api_name": "lib.utils.request_helper.RequestInfo", "line_number": 21, "usage_type": "n...
24847039251
import pygame class Character(): """Create a character - inherits from the Sprite class""" def __init__(self, screen, game_settings): self.screen = screen self.settings = game_settings # Load the character image and get its rect self.image = pygame.image.load("images...
YorkshireStu83/Flatpormer
character.py
character.py
py
2,187
python
en
code
0
github-code
6
[ { "api_name": "pygame.image.load", "line_number": 11, "usage_type": "call" }, { "api_name": "pygame.image", "line_number": 11, "usage_type": "attribute" } ]
36807817632
import numpy as np from scipy import signal from scipy.signal import butter, lfilter def createSpec(signals, sr, n_channels=22): # Reference: https://github.com/MesSem/CNNs-on-CHB-MIT, DataSetToSpectrogram n_channels = min(n_channels, 22) for channel in range(n_channels): y = signals[channel] ...
koike-ya/eeglibrary
eeglibrary/src/chb_mit_cnn_spectrogram.py
chb_mit_cnn_spectrogram.py
py
1,357
python
en
code
1
github-code
6
[ { "api_name": "scipy.signal.spectrogram", "line_number": 14, "usage_type": "call" }, { "api_name": "scipy.signal", "line_number": 14, "usage_type": "name" }, { "api_name": "numpy.delete", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.s_", "li...
8017799306
import tkinter as tk from tkinter import ttk from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg from matplotlib.figure import Figure import numpy as np class GraphPlt(): def __init__(self): """インスタンス化。Figureの作成 """ self.fig = Figure(figsize=(6,6)) def plt(self, title="plot...
komepi/komepiTkinter
komepiTkinter/GraphPlt.py
GraphPlt.py
py
6,239
python
en
code
0
github-code
6
[ { "api_name": "matplotlib.figure.Figure", "line_number": 11, "usage_type": "call" }, { "api_name": "tkinter.Toplevel", "line_number": 26, "usage_type": "call" }, { "api_name": "tkinter.Tk", "line_number": 28, "usage_type": "call" }, { "api_name": "tkinter.Frame", ...
71781182589
import glob import os from datetime import datetime import cv2 # isResize = False isResize = True # change this to False, if resize is not required images = [] image_src_folder = "images" files = glob.glob(image_src_folder+"/*") for file in files: print(f"Processing: {os.path.basename(file)}") if file.endswi...
yptheangel/opencv-starter-pack
python/examples/image_stitching/stitching.py
stitching.py
py
1,349
python
en
code
8
github-code
6
[ { "api_name": "glob.glob", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path.basename", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path", "line_number": 14, "usage_type": "attribute" }, { "api_name": "cv2.imread", "line_number...
1698064062
import pygame # define constants for the window size and stack element size ELEMENT_WIDTH = 50 ELEMENT_HEIGHT = 200 # initialize Pygame pygame.init() # create a window window = pygame.display.set_mode((1000, 500)) # define a font to use for displaying the stack elements font = pygame.font.Font(None, 36) # define a...
Dhivyno/Programming-projects
All files/test.py
test.py
py
2,005
python
en
code
2
github-code
6
[ { "api_name": "pygame.init", "line_number": 8, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 11, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 11, "usage_type": "attribute" }, { "api_name": "pygame.font.Fo...
26922909604
""" Imports the various compute backends """ from typing import Set from ..exceptions import InputError, ResourceError from .cfour import CFOURHarness from .dftd3 import DFTD3Harness from .entos import EntosHarness from .gamess import GAMESSHarness from .molpro import MolproHarness from .mopac import MopacHarness fro...
ChemRacer/QCEngine
qcengine/programs/base.py
base.py
py
2,624
python
en
code
null
github-code
6
[ { "api_name": "exceptions.InputError", "line_number": 63, "usage_type": "call" }, { "api_name": "exceptions.ResourceError", "line_number": 67, "usage_type": "call" }, { "api_name": "typing.Set", "line_number": 72, "usage_type": "name" }, { "api_name": "typing.Set"...
10795571321
""" 作为初始代码,目标是有的一个固定大小的球,给定一个初识速度,和一个固定阻力,演示球运动的过程。每一个循环的时间与现实时间一致。 从最初代码开始演示如何一步步完善代码最终完成功能的过程。 """ import sys, pygame import os.path import random import time import math #pygame.font.init() #myfont = pygame.font.SysFont('Comic Sans MS', 30) def hit_A(x, y): return y <= 10 def hit_B(x, y): return x >= 590 ...
sillyemperor/pygame-study
rebound-ball-walls.py
rebound-ball-walls.py
py
1,622
python
en
code
0
github-code
6
[ { "api_name": "os.path.path.dirname", "line_number": 26, "usage_type": "call" }, { "api_name": "os.path.path", "line_number": 26, "usage_type": "attribute" }, { "api_name": "os.path", "line_number": 26, "usage_type": "name" }, { "api_name": "os.path.path.abspath",...
24657079519
from django.contrib import admin from django.urls import reverse from django.utils.html import format_html from django.utils.safestring import mark_safe from django.utils.translation import ugettext_lazy as _ from . import models import json # Register your models here. class BaseAdmin(admin.ModelAdmin): list_p...
leafcoder/django-covid19
django_covid19/admin.py
admin.py
py
3,276
python
en
code
155
github-code
6
[ { "api_name": "django.contrib.admin.ModelAdmin", "line_number": 12, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 12, "usage_type": "name" }, { "api_name": "django.utils.translation.ugettext_lazy", "line_number": 34, "usage_type": "call...
36396180382
from ast import Lambda from itertools import groupby import pandas as pd import pymysql from pyecharts.charts import Bar, Line, Pie from pyecharts import options as opts conn = pymysql.connect(host="localhost", user="root", passwd="123456", port=3306, db="591") cursor = conn.cursor() sql = 'se...
dichotomania/project
visual.py
visual.py
py
5,336
python
en
code
0
github-code
6
[ { "api_name": "pymysql.connect", "line_number": 9, "usage_type": "call" }, { "api_name": "pandas.read_sql", "line_number": 18, "usage_type": "call" }, { "api_name": "pyecharts.charts.Bar", "line_number": 35, "usage_type": "call" }, { "api_name": "pyecharts.options...
14564990421
import numpy as np from IO.Pinocchio.ReadPinocchio import mf import matplotlib.pyplot as plt # Box Size boxsize = 150.0 aux = mf("../TestRuns/pinocchio.1.9775.example.mf.out", "mf") mf0 = mf("../TestRuns/pinocchio.1.9775.example.catalog.out", "catalog", 64, boxsize) mf0.dndm_teo = np.interp(mf0.m, aux.m, aux.dndm_t...
TiagoBsCastro/PITILESS-SLICER
Test/test_mf.py
test_mf.py
py
657
python
en
code
1
github-code
6
[ { "api_name": "IO.Pinocchio.ReadPinocchio.mf", "line_number": 8, "usage_type": "call" }, { "api_name": "IO.Pinocchio.ReadPinocchio.mf", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.interp", "line_number": 10, "usage_type": "call" }, { "api_name":...
39122258660
from service_info import dp, bot, greeting, download_url, path_to_file_url, PhotoStatesGroup, dict_config, lang_dict import aiohttp from visor import tess_visor, easy_visor, keras_visor from aiogram import types, executor from keyboards import type_kb, lang_kb from aiogram.dispatcher import FSMContext import logging im...
dfgion/VisorBot
bot.py
bot.py
py
4,388
python
en
code
0
github-code
6
[ { "api_name": "logging.info", "line_number": 11, "usage_type": "call" }, { "api_name": "aiogram.types.Message", "line_number": 14, "usage_type": "attribute" }, { "api_name": "aiogram.types", "line_number": 14, "usage_type": "name" }, { "api_name": "logging.info", ...
13303759601
import requests, asyncio from app import ACCESS_TOKEN, PYONET_API_URL, db from app.tools.p3log import P3Log class Poller: def __init__(self): self.p3log = P3Log("poller.log") self.poll_task = None self.devices = [] async def test_access_token(self): try: ...
treytose/Pyonet-Poller
pyonet-poller/app/libraries/libpoller.py
libpoller.py
py
2,336
python
en
code
0
github-code
6
[ { "api_name": "app.tools.p3log.P3Log", "line_number": 7, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 13, "usage_type": "call" }, { "api_name": "app.PYONET_API_URL", "line_number": 13, "usage_type": "name" }, { "api_name": "app.ACCESS_TOKEN...
19346820391
from pyparsing import FollowedBy import tweepy from app.config import TWITTER_API_KEY,TWITTER_API_KEY_SECRET,get_logger class TwitterAPI: def __init__(self,access_token,access_token_secret) -> None: self.api_key = TWITTER_API_KEY self.api_key_secret = TWITTER_API_KEY_SECRET self.access_toke...
Socialet/web-backend
app/services/api/twitterAPI.py
twitterAPI.py
py
9,191
python
en
code
0
github-code
6
[ { "api_name": "app.config.TWITTER_API_KEY", "line_number": 7, "usage_type": "name" }, { "api_name": "app.config.TWITTER_API_KEY_SECRET", "line_number": 8, "usage_type": "name" }, { "api_name": "app.config.get_logger", "line_number": 11, "usage_type": "call" }, { "...
7725611508
import itertools def det_4x4(matrix): if len(matrix) != 4 or len(matrix[0]) != 4: raise ValueError("A matriz não é 4x4") indices = [0, 1, 2, 3] permuta = itertools.permutations(indices) det = 0 for perm in permuta: sinal = 1 for i in range(4): for j in range(i + ...
AlexApLima/CalculoDeterminantesLeibniz
CalFormula.py
CalFormula.py
py
903
python
pt
code
0
github-code
6
[ { "api_name": "itertools.permutations", "line_number": 7, "usage_type": "call" } ]
31356519066
import pygame import sys # 게임 창 크기 설정 screen_width = 800 screen_height = 600 # 버튼 클래스 정의 class Button: def __init__(self, x, y, width, height, idle_image, hover_image): self.rect = pygame.Rect(x, y, width, height) self.idle_image = idle_image self.hover_image = hover_image self.ima...
frogress/prac_pygame
opentutorials/chatgpt.py
chatgpt.py
py
2,576
python
en
code
0
github-code
6
[ { "api_name": "pygame.Rect", "line_number": 11, "usage_type": "call" }, { "api_name": "pygame.MOUSEMOTION", "line_number": 21, "usage_type": "attribute" }, { "api_name": "pygame.MOUSEBUTTONDOWN", "line_number": 26, "usage_type": "attribute" }, { "api_name": "pygam...
37841455471
import logging logger = logging.getLogger() logger.setLevel(level="DEBUG") logging.Formatter # 创建文本处理器 file_handle = logging.FileHandler("./log.txt", mode="a", encoding="utf-8") file_handle.setLevel(level="ERROR") logger.addHandler(file_handle) fmt = "%(name)s--->%(message)s--->%(asctime)s" logging.basicConfig(level...
amespaces/pythonProject
common/创建文件处理器.py
创建文件处理器.py
py
552
python
en
code
0
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 3, "usage_type": "call" }, { "api_name": "logging.Formatter", "line_number": 5, "usage_type": "attribute" }, { "api_name": "logging.FileHandler", "line_number": 7, "usage_type": "call" }, { "api_name": "logging.bas...
1544268645
import itertools def test(kenken_grid): n = kenken_grid[0][0] dom = [] for i in range(n): dom.append(i + 1) vars = [] for i in dom: for j in dom: vars.append('V{}{}'.format(i, j)) cons = [] for i in range(n): vars_row = vars[(i * n): ((i + 1) * n)] ...
monkeykingg/projects
3rd_year/csc384/A2/sol/test.py
test.py
py
691
python
en
code
2
github-code
6
[ { "api_name": "itertools.combinations", "line_number": 24, "usage_type": "call" }, { "api_name": "itertools.combinations", "line_number": 27, "usage_type": "call" } ]
70740769147
from __future__ import print_function import torch def diff_mse(x, y): x_vec = x.view(1, -1).squeeze() y_vec = y.view(1, -1).squeeze() return torch.mean(torch.pow((x_vec - y_vec), 2)).item() def ax_plus_b_vector(x, weight, bias): return weight.mm(x).add(bias) def ax_plus_b_scalar(x, weight, bias, ...
IvanProdaiko94/UCU-deep-learning-homework
layers/utilities.py
utilities.py
py
1,222
python
en
code
1
github-code
6
[ { "api_name": "torch.mean", "line_number": 8, "usage_type": "call" }, { "api_name": "torch.pow", "line_number": 8, "usage_type": "call" }, { "api_name": "torch.zeros", "line_number": 32, "usage_type": "call" } ]
72757283709
""" Utilities I can't put anywhere else... """ import time from math import copysign, gcd from copy import copy import sys import numpy as np import datetime import functools def true_if_answer_is_yes(prompt=""): invalid = True while invalid: x = input(prompt) x = x.lower() if x[0] =...
ahalsall/pysystrade
syscore/genutils.py
genutils.py
py
11,815
python
en
code
4
github-code
6
[ { "api_name": "copy.copy", "line_number": 65, "usage_type": "call" }, { "api_name": "math.copysign", "line_number": 144, "usage_type": "call" }, { "api_name": "numpy.isnan", "line_number": 169, "usage_type": "call" }, { "api_name": "time.time", "line_number": ...
28521323695
"""change precision of order amount Revision ID: fb84527fc0b3 Revises: 5c6f2d25c2f0 Create Date: 2018-04-07 18:51:12.160012+00:00 """ from alembic import op import sqlalchemy as sa from sqlalchemy.dialects import mysql # revision identifiers, used by Alembic. revision = 'fb84527fc0b3' down_revision = '5c6f2d25c2f0' ...
harveyslash/backend-cleaned
beatest/migrations/versions/20180407185112_fb84527fc0b3_change_type_of_order_amount.py
20180407185112_fb84527fc0b3_change_type_of_order_amount.py
py
1,011
python
en
code
0
github-code
6
[ { "api_name": "alembic.op.alter_column", "line_number": 21, "usage_type": "call" }, { "api_name": "alembic.op", "line_number": 21, "usage_type": "name" }, { "api_name": "sqlalchemy.dialects.mysql.DECIMAL", "line_number": 22, "usage_type": "call" }, { "api_name": "...
12940606913
import json import logging import avro.schema from avro.datafile import DataFileWriter from avro.io import DatumWriter # Login config logging.basicConfig( filename='writer.log', filemode='w', format='%(asctime)s - %(levelname)s - %(message)s', level=logging.INFO ) # read records from sample_dat...
jocerfranquiz/avro_test
write_avro.py
write_avro.py
py
1,116
python
en
code
0
github-code
6
[ { "api_name": "logging.basicConfig", "line_number": 8, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 12, "usage_type": "attribute" }, { "api_name": "logging.error", "line_number": 24, "usage_type": "call" }, { "api_name": "avro.schema.schema...
74473909946
from datetime import date from django.test import Client from django.test import TestCase from django.urls import resolve from .views import index, mhs_name, calculate_age class Lab1UnitTest(TestCase): def test_hello_name_is_exist(self): response = Client().get('/lab-1/') self.assertEqual(respon...
argaghulamahmad/ppw-lab-arga
lab_1/tests.py
tests.py
py
1,752
python
en
code
0
github-code
6
[ { "api_name": "django.test.TestCase", "line_number": 10, "usage_type": "name" }, { "api_name": "django.test.Client", "line_number": 12, "usage_type": "call" }, { "api_name": "django.urls.resolve", "line_number": 16, "usage_type": "call" }, { "api_name": "views.ind...