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
14265869744
import os from PIL import Image from scipy.ndimage.filters import gaussian_filter import cv2 import shutil # To copy the file import sys import numpy as np import torch from torchvision import transforms from torch.utils.data import Dataset import torch.nn.functional as F import torchvision from tqdm import tqdm ...
LudovicoL/PaDiM
backbone/AITEX.py
AITEX.py
py
14,796
python
en
code
2
github-code
36
[ { "api_name": "torch.utils.data.Dataset", "line_number": 37, "usage_type": "name" }, { "api_name": "torchvision.transforms.Compose", "line_number": 43, "usage_type": "call" }, { "api_name": "torchvision.transforms", "line_number": 43, "usage_type": "name" }, { "ap...
72692990823
import sqlite3 class Db: """ A class used to represent database(Db) """ def __init__(self, database): self.conn = sqlite3.connect(database, check_same_thread=False) self.conn.row_factory = sqlite3.Row self.cursor = self.conn.cursor() def execute(self, query):...
madeleinema-cee/think-of-an-animal-flask
db.py
db.py
py
2,372
python
en
code
0
github-code
36
[ { "api_name": "sqlite3.connect", "line_number": 10, "usage_type": "call" }, { "api_name": "sqlite3.Row", "line_number": 11, "usage_type": "attribute" } ]
29649845397
import urllib3 import urllib.request import base64 import json import pandas as pd from tabulate import tabulate import codecs import numpy as np url = 'https://infeci.capsulecrm.com/api/opportunity' headers = {} # base64string = base64.urlsafe_b64encode('2d486e42771eee18125b8aef3afe216d:4c2TNRdi') base64string = bas...
rubenglezant/playBetterBets
Python-Bolsa/reportCRM/buildReport.py
buildReport.py
py
3,230
python
en
code
0
github-code
36
[ { "api_name": "base64.encodestring", "line_number": 14, "usage_type": "call" }, { "api_name": "urllib.request.request.Request", "line_number": 17, "usage_type": "call" }, { "api_name": "urllib.request.request", "line_number": 17, "usage_type": "attribute" }, { "ap...
34715801253
from __future__ import absolute_import from os import environ import json from flask import Flask, jsonify, request import settings from celery import Celery import urllib2 app = Flask(__name__) app.config.from_object(settings) ''' ========================================== ============= CELERY Section ============= ...
elihusmails/myassistant
src/app/tasks.py
tasks.py
py
3,707
python
en
code
0
github-code
36
[ { "api_name": "flask.Flask", "line_number": 9, "usage_type": "call" }, { "api_name": "celery.Celery", "line_number": 18, "usage_type": "call" }, { "api_name": "celery.conf.update", "line_number": 19, "usage_type": "call" }, { "api_name": "celery.conf", "line_n...
29335693587
from keras.models import load_model from sklearn.metrics import confusion_matrix import itertools import numpy as np import matplotlib.pyplot as plt import sys import csv def load_data(train_data_path): X_train = [] Y_train = [] text = open(train_data_path, 'r', encoding='big5') row = csv.reader(text...
b01901143/ML2017FALL
hw3/confusion.py
confusion.py
py
2,433
python
en
code
1
github-code
36
[ { "api_name": "csv.reader", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.reshape", "line_number": 23, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 23, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.cm", "line...
74330584745
# -*- coding: utf-8 -*- __author__ = "Amir Arfan, Sebastian Becker" __email__ = "amar@nmbu.no, sebabeck@nmbu.no" """ Simulation of the Island with visualization """ from .map import Map import numpy as np import pandas as pd import matplotlib.pyplot as plt import matplotlib.patches as mpatches import subprocess imp...
amirarfan/BioSim_G03_Amir_Sebastian
src/biosim/simulation.py
simulation.py
py
15,901
python
en
code
0
github-code
36
[ { "api_name": "os.path.join", "line_number": 24, "usage_type": "call" }, { "api_name": "os.path", "line_number": 24, "usage_type": "attribute" }, { "api_name": "map.Map", "line_number": 76, "usage_type": "call" }, { "api_name": "numpy.random.seed", "line_numbe...
16096100007
import pygame import minesweeper_map as mm pygame.init() class minesweeper_tile(): def __init__(self, v, f=False, h=True): self.value = v self.flag = f self.hidden = h def set_value(self, v): self.value = v def set_flag(self): self.flag = not self.flag def s...
mjd-programming/Minesweeper
minesweeper_game.py
minesweeper_game.py
py
4,549
python
en
code
0
github-code
36
[ { "api_name": "pygame.init", "line_number": 5, "usage_type": "call" }, { "api_name": "pygame.image.load", "line_number": 30, "usage_type": "call" }, { "api_name": "pygame.image", "line_number": 30, "usage_type": "attribute" }, { "api_name": "minesweeper_map.minesw...
39363534839
import os, sys import csv import random import signal import socket import threading import time import datetime from fxpmath import Fxp from Parse_DNN import * from EKF_AoA import * import numpy.matlib import numpy as np from numpy.linalg import inv from numpy.core.fromnumeric import transpose import math from math ...
yws94/Unlab_SR150
prev_ver/Unlab_SR150_ver3.py
Unlab_SR150_ver3.py
py
7,042
python
en
code
2
github-code
36
[ { "api_name": "csv.writer", "line_number": 53, "usage_type": "call" }, { "api_name": "serial.Serial", "line_number": 59, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.cla", "line_number": 70, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", ...
9366591632
# coding=utf-8 from flask import Flask, jsonify, render_template, request from py2neo import Graph import jw.Q_Search as search import json import logging logging.basicConfig(level=logging.WARNING, format='%(asctime)s %(levelname)s %(message)s', datefmt='%a, %d %b %Y %H:%M:%S...
ChandlerBang/Movie-QA-System
flask_app.py
flask_app.py
py
6,282
python
en
code
58
github-code
36
[ { "api_name": "logging.basicConfig", "line_number": 9, "usage_type": "call" }, { "api_name": "logging.WARNING", "line_number": 9, "usage_type": "attribute" }, { "api_name": "flask.Flask", "line_number": 15, "usage_type": "call" }, { "api_name": "py2neo.Graph", ...
21620206001
from __future__ import absolute_import from concurrent.futures import ThreadPoolExecutor import grpc from apache_beam.portability.api import beam_runner_api_pb2_grpc from apache_beam.portability.api.beam_runner_api_pb2_grpc import TestStreamServiceServicer class TestStreamServiceController(TestStreamServiceService...
a0x8o/kafka
sdks/python/apache_beam/testing/test_stream_service.py
test_stream_service.py
py
1,048
python
en
code
59
github-code
36
[ { "api_name": "apache_beam.portability.api.beam_runner_api_pb2_grpc.TestStreamServiceServicer", "line_number": 11, "usage_type": "name" }, { "api_name": "grpc.server", "line_number": 13, "usage_type": "call" }, { "api_name": "concurrent.futures.ThreadPoolExecutor", "line_numb...
74552228582
""" Test File """ from flask import Flask from redis import Redis app = Flask(__name__) redis_client = Redis( host='redis_db', port=6379 ) @app.route('/') def hello(): """ Main app route, simply returns a Hello """ count_key = redis_client.get('count') count = int(count_key) if count_key...
ZacharyATanenbaum/docker_dev_build_system
examples/docker_compose_services/python_docker/index.py
index.py
py
489
python
en
code
0
github-code
36
[ { "api_name": "flask.Flask", "line_number": 6, "usage_type": "call" }, { "api_name": "redis.Redis", "line_number": 7, "usage_type": "call" } ]
8635132151
# TODO : # ElasticSearch : 검색기능 구현(DB) # DRF Swagger(ysag) : API 문서화 작업용 # Celery(+Redis, + Naver SENS) : 문자인증을 위한 Naver SENS API 비동기 작동 # POSTMAN 설치 후 사용(DRF API Check) import json import os import random import datetime import calendar from django.contrib.auth import get_user_model from django.core.exceptions imp...
hanoul1124/healthcare2
app/members/apis.py
apis.py
py
7,757
python
ko
code
0
github-code
36
[ { "api_name": "django.contrib.auth.get_user_model", "line_number": 26, "usage_type": "call" }, { "api_name": "rest_framework.generics.CreateAPIView", "line_number": 29, "usage_type": "attribute" }, { "api_name": "rest_framework.generics", "line_number": 29, "usage_type": ...
8562919260
import time import threading import json import datetime from collections import deque import ctypes import os import UpbitWrapper from playsound import playsound ALARM_SWITCH = True SOUND_SWITCH = True def tdstr(td): days = "" hours = "" minutes = "" seconds = "0" ms = "" if td.days != 0: days = f"{td.days...
livelykitten/Coinwork
Document1.py
Document1.py
py
11,579
python
en
code
0
github-code
36
[ { "api_name": "collections.deque", "line_number": 47, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 68, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 68, "usage_type": "attribute" }, { "api_name": "dateti...
24684070432
# -*- coding: utf-8 -*- """ Created on Sat Aug 3 12:48:55 2019 @author: sudesh.amarnath """ import boto3 import os import glob import findspark findspark.init('/home/ubuntu/spark-2.1.1-bin-hadoop2.7') import pyspark from pyspark.sql import SparkSession spark = SparkSession.builder.appName('test').getOrCreate() from ...
sudeshg46/Phoenix
json_csv_extractor.py
json_csv_extractor.py
py
2,733
python
en
code
0
github-code
36
[ { "api_name": "findspark.init", "line_number": 12, "usage_type": "call" }, { "api_name": "pyspark.sql.SparkSession.builder.appName", "line_number": 15, "usage_type": "call" }, { "api_name": "pyspark.sql.SparkSession.builder", "line_number": 15, "usage_type": "attribute" ...
31414321307
import datetime import json from .base_test import BaseTestCase, LoggedActivity class EditLoggedActivityTestCase(BaseTestCase): """Edit activity test cases.""" def setUp(self): """Inherit parent tests setUp.""" super().setUp() # add tests logged activity and corresponding activity ...
andela/andela-societies-backend
src/tests/test_edit_logged_activity.py
test_edit_logged_activity.py
py
6,852
python
en
code
1
github-code
36
[ { "api_name": "base_test.BaseTestCase", "line_number": 6, "usage_type": "name" }, { "api_name": "json.dumps", "line_number": 28, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 35, "usage_type": "call" }, { "api_name": "base_test.LoggedActivity....
40393533142
#!/usr/bin/env python import argparse import random import numpy as np import pandas as pd from pathlib import Path import torch from torch import optim from torch import nn from torch import cuda import torchvision from uniform_augment import ImageTransform from model import load_model from train import train_model ...
yamaru12345/UniformAugment
main.py
main.py
py
2,045
python
en
code
0
github-code
36
[ { "api_name": "random.seed", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.random.seed", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 20, "usage_type": "attribute" }, { "api_name": "torch.manual_seed", ...
70955306664
""" Tests for scramble generation background tasks. """ from unittest.mock import Mock, patch, call import pytest from huey.exceptions import TaskException from cubersio.tasks import huey from cubersio.tasks.scramble_generation import check_scramble_pool, ScramblePoolTopOffInfo, top_off_scramble_pool from cubersio.u...
euphwes/cubers.io
tst/tasks/test_scramble_generation.py
test_scramble_generation.py
py
5,529
python
en
code
27
github-code
36
[ { "api_name": "cubersio.tasks.huey.immediate", "line_number": 13, "usage_type": "attribute" }, { "api_name": "cubersio.tasks.huey", "line_number": 13, "usage_type": "name" }, { "api_name": "unittest.mock.Mock", "line_number": 21, "usage_type": "call" }, { "api_nam...
23988137844
from fastapi import APIRouter import traceback from .nl_to_sql_utils import get_similar_severities, get_most_relevant_severity, get_sql_query from .nl_to_sql_prompts import tables_info from pydantic import BaseModel router = APIRouter() class NLtoSQL(BaseModel): """Request body for streaming.""" query: st...
yadneshSalvi/cybersec_genai
src/nl_to_sql/nl_to_sql_routes.py
nl_to_sql_routes.py
py
1,288
python
en
code
0
github-code
36
[ { "api_name": "fastapi.APIRouter", "line_number": 7, "usage_type": "call" }, { "api_name": "pydantic.BaseModel", "line_number": 9, "usage_type": "name" }, { "api_name": "nl_to_sql_utils.get_similar_severities", "line_number": 27, "usage_type": "call" }, { "api_nam...
14566383158
from django.core.management.base import BaseCommand from depot.models import SiteBookPublish class Command(BaseCommand): def handle(self, **options): for p in SiteBookPublish.objects.filter(status=0).order_by('created_at'): print(p.id, p.site_book, p.created_at) p.publish()
fnp/redakcja
src/depot/management/commands/depot.py
depot.py
py
314
python
en
code
4
github-code
36
[ { "api_name": "django.core.management.base.BaseCommand", "line_number": 5, "usage_type": "name" }, { "api_name": "depot.models.SiteBookPublish.objects.filter", "line_number": 7, "usage_type": "call" }, { "api_name": "depot.models.SiteBookPublish.objects", "line_number": 7, ...
71521743464
from konlpy.tag import Okt # 오픈 소스 한국어 분석기 # 속도는 느리지만, 정규화에 매우 좋음 from collections import Counter def NLP(text) : # Okt 형태소 분석기 객체 생성 okt = Okt() #text = "냉장고 앞에서 최면!" ''' # 형태소 추출 morphs = okt.morphs(text) print(morphs) # 형태소와 품사 태그 추출 pos = okt.pos(text) print(pos) ''' ...
Junst/KoNLPy-tTV
KoNLPy/KoNLPy_Okt.py
KoNLPy_Okt.py
py
1,218
python
ko
code
0
github-code
36
[ { "api_name": "konlpy.tag.Okt", "line_number": 8, "usage_type": "call" }, { "api_name": "collections.Counter", "line_number": 25, "usage_type": "call" } ]
70955299304
"""add unique constraint to solve for scramble and event results Revision ID: 5de7c9b4e68c Revises: 66f166a908a4 Create Date: 2019-10-13 13:11:53.915868 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '5de7c9b4e68c' down_revision = '66f166a908a4' branch_labels ...
euphwes/cubers.io
migrations/versions/039_5de7c9b4e68c_add_unique_constraint_to_solve_for_.py
039_5de7c9b4e68c_add_unique_constraint_to_solve_for_.py
py
924
python
en
code
27
github-code
36
[ { "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": "alembic.op.batch_alter_table", "line_number": 29, "usage_type": "call" }, { "api_name": "...
74267279783
import requests import time TIMEOUT: int = 1 ATTEMPTS: int = 3 def _get_base_headers() -> dict: """Get base header for request.""" return {"Content-Type": "application/json"} def _get(url: str, headers: dict, params: dict) -> requests.Response: """Send GET request to server.""" for _ in range(ATTE...
gordienko-dmitry/job_analyzer
api/server.py
server.py
py
961
python
en
code
1
github-code
36
[ { "api_name": "requests.Response", "line_number": 18, "usage_type": "attribute" }, { "api_name": "requests.get", "line_number": 18, "usage_type": "call" }, { "api_name": "requests.exceptions", "line_number": 20, "usage_type": "attribute" }, { "api_name": "time.sle...
15509801064
import numpy as np import geopandas import shapely class SparseGrid: def __init__(self, x_lim, y_lim, n_cols=10, n_rows=10, tag_prefix = ''): ''' General class to define a spatial frame composed of regular polygons, based on a grid of size n_cols x n_rows :param x_lim: Minimum an...
disarm-platform/disarm-gears
disarm_gears/frames/sparse_grid.py
sparse_grid.py
py
5,682
python
en
code
0
github-code
36
[ { "api_name": "numpy.diff", "line_number": 25, "usage_type": "call" }, { "api_name": "numpy.diff", "line_number": 26, "usage_type": "call" }, { "api_name": "numpy.linspace", "line_number": 34, "usage_type": "call" }, { "api_name": "numpy.linspace", "line_numbe...
14114323371
import setuptools with open("README.md", "r") as fh: long_description = fh.read() setuptools.setup( name="mktable2matrix", version="0.1.2", author="Guilherme Lucas", author_email="guilherme.slucas@gmail.com", description="Converts markdown table to Matrix", long_description=long_descripti...
Guilhermeslucas/mktable2matrix
setup.py
setup.py
py
646
python
en
code
1
github-code
36
[ { "api_name": "setuptools.setup", "line_number": 7, "usage_type": "call" }, { "api_name": "setuptools.find_packages", "line_number": 16, "usage_type": "call" } ]
73895270183
''' Author: airscker Date: 2022-09-21 18:43:31 LastEditors: airscker LastEditTime: 2023-08-31 12:23:45 Description: NULL Copyright (C) 2023 by Airscker(Yufeng), All Rights Reserved. ''' # Always prefer setuptools over distutils from setuptools import setup, find_packages import pathlib import os here =...
Airscker/DeepMuon
setup.py
setup.py
py
6,250
python
en
code
1
github-code
36
[ { "api_name": "pathlib.Path", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 21, "usage_type": "call" }, { "api_name": "os.path", "line_number": 21, "usage_type": "attribute" }, { "api_name": "setuptools.setup", "line_n...
25597505663
# Basic packages import pandas as pd import numpy as np import re import collections # import matplotlib.pyplot as plt from pathlib import Path # Packages for data preparation from sklearn.model_selection import train_test_split from nltk.corpus import stopwords from keras.preprocessing.text import Tokenizer from ker...
ntesh21/profanity-detection
train.py
train.py
py
7,843
python
en
code
0
github-code
36
[ { "api_name": "pathlib.Path", "line_number": 32, "usage_type": "call" }, { "api_name": "nltk.corpus.stopwords.words", "line_number": 127, "usage_type": "call" }, { "api_name": "nltk.corpus.stopwords", "line_number": 127, "usage_type": "name" }, { "api_name": "re.s...
35689287977
from utils.database import db from utils.database import Product as ProductDB, ProductSize as ProductSizes, ProductColor as ProductColors, SubCategories as SubCategoriesDB, Categories as CategoriesDB def get_products(id:int=None, search_string:str=None, category_item:str=None, subcategory_item:str=None) -> list: ...
holajoyceciao/MCloset
mystoreapp/py_files/models/product.py
product.py
py
5,389
python
en
code
0
github-code
36
[ { "api_name": "utils.database.db.session.query", "line_number": 9, "usage_type": "call" }, { "api_name": "utils.database.Product", "line_number": 9, "usage_type": "argument" }, { "api_name": "utils.database.db.session", "line_number": 9, "usage_type": "attribute" }, {...
73274037545
from django.urls import re_path from . import views urlpatterns = [ # Marketing TL # My tasks # re_path(r'^$', views.index), re_path(r'^marketingTL_dashboard$', views.marketingTL_dash, name="marketingTL_dashboard"), re_path(r'^mytasks$', views.marketingTL_mytasks, name="marketingTL_mytasks"), ...
Emil-20/infoxmain
marketingapp/urls.py
urls.py
py
4,392
python
en
code
1
github-code
36
[ { "api_name": "django.urls.re_path", "line_number": 10, "usage_type": "call" }, { "api_name": "django.urls.re_path", "line_number": 11, "usage_type": "call" }, { "api_name": "django.urls.re_path", "line_number": 12, "usage_type": "call" }, { "api_name": "django.ur...
41911943994
from django.shortcuts import render from .forms import * from django.http import HttpResponse import requests def index(request): #Making try-except block for excluding KeyError #This is made because in post request may be field which API cannot work with try: #accepting POST request film_t...
adilluos/Movie-Searcher
WebProject/taskmanager/main/views.py
views.py
py
3,026
python
en
code
0
github-code
36
[ { "api_name": "requests.request", "line_number": 25, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 69, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 71, "usage_type": "call" }, { "api_name": "djan...
70606654505
import multiprocessing import os import sys import time import warnings from datetime import date import akshare as ak import numpy as np import pandas as pd warnings.filterwarnings("ignore") # 输出显示设置 pd.set_option('max_rows', None) pd.set_option('max_columns', None) pd.set_option('expand_frame_repr', False) pd.set_o...
cgyPension/pythonstudy_space
05_quantitative_trading_mysql/ods/ods_financial_analysis_indicator_di.py
ods_financial_analysis_indicator_di.py
py
5,216
python
en
code
7
github-code
36
[ { "api_name": "warnings.filterwarnings", "line_number": 12, "usage_type": "call" }, { "api_name": "pandas.set_option", "line_number": 14, "usage_type": "call" }, { "api_name": "pandas.set_option", "line_number": 15, "usage_type": "call" }, { "api_name": "pandas.se...
10507399118
import argparse import sys import json import pickle import os import time status_colors_hex = { '200': '#6FB665', '204': '#4FA29F', '400': '#D8C726', '404': '#F06A2A', '406': '#78CAEF', '414': '#86F6D2', '500': '#043E8A', '502': '#A81E03', } def fetch_input(stats_file): file_reso...
stefanooldeman/gecko_http_codes
update_graph_data.py
update_graph_data.py
py
6,440
python
en
code
1
github-code
36
[ { "api_name": "os.path.isfile", "line_number": 87, "usage_type": "call" }, { "api_name": "os.path", "line_number": 87, "usage_type": "attribute" }, { "api_name": "pickle.load", "line_number": 90, "usage_type": "call" }, { "api_name": "sys.stderr.write", "line_...
26319259400
""" Module determining pilot certifications, ratings, and endorsements. The restrictions that we place on a pilot depend on their qualifications. There are three ways to think about a pilot. (1) Certifications. These are what licenses a pilot has. We also use these to classify where the student is in the licensing...
ChrisMJordan/eCornell_Cert_Project
pilots.py
pilots.py
py
16,872
python
en
code
0
github-code
36
[ { "api_name": "utils.str_to_time", "line_number": 87, "usage_type": "call" }, { "api_name": "utils.str_to_time", "line_number": 193, "usage_type": "call" }, { "api_name": "utils.str_to_time", "line_number": 217, "usage_type": "call" }, { "api_name": "utils.str_to_...
70846346343
import models.data import models.email_notice from flask import Flask, request, render_template, redirect, flash, url_for, session, abort app = Flask(__name__, static_url_path='', root_path='/root/SPM') @app.route('/') def index(): return app.send_static_file('index.html') @app.route('/user_view') def user_vie...
Elfsong/SPM
demo.py
demo.py
py
5,888
python
en
code
1
github-code
36
[ { "api_name": "flask.Flask", "line_number": 5, "usage_type": "call" }, { "api_name": "flask.session.get", "line_number": 15, "usage_type": "call" }, { "api_name": "flask.session", "line_number": 15, "usage_type": "name" }, { "api_name": "flask.redirect", "line...
29053052757
from db import session, UniqueVictims, Victims from sqlalchemy.sql import func def calc_totals(): """ Calculate the total time frame the IP appears in and the udp/tcp/icmp packet count as well as the packets/s rate :return: """ all_victims = session.query(UniqueVictims).all() for victim i...
Kbman99/DDoS-Detection
calculate.py
calculate.py
py
934
python
en
code
1
github-code
36
[ { "api_name": "db.session.query", "line_number": 11, "usage_type": "call" }, { "api_name": "db.UniqueVictims", "line_number": 11, "usage_type": "argument" }, { "api_name": "db.session", "line_number": 11, "usage_type": "name" }, { "api_name": "db.session.query", ...
71809107943
# Import files from ScrapingProducts.AmazonRateLimiterException import AmazonRateLimiterException from Utilities.Utils import get_page_source from Utilities.MetadataUtils import * # Import libraries from bs4 import BeautifulSoup import logging as logger import time AMAZON_ERROR = "Sorry! Something went wrong on our e...
Yogesh19921/Scrapper
CollectingProducts/Crawl.py
Crawl.py
py
1,798
python
en
code
0
github-code
36
[ { "api_name": "Utilities.Utils.get_page_source", "line_number": 16, "usage_type": "call" }, { "api_name": "ScrapingProducts.AmazonRateLimiterException.AmazonRateLimiterException", "line_number": 19, "usage_type": "name" }, { "api_name": "bs4.BeautifulSoup", "line_number": 21,...
36060739387
from lxml import html import requests # Define parsing function def parse(score): return float(score[2:score.index('-')]) def scrape(league_id): # Store scores in list league_scores = [] # Loop through each team for team_id in range(1, 13): # Make request page = requests.get('http://games.espn.go.com/ffl/s...
JonathanWarrick/data-viz-web-crawler
web_scraper.py
web_scraper.py
py
987
python
en
code
0
github-code
36
[ { "api_name": "requests.get", "line_number": 15, "usage_type": "call" }, { "api_name": "lxml.html.fromstring", "line_number": 16, "usage_type": "call" }, { "api_name": "lxml.html", "line_number": 16, "usage_type": "name" } ]
3353061598
import time import redis from django.core.management import BaseCommand from django.conf import settings class Command(BaseCommand): def handle(self, *args, **options): self.stdout.write('Waiting for Redis...') redis_instance = redis.StrictRedis(host=settings.REDIS_HOST, ...
MykKos/discord_automated_sender
discord_posts/management/commands/check_on_redis.py
check_on_redis.py
py
671
python
en
code
0
github-code
36
[ { "api_name": "django.core.management.BaseCommand", "line_number": 7, "usage_type": "name" }, { "api_name": "redis.StrictRedis", "line_number": 11, "usage_type": "call" }, { "api_name": "django.conf.settings.REDIS_HOST", "line_number": 11, "usage_type": "attribute" }, ...
3751805748
from __future__ import print_function, division from torch.utils.data import Dataset, DataLoader import scipy.io as scp from keras.utils import to_categorical import numpy as np import torch from matplotlib import pyplot as plt import warnings warnings.filterwarnings("ignore") from matplotlib import pyplot as plt from ...
affect2mm/emotion-timeseries
emotion-timeseries/MovieGraphs/utils_co_attn.py
utils_co_attn.py
py
9,455
python
en
code
12
github-code
36
[ { "api_name": "warnings.filterwarnings", "line_number": 9, "usage_type": "call" }, { "api_name": "torch.utils.data.Dataset", "line_number": 40, "usage_type": "name" }, { "api_name": "numpy.array", "line_number": 50, "usage_type": "call" }, { "api_name": "numpy.arr...
22477753948
import numpy as np from sklearn.neighbors import KNeighborsClassifier from sklearn.tree import DecisionTreeClassifier from sklearn.naive_bayes import GaussianNB from sklearn.svm import SVC from sklearn import model_selection as sk_ms from sklearn.model_selection import train_test_split from sklearn.metrics import auc,...
mailaucq/book_classification
classifierv2.py
classifierv2.py
py
1,771
python
en
code
0
github-code
36
[ { "api_name": "sklearn.tree.DecisionTreeClassifier", "line_number": 22, "usage_type": "call" }, { "api_name": "sklearn.neighbors.KNeighborsClassifier", "line_number": 23, "usage_type": "call" }, { "api_name": "sklearn.naive_bayes.GaussianNB", "line_number": 24, "usage_typ...
15596107022
import os import traceback from . import datasets from . import tasks from . import util from logging import getLogger logger = getLogger('mrs') class WorkerSetupRequest(object): """Request the worker to run the setup function.""" def __init__(self, opts, args, default_dir): self.id = 'worker_setup...
byu-aml-lab/mrs-mapreduce
mrs/worker.py
worker.py
py
7,442
python
en
code
3
github-code
36
[ { "api_name": "logging.getLogger", "line_number": 9, "usage_type": "call" }, { "api_name": "traceback.format_exc", "line_number": 143, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 154, "usage_type": "call" } ]
44037875301
from flask import Blueprint, request, jsonify from flask_cors import CORS from storeback.models import db from storeback.models.admins import Admin admin_api = Blueprint('admin_api', __name__) CORS(admin_api) @admin_api.route('/api/admin', methods=['GET']) def get_all_admins(): params = request.args admins = ...
rguan72/StoreBack
storeback/handlers/admin.py
admin.py
py
1,682
python
en
code
2
github-code
36
[ { "api_name": "flask.Blueprint", "line_number": 6, "usage_type": "call" }, { "api_name": "flask_cors.CORS", "line_number": 7, "usage_type": "call" }, { "api_name": "flask.request.args", "line_number": 11, "usage_type": "attribute" }, { "api_name": "flask.request",...
18458121758
from __future__ import unicode_literals import datetime import cairo import pycha.line import StringIO import time import six from uds.models import getSqlDatetime import counters # Chart types CHART_TYPE_LINE, CHART_TYPE_AREA, CHART_TYPE_BAR = range(3) # @UndefinedVariable __typeTitles = None def make(obj, cou...
karthik-arjunan/testuds
server/src/uds/core/util/stats/charts.py
charts.py
py
2,497
python
en
code
1
github-code
36
[ { "api_name": "uds.models.getSqlDatetime", "line_number": 29, "usage_type": "call" }, { "api_name": "datetime.timedelta", "line_number": 30, "usage_type": "call" }, { "api_name": "time.mktime", "line_number": 34, "usage_type": "call" }, { "api_name": "counters.get...
75173901865
"""Read a numpy file and output an image.""" import sys import numpy as np from PIL import Image def main(filename): depth_array = np.load(filename) print(depth_array.shape) if np.max(depth_array) > 255: print("Values over 255! There is going to be truncations") depth_array = np.clip(de...
squeakus/bitsandbytes
blenderscripts/npy2img.py
npy2img.py
py
677
python
en
code
2
github-code
36
[ { "api_name": "numpy.load", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.max", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.clip", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.uint8", "line_number": 17, ...
36121229353
import os from typing import Any, Iterator, Dict, Set from forte.data.data_pack import DataPack from forte.data.data_utils_io import dataset_path_iterator from forte.data.base_reader import PackReader from ft.onto.base_ontology import Document __all__ = [ "PlainTextReader", ] class PlainTextReader(PackReader): ...
asyml/forte
forte/data/readers/plaintext_reader.py
plaintext_reader.py
py
1,931
python
en
code
230
github-code
36
[ { "api_name": "forte.data.base_reader.PackReader", "line_number": 14, "usage_type": "name" }, { "api_name": "forte.data.data_utils_io.dataset_path_iterator", "line_number": 27, "usage_type": "call" }, { "api_name": "typing.Iterator", "line_number": 17, "usage_type": "name...
30112355766
import os import wikipedia from nltk.tag.stanford import StanfordPOSTagger from nltk.tokenize import sent_tokenize from nltk.tokenize import word_tokenize from nltk.stem import WordNetLemmatizer from nltk.corpus import wordnet import matplotlib.pyplot as plt os.environ["JAVAHOME"] = "C:\\Program Files (x86)\\Common F...
daneel95/Master_Homework
Restanta/NLP/Lab3/homework1.py
homework1.py
py
4,985
python
en
code
0
github-code
36
[ { "api_name": "os.environ", "line_number": 11, "usage_type": "attribute" }, { "api_name": "nltk.tag.stanford.StanfordPOSTagger", "line_number": 15, "usage_type": "call" }, { "api_name": "wikipedia.page", "line_number": 19, "usage_type": "call" }, { "api_name": "nl...
21619670691
import unittest from mock import Mock from apache_beam.metrics.cells import DistributionData from apache_beam.runners.google_cloud_dataflow.dataflow_runner import DataflowRunner from apache_beam.runners.google_cloud_dataflow.internal import apiclient from apache_beam.runners.google_cloud_dataflow.internal.clients imp...
a0x8o/kafka
sdks/python/apache_beam/runners/google_cloud_dataflow/internal/apiclient_test.py
apiclient_test.py
py
2,815
python
en
code
59
github-code
36
[ { "api_name": "unittest.TestCase", "line_number": 12, "usage_type": "attribute" }, { "api_name": "apache_beam.utils.pipeline_options.PipelineOptions", "line_number": 16, "usage_type": "call" }, { "api_name": "apache_beam.runners.google_cloud_dataflow.internal.apiclient.DataflowAp...
14838409343
import json import random import re import pubchempy as pcp from csv_to_json import formulate_code # -------- \begin constants ---------------------- atoms_list = [" Hydrogen ", " Helium ", " Lithium ", " Beryllium ", " Boron ", " Carbon ", ...
arrafmousa/generate_code
generate_questiontion_with_chempy.py
generate_questiontion_with_chempy.py
py
25,754
python
en
code
0
github-code
36
[ { "api_name": "re.search", "line_number": 137, "usage_type": "call" }, { "api_name": "re.search", "line_number": 140, "usage_type": "call" }, { "api_name": "re.findall", "line_number": 142, "usage_type": "call" }, { "api_name": "re.findall", "line_number": 143...
74473073385
import urllib.request, urllib.parse import bs4 as BeautifulSoup # 建立与用户以及网络的会话 base = input("Enter the URL: ") try: page = urllib.request.urlopen(base) except: print("Cannot open %s" % base) quit() # 准备soup soup = BeautifulSoup.BeautifulSoup(page) # 提取链接,并用(名称,网址)的元组表示 links = [(link.string, link['href']...
zhanwen/PythonDataScience
chapter3/practice/Solution_Broken_link.py
Solution_Broken_link.py
py
1,067
python
en
code
20
github-code
36
[ { "api_name": "urllib.request.request.urlopen", "line_number": 7, "usage_type": "call" }, { "api_name": "urllib.request.request", "line_number": 7, "usage_type": "attribute" }, { "api_name": "urllib.request", "line_number": 7, "usage_type": "name" }, { "api_name":...
6171283144
import matplotlib.pyplot as plt import numpy as np from numpy import * from mpl_toolkits import mplot3d import random # Presets ax = plt.axes(projection='3d') def randomcolor(): colorArr = ['1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'] color = "" for i in range(6): co...
RS-gty/GTY_Chemistry
Group.py
Group.py
py
1,802
python
en
code
0
github-code
36
[ { "api_name": "matplotlib.pyplot.axes", "line_number": 8, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 8, "usage_type": "name" }, { "api_name": "random.randint", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.cos", ...
14431724379
#from ast import If #from pprint import pp #from typing import final from doctest import master from multiprocessing.reduction import duplicate import re import string from struct import pack from unittest import result from tokens import tokens from tkinter import * from tkinter import ttk #from Interfaz import da...
AngelHernandez20/191180-191280
analizadorlexico.py
analizadorlexico.py
py
5,673
python
es
code
0
github-code
36
[ { "api_name": "tokens.tokens", "line_number": 24, "usage_type": "name" }, { "api_name": "tokens.tokens.reservadas", "line_number": 34, "usage_type": "attribute" }, { "api_name": "tokens.tokens", "line_number": 34, "usage_type": "name" }, { "api_name": "tokens.toke...
71234511143
#!/usr/bin/env python # # An example on how to read the YAML output from etisnoop # Pipe etisnoop to this script # # License: public domain import sys import yaml for frame in yaml.load_all(sys.stdin): print("FIGs in frame {}".format(frame['Frame'])) for fib in frame['LIDATA']['FIC']: if fib['FIGs']: ...
Opendigitalradio/etisnoop
yamlexample.py
yamlexample.py
py
401
python
en
code
8
github-code
36
[ { "api_name": "yaml.load_all", "line_number": 11, "usage_type": "call" }, { "api_name": "sys.stdin", "line_number": 11, "usage_type": "attribute" } ]
71514879785
import sys import time import numpy as np import torch import torch.nn as nn class RewardTracker: def __init__(self, writer, stop_reward, group_rewards=1): self.writer = writer self.stop_reward = stop_reward self.reward_buf = [] self.steps_buf = [] self.group_rewards = gro...
a046829713/DQNStockSysteam
lib/common.py
common.py
py
5,518
python
en
code
0
github-code
36
[ { "api_name": "time.time", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.mean", "line_number": 33, "usage_type": "call" }, { "api_name": "numpy.mean", "line_number": 34, "usage_type": "call" }, { "api_name": "time.time", "line_number": 39, ...
26224523041
import xml.etree.ElementTree as ET import time import requests class BaseAPIConnector(object): def __init__(self, user_agent='', verbose=False): self.user_agent = user_agent self.verbose = verbose def construct_url(self): return None def html_request(self): if self.user_...
TheOneWho/EveCommonLibrary
EveCommon/BaseAPIConnector.py
BaseAPIConnector.py
py
1,149
python
en
code
0
github-code
36
[ { "api_name": "requests.get", "line_number": 27, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 30, "usage_type": "call" }, { "api_name": "xml.etree.ElementTree.fromstring", "line_number": 39, "usage_type": "call" }, { "api_name": "xml.etree.El...
20026451101
from hashlib import sha1 import time import json from pulsar import get_actor, Future from pulsar.apps.wsgi import WSGIServer, WsgiResponse, WsgiHandler import aio_etcd as etcd from jirachi.io.abstract import JirachiMonitor, JirachiMonitorNotFound from pulsar.apps.wsgi import Router __all__ = ['RemoteMonitorWSGI'] bl...
RyanKung/jirachi
jirachi/io/remote/monitor.py
monitor.py
py
2,379
python
en
code
3
github-code
36
[ { "api_name": "pulsar.apps.wsgi.Router", "line_number": 12, "usage_type": "call" }, { "api_name": "hashlib.sha1", "line_number": 17, "usage_type": "call" }, { "api_name": "time.time", "line_number": 17, "usage_type": "call" }, { "api_name": "pulsar.get_actor", ...
35260765665
from binaryninja import * import xxhash ################################################################################################################ # MLIL Instruction # ####################################################...
CySHell/Binja4J
Core/extraction_helpers/Instruction.py
Instruction.py
py
2,116
python
en
code
15
github-code
36
[ { "api_name": "xxhash.xxh64", "line_number": 25, "usage_type": "call" } ]
30473232781
from selenium import webdriver from selenium.common.exceptions import NoSuchElementException from selenium.webdriver.common.keys import Keys from tkinter import messagebox import time import os from App.Login import username, password, security_question class Core: def __init__(self, file_path, driver): ...
abdlalisalmi/UpWork-Select-Checkbox-in-a-Web-Page-with-Python-Selenium
App/Core.py
Core.py
py
2,090
python
en
code
1
github-code
36
[ { "api_name": "os.path.split", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path", "line_number": 17, "usage_type": "attribute" }, { "api_name": "selenium.common.exceptions.NoSuchElementException", "line_number": 25, "usage_type": "name" }, { "api_...
30990966321
# need to implement CSRF from rest_framework.authentication import CSRFCheck from rest_framework_simplejwt.authentication import JWTAuthentication from rest_framework import exceptions from channels.db import database_sync_to_async from server.settings import SIMPLE_JWT from django.core.exceptions import ObjectDoesNotE...
Kredam/MyRoom
back-end/server/api/authentication.py
authentication.py
py
2,167
python
en
code
2
github-code
36
[ { "api_name": "rest_framework.authentication.CSRFCheck", "line_number": 16, "usage_type": "call" }, { "api_name": "rest_framework.exceptions.PermissionDenied", "line_number": 20, "usage_type": "call" }, { "api_name": "rest_framework.exceptions", "line_number": 20, "usage_...
15969653865
#!/usr/bin/env python ## Test an algorithm in real life import sys if sys.version_info[0] != 3 or sys.version_info[1] < 6: print("This script requires Python version >=3.6") sys.exit(1) import algorithms import datetime import exchange import pandas_market_calendars as mcal import portfolioLive ## Main function d...
WattsUp/PyStonks
stonks/live.py
live.py
py
810
python
en
code
2
github-code
36
[ { "api_name": "sys.version_info", "line_number": 4, "usage_type": "attribute" }, { "api_name": "sys.exit", "line_number": 6, "usage_type": "call" }, { "api_name": "datetime.date.today", "line_number": 16, "usage_type": "call" }, { "api_name": "datetime.date", ...
13346852826
from osgeo import gdalnumeric from osgeo import osr from osgeo import gdal from osgeo.gdal_array import * from osgeo.gdalconst import * from PIL import Image import pylab as P import os import numpy as np from IPython.core.debugger import set_trace def readData(filename, ndtype=np.float64): ''' z=readData(...
bosmanoglu/adore-doris
lib/python/gis.py
gis.py
py
21,211
python
en
code
13
github-code
36
[ { "api_name": "numpy.float64", "line_number": 12, "usage_type": "attribute" }, { "api_name": "os.path.isfile", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path", "line_number": 16, "usage_type": "attribute" }, { "api_name": "osgeo.gdal.Open", ...
31746754037
from django.core.exceptions import ValidationError from rest_framework import serializers from reviews.models import Category, Comment, Genre, Review, Title, User class ConfirmationTokenSerializer(serializers.Serializer): """Serializing verification data to provide full user registration""" username = seria...
GenVas/yamdb_final
api/serializers.py
serializers.py
py
3,954
python
en
code
1
github-code
36
[ { "api_name": "rest_framework.serializers.Serializer", "line_number": 7, "usage_type": "attribute" }, { "api_name": "rest_framework.serializers", "line_number": 7, "usage_type": "name" }, { "api_name": "rest_framework.serializers.CharField", "line_number": 10, "usage_type...
18664116649
from pathlib import Path import joblib IS_KAGGLE = True if IS_KAGGLE: DATA_DIR = Path("/kaggle/working/chap5-data") OUTPUT_DIR = Path("/kaggle/working/") else: DATA_DIR = Path("../data") # Path(os.getenv("QQP_DATA_DIR", "/data")) OUTPUT_DIR = Path("../outputs") INPUT_DIR = DATA_DIR / "input" TRAIN_...
room-208/Kaggle-Gokui-Book
chap5/common/constants.py
constants.py
py
708
python
en
code
0
github-code
36
[ { "api_name": "pathlib.Path", "line_number": 8, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 9, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 11, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number"...
72056734183
from warnings import filters from billing.billing.api.sales_invoice.create_sales_invoice import re_eveluate_sales_orders # from billing.billing.utils.payment_notifications import get_party_phone import frappe from datetime import date from frappe.utils.background_jobs import enqueue from frappe.utils.data import nowda...
mudux/lims
lims/doc_hooks/lab_test.py
lab_test.py
py
11,016
python
en
code
0
github-code
36
[ { "api_name": "datetime.date.today", "line_number": 12, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 12, "usage_type": "name" }, { "api_name": "frappe.db.get_value", "line_number": 17, "usage_type": "call" }, { "api_name": "frappe.db", ...
40423351728
from django.urls import path, include from . import views from rest_framework import routers route = routers.DefaultRouter() route.register("user", views.UserViewSet, basename='user') route.register("tuyenxe", views.TuyenXeViewset, basename='tuyenxe') route.register("chuyenxe", views.ChuyenXeViewset, basename='chuyen...
TamHoang1512/backend-django
QuanLyXeKhach/quanly/urls.py
urls.py
py
595
python
en
code
0
github-code
36
[ { "api_name": "rest_framework.routers.DefaultRouter", "line_number": 6, "usage_type": "call" }, { "api_name": "rest_framework.routers", "line_number": 6, "usage_type": "name" }, { "api_name": "django.urls.path", "line_number": 15, "usage_type": "call" }, { "api_na...
15733574091
from __future__ import absolute_import from __future__ import division from __future__ import print_function import re import os import copy import yaml from enum import Enum from utils.util import mace_check from utils.util import MaceLogger from py_proto import mace_pb2 CPP_KEYWORDS = [ 'alignas', 'alignof', '...
SheepHuan/CoDL-Mace
codl-mobile/tools/python/utils/config_parser.py
config_parser.py
py
10,751
python
en
code
0
github-code
36
[ { "api_name": "re.sub", "line_number": 40, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 43, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 43, "usage_type": "attribute" }, { "api_name": "yaml.load", "line_number": 44, ...
45097764726
# -*- coding: utf-8 -*- """ Created on Fri Jul 24 18:29:51 2020 @author: rosaz """ import argparse import sys import errno import os import json import numpy as np from matplotlib import pyplot as plt from numpy import array import torch import jsonschema from torch.nn import functional as F def writeJsonNorma(path,...
rroosa/machineL
ProjectCode/file_prove.py
file_prove.py
py
18,111
python
en
code
0
github-code
36
[ { "api_name": "os.path.exists", "line_number": 24, "usage_type": "call" }, { "api_name": "os.path", "line_number": 24, "usage_type": "attribute" }, { "api_name": "json.dump", "line_number": 27, "usage_type": "call" }, { "api_name": "json.load", "line_number": ...
34002187294
import os from app import app from flask import Flask, flash, request, redirect, url_for, render_template from werkzeug.utils import secure_filename from pneumonia_prediction import predict import tensorflow as tf ALLOWED_EXTENSIONS = set(['png', 'jpg', 'jpeg']) os.environ["CUDA_VISIBLE_DEVICES"]="-1" physical_de...
Nathanael-Mariaule/Pneumonia_Detection
flask_app/main.py
main.py
py
1,710
python
en
code
0
github-code
36
[ { "api_name": "os.environ", "line_number": 12, "usage_type": "attribute" }, { "api_name": "tensorflow.config.list_physical_devices", "line_number": 13, "usage_type": "call" }, { "api_name": "tensorflow.config", "line_number": 13, "usage_type": "attribute" }, { "ap...
31062929205
from ..utils import Object class ChatStatisticsMessageSenderInfo(Object): """ Contains statistics about messages sent by a user Attributes: ID (:obj:`str`): ``ChatStatisticsMessageSenderInfo`` Args: user_id (:obj:`int`): User identifier sent_message_count (:obj:...
iTeam-co/pytglib
pytglib/api/types/chat_statistics_message_sender_info.py
chat_statistics_message_sender_info.py
py
1,244
python
en
code
20
github-code
36
[ { "api_name": "utils.Object", "line_number": 6, "usage_type": "name" } ]
40568587585
from datetime import datetime from typing import Optional from dcs.mission import Mission from game.weather.atmosphericconditions import AtmosphericConditions from game.weather.clouds import Clouds from game.weather.conditions import Conditions from game.weather.fog import Fog from game.weather.wind import WindCondit...
dcs-liberation/dcs_liberation
game/missiongenerator/environmentgenerator.py
environmentgenerator.py
py
2,028
python
en
code
647
github-code
36
[ { "api_name": "dcs.mission.Mission", "line_number": 15, "usage_type": "name" }, { "api_name": "game.weather.conditions.Conditions", "line_number": 15, "usage_type": "name" }, { "api_name": "datetime.datetime", "line_number": 15, "usage_type": "name" }, { "api_name...
6245629363
# -*- coding: utf-8 -*- from setuptools import setup, find_packages from setuptools.command.test import test as TestCommand class PyTest(TestCommand): ptest_args = [] def initialize_options(self): TestCommand.initialize_options(self) self.pytest_args = [] def run(self): import p...
magichan-lab/PyIEProxy
setup.py
setup.py
py
1,119
python
en
code
0
github-code
36
[ { "api_name": "setuptools.command.test.test", "line_number": 7, "usage_type": "name" }, { "api_name": "setuptools.command.test.test.initialize_options", "line_number": 11, "usage_type": "call" }, { "api_name": "setuptools.command.test.test", "line_number": 11, "usage_type...
72573548584
import torch import torchaudio import glob from torch.utils.data import Dataset from utils.signal_processing import get_rnd_audio,extract_label_bat from pandas import read_csv from os import path class raw_audio_dataset(Dataset): def __init__(self,wav_dir, annotation_file, input_size, transform=None, target_t...
ArthurZucker/PAMAI
datasets/raw_audio_dataset.py
raw_audio_dataset.py
py
1,409
python
en
code
5
github-code
36
[ { "api_name": "torch.utils.data.Dataset", "line_number": 9, "usage_type": "name" }, { "api_name": "pandas.read_csv", "line_number": 15, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path.join"...
13058059804
from string import printable from keras.models import Model, load_model from keras import regularizers from keras.layers.core import Dense, Dropout, Lambda from keras.layers import Input, ELU, Embedding, \ BatchNormalization, Convolution1D,concatenate from keras.preprocessing import sequence from keras.optimizers im...
larranaga/phishing-url-detection
CNNC.py
CNNC.py
py
3,833
python
en
code
5
github-code
36
[ { "api_name": "keras.regularizers.l2", "line_number": 17, "usage_type": "call" }, { "api_name": "keras.regularizers", "line_number": 17, "usage_type": "name" }, { "api_name": "keras.callbacks.CSVLogger", "line_number": 19, "usage_type": "call" }, { "api_name": "ke...
11316424779
import json import re from pprint import pprint with open('yc_feed.json') as data_file: data = json.load(data_file) i = 0 c = 0 for hundredmessages in data: hm_plain_text = json.dumps(hundredmessages) match = re.search(r'hackathon', hm_plain_text) if match: for msg in hundredmessages['data']: msg_...
adamhipster/hackathon_website
python_fb_group_crawls/parse_fb_feed_data.py
parse_fb_feed_data.py
py
530
python
en
code
0
github-code
36
[ { "api_name": "json.load", "line_number": 6, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 11, "usage_type": "call" }, { "api_name": "re.search", "line_number": 12, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 15, ...
43540671742
""" """ import numpy as np from scipy.signal import find_peaks_cwt from scipy.ndimage import gaussian_filter1d def peak_finder( curve:np.ndarray, smoothing_factor:float=21.0, )->np.ndarray: """ """ min_width = int(curve.size/20) max_width = int(curve.size/5) resolution = int((max_width...
chriswilly/design_patterns
data_science/misc.py
misc.py
py
528
python
en
code
1
github-code
36
[ { "api_name": "numpy.ndarray", "line_number": 9, "usage_type": "attribute" }, { "api_name": "numpy.arange", "line_number": 17, "usage_type": "call" }, { "api_name": "scipy.ndimage.gaussian_filter1d", "line_number": 19, "usage_type": "call" }, { "api_name": "scipy....
27769169402
import scrapy from scrapy.linkextractors import LinkExtractor from scrapy.spiders import CrawlSpider, Rule class XyjjSpider(CrawlSpider): name = 'xyjj' # allowed_domains = ['www.ccc.com'] start_urls = ['https://www.xyshjj.cn/list-1487-1489-0.html'] # page链接与其他链接相似度过高 rules不起作用,放弃。 rules = ( ...
kshsky/PycharmProjects
dataFile/scrapy/ace/xxjjCrawl/xxjjCrawl/spiders/xyjj.py
xyjj.py
py
992
python
en
code
0
github-code
36
[ { "api_name": "scrapy.spiders.CrawlSpider", "line_number": 6, "usage_type": "name" }, { "api_name": "scrapy.spiders.Rule", "line_number": 12, "usage_type": "call" }, { "api_name": "scrapy.linkextractors.LinkExtractor", "line_number": 12, "usage_type": "call" } ]
28068050082
# 보물섬 # https://www.acmicpc.net/problem/2589 from collections import deque import copy def bfs(treasure_map, x, y, n, m) : copy_map = copy.deepcopy(treasure_map) dx = [-1, 1, 0, 0] dy = [0, 0, -1, 1] # 시작 지점과 탐색해나가는 지점과의 거리 저장 변수 count = 0 queue = deque([[x, y, count]]) copy_map[x][y] = ...
hwanginbeom/algorithm_study
1.algorithm_question/6.BFS/131.BFS_wooseok.py
131.BFS_wooseok.py
py
1,279
python
ko
code
3
github-code
36
[ { "api_name": "copy.deepcopy", "line_number": 8, "usage_type": "call" }, { "api_name": "collections.deque", "line_number": 15, "usage_type": "call" } ]
28801077672
# -*- coding: utf-8 -*- """ Created on Thu Feb 1 09:03:59 2018 @author: a001985 """ import logging import pathlib #========================================================================== def add_log(log_id=None, log_directory=None, log_level='DEBUG', on_screen=True, prefix='log_ekostat'): """ log...
ekostat/ekostat_calculator
core/logger.py
logger.py
py
3,803
python
en
code
1
github-code
36
[ { "api_name": "logging.getLogger", "line_number": 39, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 50, "usage_type": "attribute" }, { "api_name": "logging.INFO", "line_number": 51, "usage_type": "attribute" }, { "api_name": "logging.WARNIN...
34848625388
from __future__ import absolute_import from __future__ import unicode_literals __version__ = '0.5.0' from markdown import Extension from markdown.treeprocessors import Treeprocessor class MDXReplaceImageSrcTreeprocessor(Treeprocessor): def __init__(self, md, config): super(MDXReplaceImageSrcTreeprocesso...
twardoch/markdown-steroids
mdx_steroids/replimgsrc.py
replimgsrc.py
py
1,313
python
en
code
3
github-code
36
[ { "api_name": "markdown.treeprocessors.Treeprocessor", "line_number": 10, "usage_type": "name" }, { "api_name": "markdown.Extension", "line_number": 23, "usage_type": "name" } ]
7045186193
#!/usr/bin/python3 import argparse import orbslam2 import os import cv2 from time import sleep def build_parser(): parser = argparse.ArgumentParser() parser.add_argument('--vocab', type=str, required=True) parser.add_argument('--config', type=str, required=True) parser.add_argument('--seq', type=str...
cds-mipt/iprofihack
baselines/orbslam2/scripts/run_orbslam2_stereo.py
run_orbslam2_stereo.py
py
2,114
python
en
code
3
github-code
36
[ { "api_name": "argparse.ArgumentParser", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 21, "usage_type": "call" }, { "api_name": "os.path", "line_number": 21, "usage_type": "attribute" }, { "api_name": "os.path.join", ...
33675586325
#!/usr/bin/env python # coding: utf-8 # In[44]: import re import pickle from sklearn_crfsuite import CRF from sklearn_crfsuite import metrics from sklearn_crfsuite import scorers # In[45]: def parse(input_): tags = [] lexicons = [] lemma = [] pos= [] sentences = input_.split("\n\n") for s...
hellomasaya/linguistics-data
assgn4/annCorraCRFModel.py
annCorraCRFModel.py
py
3,577
python
en
code
0
github-code
36
[ { "api_name": "re.match", "line_number": 55, "usage_type": "call" }, { "api_name": "sklearn_crfsuite.CRF", "line_number": 88, "usage_type": "call" }, { "api_name": "pickle.dump", "line_number": 96, "usage_type": "call" }, { "api_name": "sklearn_crfsuite.metrics.fl...
72582014823
import spotipy import openai import json import argparse import datetime from dotenv import load_dotenv import os load_dotenv() openai.api_key = os.environ.get("OPENAI_API_KEY") parser = argparse.ArgumentParser(description="Enkelt commandline verktøy") parser.add_argument("-p", type=str, default="AI genert liste",he...
donadelicc/MySpotify
utils/local_app.py
local_app.py
py
3,072
python
en
code
0
github-code
36
[ { "api_name": "dotenv.load_dotenv", "line_number": 9, "usage_type": "call" }, { "api_name": "openai.api_key", "line_number": 10, "usage_type": "attribute" }, { "api_name": "os.environ.get", "line_number": 10, "usage_type": "call" }, { "api_name": "os.environ", ...
30910231452
import sys from PyQt5 import uic from PyQt5.QtGui import QPainter, QColor from PyQt5.QtWidgets import QWidget, QApplication, QPushButton, QMainWindow from random import randint class MyWidget(QMainWindow): def __init__(self): super().__init__() uic.loadUi('Ui.ui', self) self.do_paint = Fa...
Dathator/Git-
main.py
main.py
py
870
python
en
code
0
github-code
36
[ { "api_name": "PyQt5.QtWidgets.QMainWindow", "line_number": 9, "usage_type": "name" }, { "api_name": "PyQt5.uic.loadUi", "line_number": 12, "usage_type": "call" }, { "api_name": "PyQt5.uic", "line_number": 12, "usage_type": "name" }, { "api_name": "PyQt5.QtGui.QPa...
74469828583
#! /usr/bin/env python3 import logging import os import tempfile log = logging.getLogger(__name__) def download_to_disk(config, object_ref): log.debug('Moving file from {} to temporary file'.format(object_ref)) fd, path = tempfile.mkstemp(os.path.splitext(object_ref)[-1]) os.write(fd, open(object_ref, '...
mabruras/sqapi
src/sqapi/query/content/disk.py
disk.py
py
367
python
en
code
2
github-code
36
[ { "api_name": "logging.getLogger", "line_number": 6, "usage_type": "call" }, { "api_name": "tempfile.mkstemp", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path.splitext", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path", "lin...
21821135553
# F*ck implementation problems # Ab to kaam hoja bsdk # Adding comments so it might be helpful to someone ## Moral: Don't watch IPL during contest from collections import Counter for _ in range(int(input())): n = int(input()) lis = list(map(int, input().split())) ## Check for NO condition counter = Counter...
sainad2222/my_cp_codes
codeforces/1433/D.py
D.py
py
1,155
python
en
code
0
github-code
36
[ { "api_name": "collections.Counter", "line_number": 10, "usage_type": "call" } ]
70123922664
#! /usr/bin/env python from sortrobot.mech import Robot from sortrobot.webcam import Camera from sortrobot.neural import Classifier, OrientationClassifier from sortrobot.utils import random_filename import numpy as np from PIL import Image import sys, random, os from optparse import OptionParser parser = OptionParser...
AaronParsons/sortrobot
scripts/sr_neural_sort.py
sr_neural_sort.py
py
2,532
python
en
code
0
github-code
36
[ { "api_name": "optparse.OptionParser", "line_number": 12, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 17, "usage_type": "attribute" }, { "api_name": "os.path.exists", "line_number": 20, "usage_type": "call" }, { "api_name": "os.path", "lin...
471364125
# Adapted from https://github.com/mimoralea/gdrl from helpers.utils.action_selection import GreedyStrategy, NormalNoiseStrategy from helpers.utils.priority_replay import Memory from helpers.nn.network import FCQV, FCDP from itertools import count import torch.optim as optim import numpy as np import torch import time i...
Oreoluwa-Se/Continuous-Control
helpers/agent.py
agent.py
py
16,852
python
en
code
0
github-code
36
[ { "api_name": "os.path.join", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path", "line_number": 15, "usage_type": "attribute" }, { "api_name": "torch.device", "line_number": 21, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", ...
34341824103
# -*- coding: utf-8 -*- from telegram.ext import Updater from telegram.ext import CommandHandler from telegram.ext import MessageHandler, Filters from telegram.ext.dispatcher import run_async from telegram import ReplyKeyboardMarkup, ReplyKeyboardRemove, KeyboardButton import telegram from emoji import emojize, demojiz...
c4software/laurence-bot
telegram_start.py
telegram_start.py
py
5,247
python
en
code
1
github-code
36
[ { "api_name": "logging.basicConfig", "line_number": 24, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 24, "usage_type": "attribute" }, { "api_name": "atexit.register", "line_number": 27, "usage_type": "attribute" }, { "api_name": "commands.g...
31608746342
import torch from torch import nn from torch.autograd import Variable class topk_crossEntrophy(nn.Module): def __init__(self, top_k=0.7): super(topk_crossEntrophy, self).__init__() self.loss = nn.NLLLoss() self.top_k = top_k self.softmax = nn.LogSoftmax() return ...
Forrest0503/VAT-ABAW
ohem_loss.py
ohem_loss.py
py
987
python
en
code
0
github-code
36
[ { "api_name": "torch.nn.Module", "line_number": 5, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 5, "usage_type": "name" }, { "api_name": "torch.nn.NLLLoss", "line_number": 8, "usage_type": "call" }, { "api_name": "torch.nn", "line_numb...
26281206663
#!/usr/bin/env python3 # coding:utf-8 import os,hashlib import shutil import subprocess from datetime import datetime import nacos import yaml from apscheduler.schedulers.blocking import BlockingScheduler from dotenv import load_dotenv, find_dotenv # load .env file load_dotenv(find_dotenv(), override=True) SERVER_A...
GounGG/nacos-client-py
nacos-get-config.py
nacos-get-config.py
py
2,424
python
en
code
1
github-code
36
[ { "api_name": "dotenv.load_dotenv", "line_number": 15, "usage_type": "call" }, { "api_name": "dotenv.find_dotenv", "line_number": 15, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 17, "usage_type": "call" }, { "api_name": "os.getenv", "line...
42215123133
import json import os import datetime import scipy.optimize import sklearn.metrics import aop import aop.api class DailyIndexPrediction: def __init__(self): # read the config.json in the current directory with open(os.path.dirname(__file__) + '/config.json', 'r') as file_obj: self....
Silence-2020/mt-prediction
daily_index_prediction.py
daily_index_prediction.py
py
9,807
python
en
code
0
github-code
36
[ { "api_name": "os.path.dirname", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path", "line_number": 17, "usage_type": "attribute" }, { "api_name": "json.load", "line_number": 18, "usage_type": "call" }, { "api_name": "aop.set_default_server", "...
74105530982
#!/usr/bin/env python3 """Gleitzsch core.""" import argparse import sys import os import random import string import subprocess from subprocess import DEVNULL # from subprocess import PIPE from array import array import numpy as np from skimage import io from skimage import img_as_float from skimage.util import img_as_...
kirilenkobm/gleitzsch_v4
gleitzsch.py
gleitzsch.py
py
24,870
python
en
code
0
github-code
36
[ { "api_name": "sys.stderr.write", "line_number": 24, "usage_type": "call" }, { "api_name": "sys.stderr", "line_number": 24, "usage_type": "attribute" }, { "api_name": "sys.stderr.write", "line_number": 25, "usage_type": "call" }, { "api_name": "sys.stderr", "l...
38054510986
import accept import logging from aiohttp import web, web_exceptions from aiohttp_swagger import setup_swagger from model import ClientModel, ItemNotFoundException from protocol import * from prometheus_client import REGISTRY, exposition from urllib.parse import parse_qs from voluptuous import MultipleInvalid class ...
weierstrass54/sb_rest
api.py
api.py
py
12,166
python
en
code
0
github-code
36
[ { "api_name": "logging.getLogger", "line_number": 15, "usage_type": "call" }, { "api_name": "prometheus_client.REGISTRY", "line_number": 17, "usage_type": "name" }, { "api_name": "aiohttp.web.Application", "line_number": 24, "usage_type": "call" }, { "api_name": "...
625331659
import os import time from io import BytesIO import aiohttp import asyncio import requests from PIL import Image from lxml import etree # import pandas as pd class Spider(object): """ 下载路径在实例化时候指定,比如:r'd:\test\\',这个目录如果不存在,会出错。 如果想给文件名加前缀,只要在目录下加前缀就行,比如:r'd:\test\abc',那么生成的文件前面都有abc 默认路径为当前文件下的down...
chenxy2022/long
wow.py
wow.py
py
7,151
python
en
code
0
github-code
36
[ { "api_name": "os.listdir", "line_number": 28, "usage_type": "call" }, { "api_name": "os.mkdir", "line_number": 29, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 30, "usage_type": "call" }, { "api_name": "os.path", "line_number": 30, ...
8786926229
from .abstract import Aggregator from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.common.keys import Keys from selenium.common.exceptions import NoSuchElementException from selenium.webdriver.common.action_chains import ActionChains from selenium.webdriver.support.ui i...
t-bucchi/accagg
accagg/bank/sbinetbank.py
sbinetbank.py
py
10,622
python
en
code
0
github-code
36
[ { "api_name": "re.match", "line_number": 34, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 39, "usage_type": "call" }, { "api_name": "selenium.common.exceptions.NoSuchElementException", "line_number": 52, "usage_type": "name" }, { "api_name...
5106024377
import re import json import base64 import pandas as pd import networkx as nx from textblob import TextBlob from collections import defaultdict from arabic_reshaper import reshape from bidi.algorithm import get_display from requests_toolbelt.multipart import decoder def generate_hashtag_data(file_path): # Read th...
kashif-ghafoor/twitter-scrap-infa
src/hashtagAnalysis/index.py
index.py
py
6,609
python
en
code
0
github-code
36
[ { "api_name": "pandas.read_excel", "line_number": 15, "usage_type": "call" }, { "api_name": "re.findall", "line_number": 19, "usage_type": "call" }, { "api_name": "arabic_reshaper.reshape", "line_number": 39, "usage_type": "call" }, { "api_name": "bidi.algorithm.g...
18935365420
# pylint: disable=too-many-locals, duplicate-code """Management command that loads locale .po files into database.""" from __future__ import unicode_literals import json from os.path import join, isdir from django.conf import settings from django.core.management.base import BaseCommand as LoadCommand, CommandError fr...
IATI/IATI-Standard-Website
modeltranslation_sync/management/commands/load_trans_nav.py
load_trans_nav.py
py
3,582
python
en
code
5
github-code
36
[ { "api_name": "django.core.management.base.BaseCommand", "line_number": 47, "usage_type": "name" }, { "api_name": "django.conf.settings.MODELTRANSLATION_LOCALE_PATH", "line_number": 53, "usage_type": "attribute" }, { "api_name": "django.conf.settings", "line_number": 53, ...
44638762028
# **************************************************************************** # # # # ::: :::::::: # # stockholm.py :+: :+: :+: ...
Mankestark/Proyectos-terminados-bootcamp-ciberseguridad
stockholm/stockholm.py
stockholm.py
py
7,398
python
uk
code
0
github-code
36
[ { "api_name": "argparse.ArgumentParser", "line_number": 22, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 54, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 55, "usage_type": "call" }, { "api_name": "os.path", "line_n...
8111739008
import pygame, sys from pygame.locals import * class Particle(object): #Initalizes the paritcle object (called when it is first created) def __init__(self,X,Y,size,deltaX,deltaY,color, displaySurface): #surface to display the particle on self.displaySurface = displaySurface ...
arnavdani/Python-2015-Summer
MyClasses/Particle.py
Particle.py
py
1,136
python
en
code
0
github-code
36
[ { "api_name": "pygame.Rect", "line_number": 17, "usage_type": "call" }, { "api_name": "pygame.draw.rect", "line_number": 22, "usage_type": "call" }, { "api_name": "pygame.draw", "line_number": 22, "usage_type": "attribute" } ]
37369375965
import os import pandas as pd import numpy as np import matplotlib.pyplot as plt import cv2 """ iterate csv boxes in /box_4096 and convert them to images """ # boxfiles_dir = 'data/box_4096' # des_dir='data/allsolar_png1500_boximage' boxfiles_dir = 'data/box_full_4096' des_dir='data/allsolar_full_png512_boximage' if ...
dyu62/solar_share
data/box2img.py
box2img.py
py
1,426
python
en
code
0
github-code
36
[ { "api_name": "os.path.exists", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path", "line_number": 13, "usage_type": "attribute" }, { "api_name": "os.makedirs", "line_number": 14, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number...
25978420324
from enum import Enum class ProxyResponseType(Enum): proxy = 'proxy' file = 'file' json = 'json' def get_dict(self): return self.value class ProxyResponse(object): def __init__(self, request, response, type: ProxyResponseType, ...
sayler8182/MockServer
app/models/models/proxy_response.py
proxy_response.py
py
793
python
en
code
2
github-code
36
[ { "api_name": "enum.Enum", "line_number": 4, "usage_type": "name" } ]
40272343197
from __future__ import absolute_import, division, print_function import base64 import json import os import time import requests import urllib.request from urllib.request import Request, urlopen from uuid import UUID from beets import config import beets.library from beets.plugins import BeetsPlugin from pathlib imp...
peace899/beets2kodi
beetsplug/kodinfo.py
kodinfo.py
py
18,692
python
en
code
1
github-code
36
[ { "api_name": "os.path.expanduser", "line_number": 66, "usage_type": "call" }, { "api_name": "os.path", "line_number": 66, "usage_type": "attribute" }, { "api_name": "beets.config", "line_number": 66, "usage_type": "name" }, { "api_name": "beets.library.Library", ...