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
7316418502
''' Module used to extract syntactic features from a given corpus. ''' import spacy import pandas as pd from .lexical_features import jaccard_coefficient def compute_pos(pipe_tags): """ Function used to compute the POS-tags difference between two sentences in the corpus """ tags = ['adj', 'adv', 'art', 'conj-c', ...
NLP-CISUC/ASAPPpy
ASAPPpy/feature_engineering/syntactic_features.py
syntactic_features.py
py
2,339
python
en
code
2
github-code
21
[ { "api_name": "pandas.DataFrame", "line_number": 37, "usage_type": "call" }, { "api_name": "spacy.load", "line_number": 45, "usage_type": "call" }, { "api_name": "lexical_features.jaccard_coefficient", "line_number": 64, "usage_type": "call" }, { "api_name": "pand...
35348545183
import pandas as pd import numpy as np from datetime import time import matplotlib.pyplot as plt import statsmodels.api as sm import seaborn as sns sns.set_style("whitegrid") def volume_order_imbalance(data, kws): drop_first = kws.setdefault("drop_first", True) current_bid_price = data['bid1_price'] bi...
Me2yhm/Algorithmic-Trading
AlgorithmicStrategy/SnapShot/analysis_unit.py
analysis_unit.py
py
5,566
python
en
code
1
github-code
21
[ { "api_name": "seaborn.set_style", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.where", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.where", "line_number": 26, "usage_type": "call" }, { "api_name": "numpy.where", "line_numb...
27619247302
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os from collections import defaultdict import argparse import pprint as pp import numpy as np np.seterr(divide='ignore', invalid='ignore') import re import matplotlib.pyplot as plt import random from matplotlib import style style.use('ggplot') import ...
mariejal/projetal
project_bis.py
project_bis.py
py
22,176
python
fr
code
0
github-code
21
[ { "api_name": "numpy.seterr", "line_number": 9, "usage_type": "call" }, { "api_name": "matplotlib.style.use", "line_number": 14, "usage_type": "call" }, { "api_name": "matplotlib.style", "line_number": 14, "usage_type": "name" }, { "api_name": "argparse.ArgumentPa...
40065097207
from typing import Type import numpy as np import requests import tensorflow as tf import tensorflow_datasets as tfds from mldiag.services import Service def txt_tfds_to_numpy( dataset: tf.data.Dataset ): for datapoint in list(tfds.as_numpy(dataset)): data, label = datapoint print(data.s...
S-AI-F/MLDiag-1
mldiag/wrappers.py
wrappers.py
py
1,520
python
en
code
1
github-code
21
[ { "api_name": "tensorflow.data", "line_number": 12, "usage_type": "attribute" }, { "api_name": "tensorflow_datasets.as_numpy", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.vectorize", "line_number": 17, "usage_type": "call" }, { "api_name": "num...
71342052853
import numpy as np import matplotlib.pyplot as plt def main(): # normal equation for Linear Regression x = 2 * np.random.rand(100, 1) # it returns an array of 100 rows; 1 column y = 4 + 3 * x + np.random.randn(100, 1) # distribute as "normal random numbers" instead of "equal random numbers" """plt.s...
dy0703/pycharm
Data Analysis/Machine Learning/Chap_4.py
Chap_4.py
py
14,890
python
en
code
0
github-code
21
[ { "api_name": "numpy.random.rand", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 6, "usage_type": "attribute" }, { "api_name": "numpy.random.randn", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.random", ...
32501010708
# Exploit Title: Apache Superset < 0.23 - Remote Code Execution # Date: 2018-05-17 # Exploit Author: David May (david.may@semanticbits.com) # Vendor Homepage: https://superset.apache.org/ # Software Link: https://github.com/apache/incubator-superset # Version: Any before 0.23 # Tested on: Ubuntu 18.04 # CVE-ID: CVE-201...
ryanmrestivo/red-team
_Resources/Exploit DB 2021-12-11/exploits/linux/webapps/45933.py
45933.py
py
3,427
python
en
code
91
github-code
21
[ { "api_name": "sys.argv", "line_number": 28, "usage_type": "attribute" }, { "api_name": "sys.exit", "line_number": 32, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 36, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 37...
70676215414
# Import pandas import pandas as pd # Import required sklearn moduels from sklearn.model_selection import ShuffleSplit from sklearn.model_selection import cross_val_score from sklearn.ensemble import RandomForestClassifier from sklearn.preprocessing import StandardScaler # Read data into a dataframe object called data...
HarryAmmon/IntelligentSystemsCoursework
submit/solution.py
solution.py
py
1,358
python
en
code
0
github-code
21
[ { "api_name": "pandas.read_csv", "line_number": 10, "usage_type": "call" }, { "api_name": "sklearn.preprocessing.StandardScaler", "line_number": 18, "usage_type": "call" }, { "api_name": "sklearn.ensemble.RandomForestClassifier", "line_number": 23, "usage_type": "call" ...
10909400300
from matplotlib import pyplot as plt import camera import cv2 # %% save rectified self-taken images for demonstration images = range(1, 4) for img in images: root = './data/' img1 = cv2.imread(f'{root}{img}_left.png', 0) img2 = cv2.imread(f'{root}{img}_right.png', 0) img1_rectified = cv2.remap(img1...
csl122/Stereo-Matching
tools.py
tools.py
py
2,311
python
en
code
0
github-code
21
[ { "api_name": "cv2.imread", "line_number": 12, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 13, "usage_type": "call" }, { "api_name": "cv2.remap", "line_number": 15, "usage_type": "call" }, { "api_name": "camera.left_map1", "line_number":...
70909124532
import pandas as pd import numpy as np import xgboost as xgb from sklearn.model_selection import StratifiedKFold,train_test_split from sklearn.metrics import f1_score train_data = pd.read_csv('./cache/train_data_new.csv',index_col=0) val_data = pd.read_csv('./cache/val_data_new.csv',index_col=0) test_data = pd.read_c...
dayL-W/Tianchi-OGeek
xgb.py
xgb.py
py
3,865
python
en
code
6
github-code
21
[ { "api_name": "pandas.read_csv", "line_number": 7, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 8, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 9, "usage_type": "call" }, { "api_name": "pandas.concat", "lin...
25538198657
import unittest from flask import Flask from crypto_blueprint import crypto_blueprint from cryptos import Bitcoin app = Flask(__name__) app.register_blueprint(crypto_blueprint) c = Bitcoin(testnet=True) class TestGetUtxos(unittest.TestCase): @classmethod def setUpClass(cls): cls.test_client = app.tes...
CryptoMexFund/steal_btc
backend/tests/test_get_utxos.py
test_get_utxos.py
py
1,420
python
en
code
3
github-code
21
[ { "api_name": "flask.Flask", "line_number": 6, "usage_type": "call" }, { "api_name": "crypto_blueprint.crypto_blueprint", "line_number": 7, "usage_type": "argument" }, { "api_name": "cryptos.Bitcoin", "line_number": 8, "usage_type": "call" }, { "api_name": "unitte...
75213105333
#!/usr/bin/python3 """module inserts state Louisiana into the db""" import sys from model_state import Base, State from sqlalchemy import (create_engine) from sqlalchemy.orm import sessionmaker if __name__ == "__main__": uname = sys.argv[1] pswd = sys.argv[2] dname = sys.argv[3] conn_str = 'mysql+mysq...
cmiltone/alx-higher_level_programming
0x0F-python-object_relational_mapping/11-model_state_insert.py
11-model_state_insert.py
py
667
python
en
code
0
github-code
21
[ { "api_name": "sys.argv", "line_number": 10, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 11, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 12, "usage_type": "attribute" }, { "api_name": "sqlalchemy.create_engine", ...
23133941302
from typing import List class Solution: def minOperations(self, logs: List[str]) -> int: cur = 0 for log in logs: if log.startswith('../'): cur -= 1 elif log.startswith('./'): cur += 0 else: cur += 1 cu...
chengcct/Algorithmic-exercises
leetcode/1598. 文件夹操作日志搜集器.py
1598. 文件夹操作日志搜集器.py
py
446
python
en
code
0
github-code
21
[ { "api_name": "typing.List", "line_number": 5, "usage_type": "name" } ]
33898110633
from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union import attr from ..models.shipping_speed_category import ShippingSpeedCategory from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.address import Address from ..models.feature_settings import FeatureSettings from ..model...
milyord/sp-api
sp/fulfillment_outbound_2020_07_01/models/get_fulfillment_preview_request.py
get_fulfillment_preview_request.py
py
7,546
python
en
code
1
github-code
21
[ { "api_name": "typing.TYPE_CHECKING", "line_number": 8, "usage_type": "name" }, { "api_name": "typing.TypeVar", "line_number": 14, "usage_type": "call" }, { "api_name": "typing.List", "line_number": 42, "usage_type": "name" }, { "api_name": "typing.Union", "li...
10451667212
# 15900 import sys input = sys.stdin.readline from collections import deque def bfs(N,start): q = deque([start]) visited = [0] * (N+1) visited[start] = 1 l_s = 0 length = 1 count = 0 level = 1 isLeaf = 0 while q: curNode = q.popleft() count += 1 for nextNo...
inkyu0103/BOJ
Tree/15900.py
15900.py
py
1,109
python
en
code
0
github-code
21
[ { "api_name": "sys.stdin", "line_number": 3, "usage_type": "attribute" }, { "api_name": "collections.deque", "line_number": 7, "usage_type": "call" } ]
15464692037
import time import os import logging from logging.handlers import BaseRotatingHandler from gunicorn.glogging import Logger as GLogger from gunicorn import util try: import codecs except ImportError: codecs = None class MultiProcessSafeDailyRotatingFileHandler(BaseRotatingHandler): """Similar with `loggin...
BJUT-hammer/hammer_backend
hammer_api/utils/log_handler.py
log_handler.py
py
3,174
python
en
code
1
github-code
21
[ { "api_name": "logging.handlers.BaseRotatingHandler", "line_number": 14, "usage_type": "name" }, { "api_name": "logging.handlers.BaseRotatingHandler.__init__", "line_number": 25, "usage_type": "call" }, { "api_name": "logging.handlers.BaseRotatingHandler", "line_number": 25, ...
39401985131
#!/usr/bin/python3 import argparse import configparser import datetime import sys def is_a_year(value): value = value.rstrip("'") # remove primes return len(value) == 4 and all((c in "0123456789") for c in value) def is_a_date(value): if value == "None": return True try: datetime....
pscl4rke/uk-national-calendar
scripts/validate.py
validate.py
py
3,161
python
en
code
0
github-code
21
[ { "api_name": "datetime.datetime.strptime", "line_number": 19, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 19, "usage_type": "attribute" }, { "api_name": "configparser.ConfigParser", "line_number": 26, "usage_type": "call" }, { "api_n...
6782380699
#!/usr/bin/env python # -*-coding:utf-8-*- """ @File : run.py @Author: Ezreal @Date : 2019-01-27 3:05 @Desc : """ import requests from flask_cors import CORS from flask import Flask, render_template, jsonify, request from random import randint app = Flask(__name__, static_url_path="", stat...
kucoll/flask-vue-simple
run.py
run.py
py
1,031
python
en
code
0
github-code
21
[ { "api_name": "flask.Flask", "line_number": 14, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 24, "usage_type": "call" }, { "api_name": "flask.request.values.get", "line_number": 29, "usage_type": "call" }, { "api_name": "flask.requ...
23719032446
from flask import Blueprint, render_template, request, redirect, url_for from app.merchandise.models import Merchandise blueprint = Blueprint('merchandise', __name__) @blueprint.get("/edit_item/<id>") def show_edit_item(id): item = Merchandise.query.filter_by(id=id).first() return render_template("merchandise...
yvetteachiengatieno/FOUNDATION-BACKEND
app/merchandise/routes.py
routes.py
py
2,182
python
en
code
0
github-code
21
[ { "api_name": "flask.Blueprint", "line_number": 4, "usage_type": "call" }, { "api_name": "app.merchandise.models.Merchandise.query.filter_by", "line_number": 8, "usage_type": "call" }, { "api_name": "app.merchandise.models.Merchandise.query", "line_number": 8, "usage_type...
38356174996
import sys from functools import reduce match = { ')': '(', ']': '[', '}': '{', '>': '<' } open = list(match.values()) match = {**match, **{v:k for k,v in match.items()}} points_illegal = { ')': 3, ']': 57, '}': 1197, '>': 25137} points_autocomplete = { ')': 1, ']': 2, '}': 3, '>': 4 } lines = [[c for c in line.str...
deepakjois/advent-of-code-2021
day10/day10.py
day10.py
py
954
python
en
code
0
github-code
21
[ { "api_name": "sys.stdin", "line_number": 11, "usage_type": "attribute" }, { "api_name": "functools.reduce", "line_number": 28, "usage_type": "call" } ]
27662661216
from .src import MALICIOUS_PATHS as _MALICIOUS_PATHS, BOTS_PATH as _BOTS_PATH, BOTS_AGENT as _BOTS_AGENT from .src import SEARCH_ENGINE_AGENT as _SEARCH_ENGINE_AGENT from .utils import url_decode as _url_decode import importlib.resources as _importlib_resources from . import lists as _lists from math import log2 as _lo...
MartinMerkli/httpanalyzer
src/httpanalyzer/__init__.py
__init__.py
py
4,236
python
en
code
2
github-code
21
[ { "api_name": "src.BOTS_AGENT", "line_number": 39, "usage_type": "name" }, { "api_name": "utils.url_decode", "line_number": 42, "usage_type": "call" }, { "api_name": "src.BOTS_PATH", "line_number": 42, "usage_type": "name" }, { "api_name": "importlib.resources.rea...
5510352507
#!/usr/bin/python3 #import json #file_contents = json.loads(open('post_index.json','r').read()) import os import re import oauth import json from json import JSONDecoder, JSONEncoder import time from selenium import webdriver from selenium.webdriver.common.action_chains import ActionChains import bs4 opts = webdri...
MinsuKim123/crawler
egloosreader.py
egloosreader.py
py
13,710
python
en
code
0
github-code
21
[ { "api_name": "selenium.webdriver.ChromeOptions", "line_number": 18, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 18, "usage_type": "name" }, { "api_name": "json.JSONDecoder", "line_number": 23, "usage_type": "call" }, { "api_name": "...
39544017305
from datetime import datetime from typing import List from pytz import utc from mlo.pets.PetService import PetService from mlo.user.UserService import UserService class ResultsPrioritization: def __init__(self, petService: PetService, userService: UserService): self.pets = petService self....
GeorgeJuniorGG/Miaudote
app/mlo/petsearch/resultsPrioritization.py
resultsPrioritization.py
py
4,094
python
en
code
0
github-code
21
[ { "api_name": "mlo.pets.PetService.PetService", "line_number": 9, "usage_type": "name" }, { "api_name": "mlo.user.UserService.UserService", "line_number": 9, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 14, "usage_type": "name" }, { "api_nam...
1354089998
import cmd from typing import Optional import pynames from pynames.generators.elven import * from pynames.generators.iron_kingdoms import * from pynames.generators.orc import * from pynames.generators.goblin import * from pynames.generators.mongolian import * from pynames.generators.korean import * from pynames.genera...
Werozel/python-vcs-2022
04_MergetoolCommandline/name_generator.py
name_generator.py
py
6,202
python
en
code
0
github-code
21
[ { "api_name": "typing.Optional", "line_number": 44, "usage_type": "name" }, { "api_name": "pynames.GENDER", "line_number": 57, "usage_type": "attribute" }, { "api_name": "cmd.Cmd", "line_number": 60, "usage_type": "attribute" }, { "api_name": "pynames.LANGUAGE", ...
376681095
import os import sys import re import json import datetime import requests from tqdm import tqdm from ast import literal_eval def log(message): refreshLog = os.path.join(os.getcwd(), "serviceAggProc.log") with open(refreshLog, 'a') as logMessage: logMessage.write('%s - %s\n' % (str(datetime.datetime.no...
UGA-ITOSHumanitarianGIS/mapservicedoc
Scripts/ITOSMapServicesGeoJson.py
ITOSMapServicesGeoJson.py
py
4,160
python
en
code
2
github-code
21
[ { "api_name": "os.path.join", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path", "line_number": 11, "usage_type": "attribute" }, { "api_name": "os.getcwd", "line_number": 11, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line...
2043768336
import collections import logging import os import subprocess import threading logger = logging.getLogger(__name__) class ReaderThread(threading.Thread): def __init__(self, process, stream, name): super(ReaderThread, self).__init__() self.stream = stream self.process = process sel...
kkckkc/webpagetest-python-agent
client/process.py
process.py
py
2,307
python
en
code
0
github-code
21
[ { "api_name": "logging.getLogger", "line_number": 7, "usage_type": "call" }, { "api_name": "threading.Thread", "line_number": 10, "usage_type": "attribute" }, { "api_name": "collections.deque", "line_number": 16, "usage_type": "call" }, { "api_name": "subprocess.C...
27050920244
# consume.py import pika, os # Access the CLODUAMQP_URL environment variable and parse it (fallback to localhost) url = os.environ.get('CLOUDAMQP_URL', 'amqps://xlvhonqr:8imUt-lRT9eb1BGTdu1kY9zfBYot8YD2@toad.rmq.cloudamqp.com/xlvhonqr') params = pika.URLParameters(url) connection = pika.BlockingConnection(params) chan...
zGuil/ac04-arquitetura
parte01/receber_mensagem.py
receber_mensagem.py
py
748
python
en
code
0
github-code
21
[ { "api_name": "os.environ.get", "line_number": 5, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 5, "usage_type": "attribute" }, { "api_name": "pika.URLParameters", "line_number": 6, "usage_type": "call" }, { "api_name": "pika.BlockingConnectio...
7329023750
from __future__ import division, print_function import numpy as np from collections import namedtuple ######################## # Directed graph inference RandomVariable = namedtuple("RandomVariable", [ "name", "domain", ]) class QueryMixin(object): @property def variable_names(self): return ...
aleveren/ucsd-research
misc_2017_fall/belief_propagation/belief_propagation.py
belief_propagation.py
py
8,045
python
en
code
0
github-code
21
[ { "api_name": "collections.namedtuple", "line_number": 9, "usage_type": "call" }, { "api_name": "collections.namedtuple", "line_number": 54, "usage_type": "call" }, { "api_name": "collections.namedtuple", "line_number": 137, "usage_type": "call" }, { "api_name": "...
32731081026
#!pip install yfinance import yfinance as yf # https://pypi.org/project/yfinance/ import math ### the meaning of prediction about stock market from numpy.core.numeric import ones_like import random import matplotlib.pyplot as plt import seaborn as sns import datetime # get data by ticker-name, start-time & e...
mellowLoveGH/FinTech_for_stock_market_01
stocks_analyze_predict/analyze_stock01.py
analyze_stock01.py
py
3,786
python
en
code
0
github-code
21
[ { "api_name": "yfinance.download", "line_number": 13, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.subplots", "line_number": 42, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 42, "usage_type": "name" }, { "api_name": "matplo...
75097680053
""" Client to access a MySQL database. """ import os from pathlib import Path from typing import List import mysql.connector from backend.dataclasses import User, Measurement from dotenv import load_dotenv load_dotenv(dotenv_path=Path(__file__).parent.parent.parent.parent / '.env') class DbClient(object): def...
nsaintgeours/demo-py-app
backend/src/backend/db_client.py
db_client.py
py
3,143
python
en
code
0
github-code
21
[ { "api_name": "dotenv.load_dotenv", "line_number": 13, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 13, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 19, "usage_type": "call" }, { "api_name": "os.getenv", "line_numbe...
5752788583
from configparser import ConfigParser import matplotlib.pylab as plt import numpy as np def get_strings_section(config, section): """ Get config file options from section containing strings. :param config: ConfigParser object. :param section: Name of the section to be read. """ options = ...
alexdiem/vampy
vampy/utils.py
utils.py
py
2,340
python
en
code
21
github-code
21
[ { "api_name": "numpy.array", "line_number": 37, "usage_type": "call" }, { "api_name": "configparser.ConfigParser", "line_number": 50, "usage_type": "call" } ]
70046011254
from pytest import raises as assert_raises from bundlebuilder.constants import ( DESCRIPTION_MAX_LENGTH, REVISION_MIN_VALUE, SHORT_DESCRIPTION_LENGTH, TLP_CHOICES, SCHEMA_VERSION, ) from bundlebuilder.exceptions import ValidationError from bundlebuilder.models import ( Bundle, Sighting, ...
CiscoSecurity/tr-05-ctim-bundle-builder
tests/unit/models/primary/test_bundle.py
test_bundle.py
py
6,198
python
en
code
3
github-code
21
[ { "api_name": "bundlebuilder.constants.DESCRIPTION_MAX_LENGTH", "line_number": 33, "usage_type": "name" }, { "api_name": "bundlebuilder.constants.DESCRIPTION_MAX_LENGTH", "line_number": 41, "usage_type": "name" }, { "api_name": "pytest.raises", "line_number": 48, "usage_t...
31830641193
from urllib.request import urlopen import json token = "YOU TOKEN" group_id = "ID" def count_user(): url = "https://api.vk.com/method/groups.getById.json?group_ids=" + group_id + "&fields=members_count&access_token=" + token + "&v=5.52" response = urlopen(url) data = response.read() jsn = json.loads(d...
tarbagan/VK_user_group
VK_user_group.py
VK_user_group.py
py
1,119
python
en
code
0
github-code
21
[ { "api_name": "urllib.request.urlopen", "line_number": 9, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 11, "usage_type": "call" }, { "api_name": "urllib.request.urlopen", "line_number": 26, "usage_type": "call" }, { "api_name": "json.loads", ...
3082043770
from django import forms from reports.models import Region from django.core.exceptions import ValidationError class RegionForm(forms.ModelForm): class Meta: model = Region def clean(self): super(RegionForm, self).clean() location = self.cleaned_data.get('location') name = self...
mahammed1991/repo-crm
reports/forms.py
forms.py
py
1,035
python
en
code
0
github-code
21
[ { "api_name": "django.forms.ModelForm", "line_number": 6, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 6, "usage_type": "name" }, { "api_name": "reports.models.Region", "line_number": 8, "usage_type": "name" }, { "api_name": "reports.m...
282504196
import pygame class Bola: def __init__(self, tipo, vetor, campo): self.tipo = tipo self.vetor = vetor # lista com a velocidade x e y self.imagem = pygame.image.load("bola.png") self.imagem = pygame.transform.scale(self.imagem, [30, 30]) self.bola = self.imagem.get_rect() ...
MateusRosario/PingPongSimpleGame
Bola.py
Bola.py
py
3,740
python
pt
code
0
github-code
21
[ { "api_name": "pygame.image.load", "line_number": 7, "usage_type": "call" }, { "api_name": "pygame.image", "line_number": 7, "usage_type": "attribute" }, { "api_name": "pygame.transform.scale", "line_number": 8, "usage_type": "call" }, { "api_name": "pygame.transf...
11161894556
from django import forms from timesheets.models import TaskTime from django.utils import timezone class Task_Timer_Form(forms.ModelForm): class Meta: model = TaskTime fields = ("job_code", "ancillary_code", "description", "elapsed_time") widgets = { "job_code": forms.Select( ...
timotiousPrime/MacTrack
timesheets/forms.py
forms.py
py
1,143
python
en
code
0
github-code
21
[ { "api_name": "django.forms.ModelForm", "line_number": 6, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 6, "usage_type": "name" }, { "api_name": "timesheets.models.TaskTime", "line_number": 8, "usage_type": "name" }, { "api_name": "djan...
13738311992
import os import shutil import torch import random import numpy as np import torch.backends.cudnn as cudnn def create_folder(directory) : #---# create folder #---# try : if not os.path.exists(directory) : os.makedirs(directory) except OSError : print("Error: Creating directory"...
S0-HYUN/XAI623
utils.py
utils.py
py
1,438
python
en
code
0
github-code
21
[ { "api_name": "os.path.exists", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path", "line_number": 11, "usage_type": "attribute" }, { "api_name": "os.makedirs", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path.isdir", "line_num...
3644312957
from unittest.mock import MagicMock from flask import Blueprint, Flask from src.modules.auth.auth_service import AuthService from src.modules.auth.protected_endpoint_decorator import create_protected_endpoint_decorator def dummy_handler(_auth_service, _request, function, *args, **kwargs): # Just pass arguments ...
Ksisu/example_flask_app
tests/unit/modules/auth/test_unit_create_protected_endpoint_decorator.py
test_unit_create_protected_endpoint_decorator.py
py
2,207
python
en
code
0
github-code
21
[ { "api_name": "src.modules.auth.protected_endpoint_decorator.create_protected_endpoint_decorator", "line_number": 14, "usage_type": "call" }, { "api_name": "src.modules.auth.auth_service.AuthService", "line_number": 18, "usage_type": "call" }, { "api_name": "flask.Blueprint", ...
33099202320
import numpy import pandas import matplotlib.pyplot as pyplot from typing import Callable from typing import List import numpy from typing import Callable, List import pandas from matplotlib import pyplot # Define the main function for calculating moving averages def moving_average_calculator(input_stock_prices, movi...
wasimnoordin/EntroPy
src/mov_avg.py
mov_avg.py
py
12,460
python
en
code
0
github-code
21
[ { "api_name": "typing.Callable", "line_number": 13, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 13, "usage_type": "name" }, { "api_name": "pandas.Series", "line_number": 39, "usage_type": "attribute" }, { "api_name": "pandas.DataFrame", ...
6557418688
import time import sys import math import json import threading from collections import defaultdict, namedtuple from salvo.pgbar import AnimatedProgressBar RunStats = namedtuple( "RunStats", ["count", "total_time", "rps", "avg", "min", "max", "amp", "stdev", "rpm"], ) def print_errors(errors, stream=sys.st...
tarekziade/salvo
salvo/output.py
output.py
py
4,553
python
en
code
211
github-code
21
[ { "api_name": "collections.namedtuple", "line_number": 11, "usage_type": "call" }, { "api_name": "sys.stdout", "line_number": 17, "usage_type": "attribute" }, { "api_name": "collections.defaultdict", "line_number": 36, "usage_type": "call" }, { "api_name": "collec...
70619767094
# train.py import time import config import dataset import engine import torch import pandas as pd import numpy as np import torch.nn as nn from model import BERTBaseUncased from sklearn import model_selection from sklearn import metrics from transformers import AdamW from transformers import get_linear_schedule_with_...
LakshyaMalhotra/toy-projects-nlp
imdb-sentiment-analysis/bert-models/train.py
train.py
py
4,273
python
en
code
0
github-code
21
[ { "api_name": "dataset.BERTDataset", "line_number": 29, "usage_type": "call" }, { "api_name": "dataset.BERTDataset", "line_number": 32, "usage_type": "call" }, { "api_name": "torch.utils.data.DataLoader", "line_number": 37, "usage_type": "call" }, { "api_name": "t...
13719788564
""" Default configuration for AlgoBOWL ---------------------------------- Configuration in this file is overridden by the paste config. """ import tg from depot.manager import DepotManager from markupsafe import Markup from repoze.who.interfaces import IChallenger from tg.configuration import AppConfig, milestones fro...
jackrosenthal/algobowl
algobowl/config/app_cfg.py
app_cfg.py
py
4,279
python
en
code
4
github-code
21
[ { "api_name": "tg.configuration.AppConfig", "line_number": 21, "usage_type": "call" }, { "api_name": "algobowl.model", "line_number": 54, "usage_type": "name" }, { "api_name": "algobowl.model.DBSession", "line_number": 55, "usage_type": "attribute" }, { "api_name"...
73874926774
import logging import threading from decimal import Decimal from datetime import datetime import boto3 from Thermostat import Mode import config class StatusWriter(): def __init__(self, thermostat): self.thermostat = thermostat thermostat.notify(self) self.event_write_timer = None ...
garret-smith/chat-o-stat
StatusWriter.py
StatusWriter.py
py
2,105
python
en
code
0
github-code
21
[ { "api_name": "boto3.resource", "line_number": 18, "usage_type": "call" }, { "api_name": "config.status_table_name", "line_number": 19, "usage_type": "attribute" }, { "api_name": "threading.Timer", "line_number": 20, "usage_type": "call" }, { "api_name": "config.s...
358838328
import datetime def dates_between(start, end): r = (end+datetime.timedelta(days=1)-start).days return [start+datetime.timedelta(days=i) for i in range(r)][1:-1] def months_between(start, end): dates = dates_between(start, end) months = ["%d-%d" % (start.year, start.month), "%d-%d" % (end.year, end.month)] f...
zmcghee/filmlog
filmlog/utils.py
utils.py
py
451
python
en
code
0
github-code
21
[ { "api_name": "datetime.timedelta", "line_number": 4, "usage_type": "call" }, { "api_name": "datetime.timedelta", "line_number": 5, "usage_type": "call" } ]
21881154328
#! coding:-utf8- from django import template from django.core.exceptions import ObjectDoesNotExist from avrora.catalog.models import Category from avrora.catalog.models import Product from avrora.catalog.utils import get_current_product_category register = template.Library() @register.inclusion_tag('catalog/breadcrum...
ebezmenov/avrora
core/templatetags/avrora_tags.py
avrora_tags.py
py
2,372
python
en
code
1
github-code
21
[ { "api_name": "django.template.Library", "line_number": 8, "usage_type": "call" }, { "api_name": "django.template", "line_number": 8, "usage_type": "name" }, { "api_name": "avrora.catalog.models.Category", "line_number": 14, "usage_type": "argument" }, { "api_name...
10349202336
from django.urls import path from .import views urlpatterns = [ path('home', views.home, name="home"), path('', views.loginUser, name="login"), path('salon', views.salon, name="salon"), path('register', views.register, name="register"), path('post_salon', views.sendsalon, name="post_salon"), pa...
Reine222/exoChannel
tchat/koz/urls.py
urls.py
py
377
python
en
code
0
github-code
21
[ { "api_name": "django.urls.path", "line_number": 5, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 6, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "django.urls.path", ...
27503324440
import unittest from bs4 import BeautifulSoup import os from repositories import Repositories class RepositoriesTest(unittest.TestCase): def setUp(self) -> None: dir = os.path.dirname(__file__) filename = os.path.join(dir, "mocks", "repositories-result-ok.html") text = open(filename) ...
julietavuan/redpoints
tests/testRepositories.py
testRepositories.py
py
933
python
en
code
0
github-code
21
[ { "api_name": "unittest.TestCase", "line_number": 7, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "os.path.join", ...
70380426294
import pprint import re import json import itertools from collections import Counter from train_model import class_names # # clean the json file from empty entries # with open("recipes/recipes_raw_nosource_ar.json", "r") as f: # json_data = json.load(f) # empty_keys = [] # for k, v in json_data.items(): # if ...
maksytka03/tensorflowFoodAndRecipe
get_recipes.py
get_recipes.py
py
2,649
python
en
code
0
github-code
21
[ { "api_name": "json.load", "line_number": 24, "usage_type": "call" }, { "api_name": "train_model.class_names", "line_number": 33, "usage_type": "name" } ]
22071278235
# imports import warnings warnings.filterwarnings('ignore') import os, cv2, shutil, json import numpy as np, pandas as pd, pickle as pkl from glob import glob from time import time from datetime import datetime from tqdm import tqdm from sklearn.metrics import precision_recall_curve, average_precision_score, accurac...
ambareeshravi/Content-based-Visual-Media-Retrieval
training/Conv2D_LSTM/.ipynb_checkpoints/conv2d_lstm-checkpoint.py
conv2d_lstm-checkpoint.py
py
7,952
python
en
code
2
github-code
21
[ { "api_name": "warnings.filterwarnings", "line_number": 3, "usage_type": "call" }, { "api_name": "keras.applications.mobilenet.MobileNet", "line_number": 40, "usage_type": "call" }, { "api_name": "keras.models.Model", "line_number": 41, "usage_type": "call" }, { "...
22050134749
import numpy as np import cv2 import os import matplotlib import matplotlib.pyplot as plt from matplotlib import rcParams import random import copy class Dataset(object): def __init__(self, satellite): # target satellite self.satellite = satellite self.image_data_format = None se...
mkrachten/Bachelor-thesis
Python/CloudDetection/src/MakeDataset.py
MakeDataset.py
py
12,643
python
en
code
0
github-code
21
[ { "api_name": "os.listdir", "line_number": 35, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 38, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 44, "usage_type": "call" }, { "api_name": "numpy.uint8", "line_number": 44...
5060917975
import time import zmq listen_address = "tcp://*:5555" context = zmq.Context() ssocket = context.socket(zmq.ROUTER) ssocket.bind(listen_address) print("Listening on %s." % listen_address) while True: # Wait for next request from client. address, empty, message = ssocket.recv_multipart() # message = ssoc...
bitcoinembassy/morphis
old/server_test.py
server_test.py
py
500
python
en
code
15
github-code
21
[ { "api_name": "zmq.Context", "line_number": 6, "usage_type": "call" }, { "api_name": "zmq.ROUTER", "line_number": 7, "usage_type": "attribute" } ]
14618523036
from django.shortcuts import render from . import form # Create your views here. def index(request): return render(request, 'easyform/index.html') def form_name(request): forms = form.FormExample() if request.method == 'POST': forms = form.FormExample(request.POST) if forms.is_valid(): ...
MarekFish93/My_Django_Stuff
testform/easyform/views.py
views.py
py
598
python
en
code
0
github-code
21
[ { "api_name": "django.shortcuts.render", "line_number": 6, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 20, "usage_type": "call" } ]
42710394696
import math import datetime import logging import backtrader as bt from enum import Enum _logger = logging.getLogger(__name__) class FakeFeed(bt.DataBase): class State(Enum): BACKTEST = 0, BACKFILL = 1, LIVE = 2, params = ( ('starting_value', 200), ('tick_interval', ...
happydasch/btplotting
btplotting/feeds/fakefeed.py
fakefeed.py
py
6,937
python
en
code
276
github-code
21
[ { "api_name": "logging.getLogger", "line_number": 8, "usage_type": "call" }, { "api_name": "backtrader.DataBase", "line_number": 11, "usage_type": "attribute" }, { "api_name": "enum.Enum", "line_number": 12, "usage_type": "name" }, { "api_name": "datetime.timedelt...
3726153514
import en_core_web_lg from spacy_langdetect import LanguageDetector from spacy.matcher import Matcher import os firstnames_list_path = os.path.join(os.path.dirname(__file__), "data", "firstnames-list.csv") with open(firstnames_list_path, "r", encoding="latin-1") as f: names = [line.rstrip() for line in f] nlp = e...
murdomoyse/dockerised-flask-nlp-app
src/pipeline.py
pipeline.py
py
2,229
python
en
code
0
github-code
21
[ { "api_name": "os.path.join", "line_number": 6, "usage_type": "call" }, { "api_name": "os.path", "line_number": 6, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 6, "usage_type": "call" }, { "api_name": "en_core_web_lg.load", "lin...
70387779892
import numpy as np import matplotlib.pyplot as plt import pygeoiga as gn fig_folder=gn.myPath+'/../../manuscript_IGA_MasterThesis/Thesis/figures/06_pyGeoIGA/' kwargs_savefig=dict(transparent=True, box_inches='tight', pad_inches=0) save_all=False def test_create_geometry(): def plot(geometry, file_name): f...
danielsk78/pygeoiga
tests/chapter_figures/test_06_pyGeoIGA.py
test_06_pyGeoIGA.py
py
17,092
python
en
code
2
github-code
21
[ { "api_name": "pygeoiga.myPath", "line_number": 4, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot.subplots", "line_number": 13, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 13, "usage_type": "name" }, { "api_name": "pyge...
37937425472
import socket import datetime import getpass import platform import os import numpy as np from numpy.distutils import cpuinfo def format_message(custom_info=None): host = socket.gethostname() user = getpass.getuser() cpu = cpuinfo.cpu.info[0]["model name"] os = platform.platform() try: soc...
ModelTC/NART
python/nart/tools/io.py
io.py
py
3,201
python
en
code
34
github-code
21
[ { "api_name": "socket.gethostname", "line_number": 11, "usage_type": "call" }, { "api_name": "getpass.getuser", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.distutils.cpuinfo.cpu", "line_number": 13, "usage_type": "attribute" }, { "api_name": "n...
31388564071
from threading import Thread, Event from sched import scheduler import time import json import os class PurgeDaemon(Thread): def __init__(self, min_expiry_time, schedule_location="./schedule.json"): super(PurgeDaemon, self).__init__() self._should_stop = Event() self._scheduler = scheduler(time.time, ti...
SCOREC/BDA_SM
src/results_cache/server/file_daemon/purge_daemon.py
purge_daemon.py
py
3,040
python
en
code
0
github-code
21
[ { "api_name": "threading.Thread", "line_number": 8, "usage_type": "name" }, { "api_name": "threading.Event", "line_number": 11, "usage_type": "call" }, { "api_name": "sched.scheduler", "line_number": 12, "usage_type": "call" }, { "api_name": "time.time", "line...
71325458293
from __future__ import print_function import os import sys import pydicom # check command line arguments make sense if len(sys.argv) != 3: print(__doc__) sys.exit() # read the file filename = sys.argv[1] dcm = pydicom.dcmread(filename) header = ",".join([ "PatientID", "PatientAge", "PatientSex",...
gnayyc/cyy.utils
dicom/dcm2csv.py
dcm2csv.py
py
2,727
python
en
code
0
github-code
21
[ { "api_name": "sys.argv", "line_number": 8, "usage_type": "attribute" }, { "api_name": "sys.exit", "line_number": 10, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 13, "usage_type": "attribute" }, { "api_name": "pydicom.dcmread", "line_numbe...
2899215142
from decouple import config as configdecouple from flask_sqlalchemy import SQLAlchemy db = SQLAlchemy() def config_database(app): app.config['SQLALCHEMY_DATABASE_URI'] = configdecouple('DB_URL') app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False db.init_app(app) with app.app_context(): d...
tomaz-f/ApiCarros
flaskr/database/connection.py
connection.py
py
335
python
en
code
1
github-code
21
[ { "api_name": "flask_sqlalchemy.SQLAlchemy", "line_number": 5, "usage_type": "call" }, { "api_name": "decouple.config", "line_number": 10, "usage_type": "call" } ]
11875640323
# - *- coding: utf- 8 - *- # import os import requests import click import pyperclip from aiogram import types from aiogram import Bot, Dispatcher, types, executor bot = Bot(token='1858148404:AAG0aLGBfrpmJPbr44wmtK_kxAyKEhhc16I') dp = Dispatcher(bot) URL_TRANSFERSH = 'https://transfer.sh' @dp.mes...
Cicadadenis/bot_it
utils/foto_id.py
foto_id.py
py
897
python
en
code
1
github-code
21
[ { "api_name": "aiogram.Bot", "line_number": 13, "usage_type": "call" }, { "api_name": "aiogram.Dispatcher", "line_number": 14, "usage_type": "call" }, { "api_name": "aiogram.types.Message", "line_number": 19, "usage_type": "attribute" }, { "api_name": "aiogram.typ...
3463628257
import gi try: gi.require_version('AppIndicator3', '0.1') gi.require_version('Gtk', '3.0') gi.require_version('GLib', '2.0') gi.require_version('GdkPixbuf', '2.0') except Exception as e: print(e) print('Repository version required not present') exit(1) from gi.repository import AppIndicator3...
atareao/lplayer
src/lplayer/indicator.py
indicator.py
py
10,974
python
en
code
40
github-code
21
[ { "api_name": "gi.require_version", "line_number": 3, "usage_type": "call" }, { "api_name": "gi.require_version", "line_number": 4, "usage_type": "call" }, { "api_name": "gi.require_version", "line_number": 5, "usage_type": "call" }, { "api_name": "gi.require_vers...
2166351638
import abc class Algorithm(metaclass = abc.ABCMeta): @abc.abstractmethod def getType(self): pass @abc.abstractmethod def run(self, para): pass import abc #数据抽象类 class Data(metaclass = abc.ABCMeta): @abc.abstractmethod def getType(self): pass import abc #数据抽象类 包括三种...
Travis-MA/YDY2020
Anatest/server.py
server.py
py
36,836
python
en
code
1
github-code
21
[ { "api_name": "abc.ABCMeta", "line_number": 3, "usage_type": "attribute" }, { "api_name": "abc.abstractmethod", "line_number": 5, "usage_type": "attribute" }, { "api_name": "abc.abstractmethod", "line_number": 9, "usage_type": "attribute" }, { "api_name": "abc.ABC...
14353482713
from argparse import Namespace import os import json import numpy as np import pandas as pd import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from torch.utils.data import Dataset, DataLoader import tqdm class Vocabulary: def __init__(self, token_to_idx=None): ...
mecha2k/py-nlp
src/torch-nlp/06 surname_classification_rnn.py
06 surname_classification_rnn.py
py
17,745
python
en
code
0
github-code
21
[ { "api_name": "numpy.zeros", "line_number": 107, "usage_type": "call" }, { "api_name": "numpy.int64", "line_number": 107, "usage_type": "attribute" }, { "api_name": "torch.utils.data.Dataset", "line_number": 136, "usage_type": "name" }, { "api_name": "torch.tensor...
24666143691
CAMERA_INDEX=1 REFRESH_INTERVAL=0.001 # In[1]: from vkfrontend import * import matplotlib.pyplot as plt import matplotlib.patches as patches import matplotlib.image as mpimage import numpy as np import colortools as ct import numpy as np import cv2 import math import scipy.ndimage as ndimage from myfunctio...
dolaram/iSynth-
code/virtualkeyboard/isynth_2.py
isynth_2.py
py
3,709
python
en
code
2
github-code
21
[ { "api_name": "matplotlib.pyplot.close", "line_number": 19, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 19, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.gcf", "line_number": 23, "usage_type": "call" }, { "api_name": "matpl...
13283591531
# Packages from datetime import datetime import folium import geopandas import ipywidgets as widgets from folium.plugins import MarkerCluster from matplotlib import pyplot as plt from ipywidgets import fixed from matplotlib import gridspec import pandas as pd import streamlit as st import numpy as np from streamlit_fo...
raphaelpalhano/Data_Science_ETL
aula_6/aula_6.py
aula_6.py
py
10,604
python
en
code
0
github-code
21
[ { "api_name": "streamlit.set_page_config", "line_number": 18, "usage_type": "call" }, { "api_name": "streamlit.dataframe", "line_number": 23, "usage_type": "call" }, { "api_name": "streamlit.title", "line_number": 29, "usage_type": "call" }, { "api_name": "streaml...
73034977013
# -*- coding: utf-8 -*- """ ======================================== Background information on configurations ======================================== This tutorial gives a short introduction to MNE configurations. """ import os.path as op import mne from mne.datasets.sample import data_path fname = op.join(data_pat...
LiuFang816/SALSTM_py_data
python/mne-tools_mne-python/mne-python-master/tutorials/plot_configuration.py
plot_configuration.py
py
3,875
python
en
code
9
github-code
21
[ { "api_name": "os.path.join", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path", "line_number": 14, "usage_type": "name" }, { "api_name": "mne.datasets.sample.data_path", "line_number": 14, "usage_type": "call" }, { "api_name": "mne.io.read_raw_fi...
26076682851
from flask import Flask, render_template, request import requests app = Flask(__name__) @app.route('/temperature', methods=['POST']) def temperature(): zipcode = request.form['zip'] r = requests.get('http://api.openweathermap.org/data/2.5/weather?zip='+zipcode+',no&units=metric&appid=2bb13bbb7d94a5f0e82e32c9d...
massouji82/Weather_App
app.py
app.py
py
579
python
en
code
0
github-code
21
[ { "api_name": "flask.Flask", "line_number": 4, "usage_type": "call" }, { "api_name": "flask.request.form", "line_number": 8, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 8, "usage_type": "name" }, { "api_name": "requests.get", "li...
44245351648
from django.db import models # Create your models here. class Departamento(models.Model): departamento = models.CharField('Departamento', max_length=255) def __str__(self): return self.departamento class Meta: verbose_name = 'Departamento' verbose_name_plural = 'Departamentos' cl...
renannoronha/iasd
escala/models.py
models.py
py
607
python
en
code
0
github-code
21
[ { "api_name": "django.db.models.Model", "line_number": 4, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 4, "usage_type": "name" }, { "api_name": "django.db.models.CharField", "line_number": 5, "usage_type": "call" }, { "api_name": "...
73037124533
import sys from datetime import datetime from time import mktime from telegram import (Audio, Contact, Document, Chat, Location, PhotoSize, Sticker, TelegramObject, User, Video, Voice, Venue, MessageEntity, Game) class Message(TelegramObject): """This object represents a Telegram Message. ...
LiuFang816/SALSTM_py_data
python/python-telegram-bot_python-telegram-bot/python-telegram-bot-master/telegram/message.py
message.py
py
24,704
python
en
code
9
github-code
21
[ { "api_name": "telegram.TelegramObject", "line_number": 9, "usage_type": "name" }, { "api_name": "telegram.User.de_json", "line_number": 184, "usage_type": "call" }, { "api_name": "telegram.User", "line_number": 184, "usage_type": "name" }, { "api_name": "datetime...
70125707252
import telebot from image_generator import ImageCreator from config import TG_TOKEN # Токен бота, полученный от BotFather TOKEN = TG_TOKEN # Создаем экземпляр бота bot = telebot.TeleBot(TOKEN) # Функция, которая будет вызываться при получении команды /start @bot.message_handler(commands=['start']) def send_welcome(m...
KirillovDV/photo-filler-generator-
bot.py
bot.py
py
2,219
python
ru
code
0
github-code
21
[ { "api_name": "config.TG_TOKEN", "line_number": 5, "usage_type": "name" }, { "api_name": "telebot.TeleBot", "line_number": 8, "usage_type": "call" }, { "api_name": "image_generator.ImageCreator", "line_number": 33, "usage_type": "call" } ]
12253698305
from pyspark.sql import SparkSession from pyspark.sql.types import * from pyspark.sql.functions import * def loadMovieNames(): movieNames = dict() with open("data/ml-100k/u.item", 'r', encoding='ISO-8859-1') as f: lines = f.readlines() for line in lines: fields = line.split('|') ...
gf234/spark_practice
advancedExamples/popularMoviesBroadcast.py
popularMoviesBroadcast.py
py
1,372
python
en
code
0
github-code
21
[ { "api_name": "pyspark.sql.SparkSession.builder.master", "line_number": 17, "usage_type": "call" }, { "api_name": "pyspark.sql.SparkSession.builder", "line_number": 17, "usage_type": "attribute" }, { "api_name": "pyspark.sql.SparkSession", "line_number": 17, "usage_type":...
32919881545
from concurrent.futures import ThreadPoolExecutor from concurrent.futures import as_completed import pandas as pd import yfinance as yf from tensorflow.keras.utils import Sequence import os import numpy as np from preprocessing import Factors, TweetPreprocessor class TweetGenerator(Sequence): def __init__(self...
NizarGhandri/bitcoin_sentiment_analysis
data_fetcher.py
data_fetcher.py
py
6,285
python
en
code
1
github-code
21
[ { "api_name": "tensorflow.keras.utils.Sequence", "line_number": 12, "usage_type": "name" }, { "api_name": "os.path.join", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path", "line_number": 17, "usage_type": "attribute" }, { "api_name": "preprocessi...
8176209583
import logging import time from common.asserts import assert_spacing, assert_section_spacing, assert_dimensions, assert_spacing_all_sides, verify_url logger = logging.getLogger(__name__) def assert_switch_from_expensify(browser, section_top, section_bottom, h2_spacing, list_spacing): #Assert section spacing s...
fylein/fyle-www-tests
pages/expensify/common/expensify.py
expensify.py
py
4,357
python
en
code
0
github-code
21
[ { "api_name": "logging.getLogger", "line_number": 5, "usage_type": "call" }, { "api_name": "common.asserts.assert_section_spacing", "line_number": 10, "usage_type": "call" }, { "api_name": "common.asserts.assert_spacing", "line_number": 14, "usage_type": "call" }, { ...
10450397532
from itertools import product import sys input = sys.stdin.readline def sol(): N,M = map(int,input().split()) for j in product(list(range(1,N+1)),repeat=M): print(*j) def sol2(): def dfs(depth): if depth == M: print(*result) return for target in range(1,N+1...
inkyu0103/BOJ
Backtracking/15651.py
15651.py
py
478
python
en
code
0
github-code
21
[ { "api_name": "sys.stdin", "line_number": 3, "usage_type": "attribute" }, { "api_name": "itertools.product", "line_number": 7, "usage_type": "call" } ]
29392963190
# -*- coding: utf-8 -*- """ Created on Mon Aug 7 20:30:15 2017 @author: chong """ from utilites import camera_cal, img_process from line_detection import linedet_win_sliding, linedet_conv, lane_polyfill, curv_cal from moviepy.editor import VideoFileClip import matplotlib.image as mpimg import matplotlib.pyp...
chongding/Self-Driving-Car-Term1-Project4-Advanced-Lane-Detection
video.py
video.py
py
2,952
python
en
code
0
github-code
21
[ { "api_name": "utilites.camera_cal", "line_number": 22, "usage_type": "call" }, { "api_name": "pickle.load", "line_number": 24, "usage_type": "call" }, { "api_name": "cv2.undistort", "line_number": 31, "usage_type": "call" }, { "api_name": "utilites.img_process", ...
25160810571
#!/usr/bin/env python # coding: utf-8 # In[1]: # Load in our libraries import pandas as pd import numpy as np import sklearn import matplotlib.pyplot as plt from sklearn.model_selection import train_test_split from sklearn import preprocessing from pandas.api.types import is_string_dtype from sklearn.metrics import ...
Machine-Learning-in-Credit-Scoring/Credit-Scoring
Credit scoring Code/credit_scoring.py
credit_scoring.py
py
4,024
python
en
code
11
github-code
21
[ { "api_name": "pandas.read_csv", "line_number": 28, "usage_type": "call" }, { "api_name": "sklearn.preprocessing.LabelEncoder", "line_number": 49, "usage_type": "call" }, { "api_name": "sklearn.preprocessing", "line_number": 49, "usage_type": "name" }, { "api_name...
43183939519
import numpy from control.plants.object_2D import Object_2D from control.controllers.basic_controllers import Composite, Controller, Gravity from control.estimators.forward import Forward from control.simulation import Simulator from control.environments.box import Box from control.animation import Animator, Anim_2D f...
youssefzaky/phd
Control/examples/ball.py
ball.py
py
1,902
python
en
code
0
github-code
21
[ { "api_name": "control.plants.object_2D.Object_2D", "line_number": 16, "usage_type": "call" }, { "api_name": "control.plants.object_2D", "line_number": 19, "usage_type": "name" }, { "api_name": "control.controllers.basic_controllers.Composite", "line_number": 19, "usage_t...
21976582076
import logging import warnings; warn = warnings.warn from collections import OrderedDict import os import pandas as pd import numpy as np from numpy import isnan, array # base class fot ATable from astropy.table import Table # definition of ATable's columns from .acolumn import AColumn # our versin of dataframe f...
EmptySpace/atable
atable/atable.py
atable.py
py
18,218
python
en
code
0
github-code
21
[ { "api_name": "warnings.warn", "line_number": 2, "usage_type": "attribute" }, { "api_name": "astropy.table.Table", "line_number": 27, "usage_type": "name" }, { "api_name": "acolumn.AColumn", "line_number": 36, "usage_type": "name" }, { "api_name": "adataframe.ADat...
7364004510
from django.views.generic import TemplateView from political_sisterhood.candidate.models import Candidate from django.http import HttpResponse, HttpResponseRedirect from django.shortcuts import redirect from django.contrib import messages from templated_email import send_templated_mail import os import json import logg...
2019politicalsisterhood/2019Candidates
config/views.py
views.py
py
3,019
python
en
code
1
github-code
21
[ { "api_name": "logging.getLogger", "line_number": 12, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 13, "usage_type": "attribute" }, { "api_name": "django.views.generic.TemplateView", "line_number": 15, "usage_type": "name" }, { "api_name": "p...
8888688535
''' Created on 2015��8��6�� @author: Kenneth Tse ''' #from _overlapped import NULL ''' Write a function to find the longest common prefix string amongst an array of strings. ''' """ class Solution: # @param {string[]} strs # @return {string} def longestCommonPrefix(self, strs): if...
DiamondGo/leetcode
python/LongestCommonPrefix.py
LongestCommonPrefix.py
py
1,572
python
en
code
0
github-code
21
[ { "api_name": "typing.List", "line_number": 37, "usage_type": "name" } ]
6105227084
import first_task import pytest tests = [ ('jTkd NDKek mdKW KDKN NnjD', 'Заглавных букв больше в 40.0% строк'), ('mfmKMKM kcmdKMS KDMKkmc snJMMCn nddjcj NCJDInc', 'Заглавных букв больше в 66.66666666666666% строк') ] @pytest.mark.parametrize('inp, answer', tests) def test_first(inp, answer): """Tests ch...
annashutova/homework_python
12.09.22/test_first.py
test_first.py
py
442
python
ru
code
0
github-code
21
[ { "api_name": "first_task.check_upper", "line_number": 14, "usage_type": "call" }, { "api_name": "pytest.mark.parametrize", "line_number": 11, "usage_type": "call" }, { "api_name": "pytest.mark", "line_number": 11, "usage_type": "attribute" } ]
37474005636
from youtube_dl import YoutubeDL as yt def download(link): ydl_opts = {"outtmpl": "C:\\Users\\HP\\Downloads\\vids\\%(title)s.%(ext)s", "quiet": True} with yt(ydl_opts) as ydl: ydl.download([str(link)]) videos = list() video = "" while video.lower() != "c": video = input("Paste link here (enter \"c\...
adzhanoev/YouTube-video-downloader
downloader.py
downloader.py
py
549
python
en
code
0
github-code
21
[ { "api_name": "youtube_dl.YoutubeDL", "line_number": 6, "usage_type": "call" } ]
1325626929
import os import sys from math import sqrt import torch from numpy import finfo from torch.autograd import Variable from torch import nn from torch.nn import functional as F root_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) sys.path.insert(0, root_path) from speech.tps.tps import get_symbols_l...
wladradchenko/wunjo.wladradchenko.ru
portable/src/tacotron2/model.py
model.py
py
27,548
python
en
code
404
github-code
21
[ { "api_name": "os.path.dirname", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path", "line_number": 11, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 11, "usage_type": "call" }, { "api_name": "sys.path.insert", "l...
31194227537
import os import re import json import argparse from rich.progress import Progress class TokenFinder: def __init__(self, output_file, custom_paths=None): self.output_file = output_file self.local = os.getenv('LOCALAPPDATA') self.roaming = os.getenv('APPDATA') self.paths = { ...
Wilbur42/Token-Logger
main.py
main.py
py
2,901
python
en
code
0
github-code
21
[ { "api_name": "os.getenv", "line_number": 11, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 12, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 35, "usage_type": "call" }, { "api_name": "re.findall", "line_number": 41, ...
17520069924
import io import math from operator import itemgetter from pathlib import Path import struct import typing from dataclasses import dataclass from collections import defaultdict _NUL_CHAR = b'\x00' _Header = struct.Struct("<4sIHHIII8s") _FileEntry = struct.Struct('<III') class Gar: class File(typing.NamedTuple): ...
leoetlino/jktool
jktool/gar.py
gar.py
py
6,734
python
en
code
0
github-code
21
[ { "api_name": "struct.Struct", "line_number": 11, "usage_type": "call" }, { "api_name": "struct.Struct", "line_number": 12, "usage_type": "call" }, { "api_name": "typing.NamedTuple", "line_number": 15, "usage_type": "attribute" }, { "api_name": "typing.Union", ...
10355811753
import pygame import random pygame.init() screen = pygame.display.set_mode([900,900]) pygame.display.set_caption("My First Game!") #Set up global variables class Ball(): xSpeed=ySpeed=colour=diameter=x=y=0 redBall = Ball() redBall.xSpeed = random.randint (-5,5) redBall.ySpeed = random.randint (-...
diligentaura/oldpypractice
BouncingBalls1_chana.py
BouncingBalls1_chana.py
py
3,658
python
en
code
1
github-code
21
[ { "api_name": "pygame.init", "line_number": 4, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 5, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 5, "usage_type": "attribute" }, { "api_name": "pygame.display.s...
11588878084
import torch import torch.nn as nn import torch.nn.functional as F import torchvision from torch.utils.data import DataLoader from torch.utils.tensorboard import SummaryWriter input = torch.tensor([[1, 2, 0, 3, 1], [0, 1, 2, 3, 1], [1, 2, 1, 0, 0], [5,...
287852793/pytorch
test_nn_maxpool.py
test_nn_maxpool.py
py
1,172
python
en
code
0
github-code
21
[ { "api_name": "torch.tensor", "line_number": 9, "usage_type": "call" }, { "api_name": "torch.float32", "line_number": 13, "usage_type": "attribute" }, { "api_name": "torch.reshape", "line_number": 15, "usage_type": "call" }, { "api_name": "torchvision.datasets.CIF...
37247532022
import multiprocessing import numpy as np import tensorflow as tf from tensorflow import keras from brevis.utils import * import brevis as branching import brevis.core as brevis from scipy.special import gammaln, digamma from scipy.special import logsumexp ################# Core functions ######################### cl...
SanityLacking/BrevisNet
brevis/losses/losses.py
losses.py
py
17,344
python
en
code
1
github-code
21
[ { "api_name": "tensorflow.keras", "line_number": 13, "usage_type": "attribute" }, { "api_name": "tensorflow.Variable", "line_number": 16, "usage_type": "call" }, { "api_name": "tensorflow.float32", "line_number": 16, "usage_type": "attribute" }, { "api_name": "ten...
12540699605
from collections import defaultdict class graph: def __init__(self): self.adjacencyList= defaultdict(list) def addEdge(self,source,destination): self.adjacencyList[source].append(destination) def BFS(self, start): queue=[] visited=[0]*len(self.adjacencyList) visited[start]=1 queue.append(start) whi...
yashshah15/interview-prep
bfs.py
bfs.py
py
592
python
en
code
0
github-code
21
[ { "api_name": "collections.defaultdict", "line_number": 5, "usage_type": "call" } ]
21102135882
import sys import tkinter as tk import requests import json import re from tkinter import messagebox import random class Spider: def __init__(self): self.video_api = "https://www.bilibili.com/video/av" # 视频信息 def get_api(api_url): ...
WindyJunsa/BiliBiliSpider
bilibili_support.py
bilibili_support.py
py
1,960
python
en
code
1
github-code
21
[ { "api_name": "requests.get", "line_number": 36, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 41, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 45, "usage_type": "call" }, { "api_name": "re.S", "line_number": 45, ...
75058251251
import numpy as np import collections from datetime import datetime from .channel import getChannelGrain4Token from .infrastructure import UNK, UNK_ID, specialTokens, specialTokensDict import pandas as pd ##################################################################################################TOKEN_LTU def bu...
floydluo/NLPText
nlptext/utils/vocab.py
vocab.py
py
5,450
python
en
code
1
github-code
21
[ { "api_name": "datetime.datetime.now", "line_number": 18, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 18, "usage_type": "name" }, { "api_name": "collections.Counter", "line_number": 19, "usage_type": "call" }, { "api_name": "datetime....
2720260121
import requests def fetch_todo(num): if num in range(1,201): url = f'https://jsonplaceholder.typicode.com/todos/{num}' response = requests.get(url) return response.json() else: return "Number should be between 1 to 200"
infuse-training-jan-2023/Practice_ANIS
Session-Anis/src/api_request.py
api_request.py
py
262
python
en
code
0
github-code
21
[ { "api_name": "requests.get", "line_number": 6, "usage_type": "call" } ]
11694256315
from flask import Flask, jsonify, request from flask_sqlalchemy import SQLAlchemy #from flask_marshmallow import Marshmallow from flask_cors import CORS,cross_origin import sqlite3 from threading import Lock # Initializing flask app app = Flask(__name__) CORS(app) conn = sqlite3.connect('crimeDBFinal.db', check_sa...
asayad1/CrimeData
backend/server.py
server.py
py
1,828
python
en
code
0
github-code
21
[ { "api_name": "flask.Flask", "line_number": 9, "usage_type": "call" }, { "api_name": "flask_cors.CORS", "line_number": 10, "usage_type": "call" }, { "api_name": "sqlite3.connect", "line_number": 12, "usage_type": "call" }, { "api_name": "threading.Lock", "line...
35664114630
#!/usr/bin/env python from __future__ import print_function import argparse from qsub import * def read_sim_sfs(sfs_file): """ reads in sfs file from mathmatica script output :param sfs_file: str :return: list """ sfs_line = ['\t'.join(x.rstrip('\n').split()) for x in open(sfs_file).readlines...
henryjuho/anavar_simulations
anavar1.2_indel/test_anavar1.2_multi_indel_disc.py
test_anavar1.2_multi_indel_disc.py
py
4,988
python
en
code
0
github-code
21
[ { "api_name": "argparse.ArgumentParser", "line_number": 22, "usage_type": "call" } ]
10586035400
# -*- coding:utf-8 -*- """ Author: XiangtaiLi """ import torch import torch.utils.data as data from torchvision import transforms, utils import pandas as pd import os, math, random from skimage import io from os.path import * import numpy as np from .utils import mask_dic class FashionAttributes(data.Dataset): """...
lxtGH/games
data/dataloader.py
dataloader.py
py
2,934
python
en
code
0
github-code
21
[ { "api_name": "torch.utils.data.Dataset", "line_number": 15, "usage_type": "attribute" }, { "api_name": "torch.utils.data", "line_number": 15, "usage_type": "name" }, { "api_name": "os.path.join", "line_number": 25, "usage_type": "call" }, { "api_name": "os.path",...
72099711732
# EXAMPLE USAGE: python twitter_miner.py 'test.csv' \#hillary \#trump # This will monitor hashtags with #hillary and #trump and save tweets to test.csv # Uses a twitter app API key for generic twitter mining. # Note that if you want to mine hashtags, you have to use \ to escape the # in the command line #Import t...
chrisalbon/second_2016_presidential_debate_twitter
twitter_miner.py
twitter_miner.py
py
4,065
python
en
code
10
github-code
21
[ { "api_name": "tweepy.streaming.StreamListener", "line_number": 20, "usage_type": "name" }, { "api_name": "sys.argv", "line_number": 24, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 29, "usage_type": "attribute" }, { "api_name": "csv.write...
73963139254
import discord from config import get_config config = get_config() async def create_discord_app() -> None: intents = discord.Intents.default() intents.message_content = True bot = discord.Client(intents=intents) @bot.event async def on_ready(): print(f'{bot.user} has connected to Disco...
mesiriak/kurumi
imps/ds/entrypoint.py
entrypoint.py
py
373
python
en
code
1
github-code
21
[ { "api_name": "config.get_config", "line_number": 5, "usage_type": "call" }, { "api_name": "discord.Intents.default", "line_number": 9, "usage_type": "call" }, { "api_name": "discord.Intents", "line_number": 9, "usage_type": "attribute" }, { "api_name": "discord.C...
42723831336
from webserver.app import app from flask import render_template, request import json, fnmatch import os import logging from datetime import date from logging.handlers import TimedRotatingFileHandler from prog.da_config import Config import prog.da_report web_datapath = "static/data/" app_datapath = "app/static/data/" ...
corneel27/day-ahead
webserver/app/routes.py
routes.py
py
6,756
python
en
code
36
github-code
21
[ { "api_name": "os.path.join", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path", "line_number": 13, "usage_type": "attribute" }, { "api_name": "prog.da_config.Config", "line_number": 14, "usage_type": "call" }, { "api_name": "logging.handlers.Time...
26744884148
import matplotlib.pyplot as plt import matplotlib.image as mpimg import numpy as np import cv2 import math import os #reading in an image image = mpimg.imread('test_images/solidWhiteRight.jpg') #printing out some stats and plotting print('This image is:', type(image), 'with dimensions:', image.shape) plt.imshow(ima...
AmeyaWagh/CarND-Finding_Lane_Lines
proj1.py
proj1.py
py
12,226
python
en
code
2
github-code
21
[ { "api_name": "matplotlib.image.imread", "line_number": 10, "usage_type": "call" }, { "api_name": "matplotlib.image", "line_number": 10, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.imshow", "line_number": 15, "usage_type": "call" }, { "api_name": "mat...
15224808687
import pytest import requests from apprise.plugins.NotifyRyver import NotifyRyver from helpers import AppriseURLTester # Disable logging for a cleaner testing output import logging logging.disable(logging.CRITICAL) # Our Testing URLs apprise_url_tests = ( ('ryver://', { 'instance': TypeError, }), ...
caronc/apprise
test/test_plugin_ryver.py
test_plugin_ryver.py
py
3,636
python
en
code
8,936
github-code
21
[ { "api_name": "logging.disable", "line_number": 9, "usage_type": "call" }, { "api_name": "logging.CRITICAL", "line_number": 9, "usage_type": "attribute" }, { "api_name": "apprise.plugins.NotifyRyver.NotifyRyver", "line_number": 34, "usage_type": "name" }, { "api_n...
30548272636
from telegram.ext import (Updater, PicklePersistence) from .handler import room_manager_conv_handler, private_base_conv_handler, tutorial_conv_handler, faq_conv_handler def _create_bot(token: str, bot_data_filename: str) -> Updater: """ Creates a new bot instance from the given token and loads the bot data fr...
ALLUOS/ALLUOS_PUBLIC_APP
src/bot/bot.py
bot.py
py
1,461
python
en
code
0
github-code
21
[ { "api_name": "telegram.ext.Updater", "line_number": 17, "usage_type": "call" }, { "api_name": "handler.room_manager_conv_handler", "line_number": 22, "usage_type": "argument" }, { "api_name": "handler.private_base_conv_handler", "line_number": 23, "usage_type": "argument...