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
27193127483
from collections import namedtuple import re import string import logging import pickle class Files: dictionary = "dataset/nettalk.data" top1000words = "dataset/nettalk.list" continuous = "dataset/data" Word = namedtuple('Word', ['letters', 'phonemes', 'structure', 'correspondance']) all_letters = strin...
dtingley/netwhisperer
corpus.py
corpus.py
py
5,330
python
en
code
1
github-code
36
[ { "api_name": "collections.namedtuple", "line_number": 12, "usage_type": "call" }, { "api_name": "string.ascii_lowercase", "line_number": 14, "usage_type": "attribute" }, { "api_name": "logging.debug", "line_number": 144, "usage_type": "call" }, { "api_name": "re....
9862393543
import random from flask import Flask, render_template, request import tensorflow as tf import numpy as np from io import BytesIO from PIL import Image import base64 import os # initiates flask app app = Flask(__name__) tf.get_logger().setLevel('ERROR') model = None model = tf.keras.models.load_model("prod_model.h5...
joeschueren/SketchDetect
main.py
main.py
py
4,108
python
en
code
0
github-code
36
[ { "api_name": "flask.Flask", "line_number": 11, "usage_type": "call" }, { "api_name": "tensorflow.get_logger", "line_number": 13, "usage_type": "call" }, { "api_name": "tensorflow.keras.models.load_model", "line_number": 17, "usage_type": "call" }, { "api_name": "...
42528330524
import requests from bs4 import BeautifulSoup import re import json import sys import eventlet import concurrent.futures import Constants class Scraper: def __init__(self, url_to_check): self.BASE_URL = url_to_check self.dictionary = {} @staticmethod def get_html(url): try: ...
Hayk1997gh/Broken_Link_Checker
Scraper.py
Scraper.py
py
3,659
python
en
code
0
github-code
36
[ { "api_name": "requests.get", "line_number": 21, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 22, "usage_type": "call" }, { "api_name": "requests.exceptions", "line_number": 23, "usage_type": "attribute" }, { "api_name": "Constants.WEB...
31691135600
""" Module: libfmp.c8.c8s1_hps Author: Meinard Müller, Frank Zalkow License: The MIT license, https://opensource.org/licenses/MIT This file is part of the FMP Notebooks (https://www.audiolabs-erlangen.de/FMP) """ from collections import OrderedDict import numpy as np from scipy import signal import librosa...
christofw/pitchclass_mctc
libfmp/c8/c8s1_hps.py
c8s1_hps.py
py
8,127
python
en
code
20
github-code
36
[ { "api_name": "scipy.signal.medfilt", "line_number": 21, "usage_type": "call" }, { "api_name": "scipy.signal", "line_number": 21, "usage_type": "name" }, { "api_name": "scipy.signal.medfilt", "line_number": 28, "usage_type": "call" }, { "api_name": "scipy.signal",...
423347793
import numpy as np import yfinance as yf import ta import pandas as pd from ta.trend import ADXIndicator import pyxirr def get_clean_df(ticker): df = yf.Ticker(ticker).history( period="10y").reset_index()[["Date", "Close", "Dividends", 'High', "Low"]] df["Close"] = yf.download(tickers=ticker, period=...
victormorizon/stable-dividend-stock-trading-strategy
functions.py
functions.py
py
5,229
python
en
code
1
github-code
36
[ { "api_name": "yfinance.Ticker", "line_number": 10, "usage_type": "call" }, { "api_name": "yfinance.download", "line_number": 13, "usage_type": "call" }, { "api_name": "ta.momentum.RSIIndicator", "line_number": 15, "usage_type": "call" }, { "api_name": "ta.momentu...
24669291411
import requests, json import pandas as pd import os from datetime import date #from mysql.connector import connect, Error from flatten_json import flatten from airflow.models import Variable ''' Connects to the edamam API and sends a request Return: The response object from the API query ''' def airflow_var_test( ti...
JoshusTenakhongva/Mentorship_Repo
food_at_home/dags/airflow_functions.py
airflow_functions.py
py
5,053
python
en
code
1
github-code
36
[ { "api_name": "airflow.models.Variable.get", "line_number": 16, "usage_type": "call" }, { "api_name": "airflow.models.Variable", "line_number": 16, "usage_type": "name" }, { "api_name": "os.getcwd", "line_number": 20, "usage_type": "call" }, { "api_name": "airflow...
32262924755
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('polls', '0011_response'), ] operations = [ migrations.RemoveField( model_name='question', name='weig...
mikelaughton/harold
polls/migrations/0012_auto_20160804_0005.py
0012_auto_20160804_0005.py
py
630
python
en
code
0
github-code
36
[ { "api_name": "django.db.migrations.Migration", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 7, "usage_type": "name" }, { "api_name": "django.db.migrations.RemoveField", "line_number": 14, "usage_type": "call" }, ...
35217766012
from itertools import product import sys from bs4 import BeautifulSoup from selenium import webdriver import time import json import random sys.path.append('../..') from lib import excelUtils from lib import httpUtils from lib import textUtil from lib.htmlEleUtils import getNodeText from lib.htmlEleUtils import getInn...
Just-Doing/python-caiji
src/work/20230110/bio-fount.py
bio-fount.py
py
4,549
python
en
code
1
github-code
36
[ { "api_name": "sys.path.append", "line_number": 9, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "selenium.webdriver.ChromeOptions", "line_number": 23, "usage_type": "call" }, { "api_name": "selenium...
38097195752
import matplotlib matplotlib.use('Qt5Agg') import matplotlib.pyplot as plt import numpy as np import pickle import time from os.path import exists from GaslightEnv import GaslightEnv from stable_baselines3 import PPO, TD3 from stable_baselines3.common.callbacks import CheckpointCallback from stable_baselines3.common.e...
RajatSethi2001/Gaslight
GaslightEngine.py
GaslightEngine.py
py
6,819
python
en
code
0
github-code
36
[ { "api_name": "matplotlib.use", "line_number": 2, "usage_type": "call" }, { "api_name": "stable_baselines3.common.callbacks.CheckpointCallback", "line_number": 17, "usage_type": "name" }, { "api_name": "pickle.load", "line_number": 37, "usage_type": "call" }, { "a...
30176950739
from functools import cache def najcenejsa_pot(mat): m, n = len(mat), len(mat[0]) @cache def pomozna(i, j): if i == m - 1 and j == n - 1: return (mat[-1][-1], "o") else: moznosti = [] if i < m - 1: cena_dol, pot_dol = pomozna(i + 1, j) ...
matijapretnar/programiranje-1
13-memoizacija-v-pythonu/predavanja/pot.py
pot.py
py
772
python
en
code
6
github-code
36
[ { "api_name": "functools.cache", "line_number": 5, "usage_type": "name" } ]
6172988761
from google.cloud import texttospeech from pydub import AudioSegment from pydub.playback import play google_credentials_file = "PATH_TO_YOUR_GOOGLE_CREDENTIALS_JSON" # Set the environment variable for Google Text-to-Speech API os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = google_credentials_file # Initialize Google...
qiusiyuan/gpt-live-stream
src/bilibiligptlive/tts.py
tts.py
py
1,133
python
en
code
0
github-code
36
[ { "api_name": "google.cloud.texttospeech.TextToSpeechClient", "line_number": 11, "usage_type": "call" }, { "api_name": "google.cloud.texttospeech", "line_number": 11, "usage_type": "name" }, { "api_name": "google.cloud.texttospeech.SynthesisInput", "line_number": 14, "usa...
32846235212
#Goal of this project is to make a song that we like on youtube go directly to our spotify "liked youtube songs" playlist """ STEPS 1 - Log into youtube 2 - Grab our playlist 3 - Create a new playlist 4 - Search the song 5 - Add the song to the spotify playlist """ import json import os import google_auth_oauthlib.fl...
GiovaniCenta/YoutubetoSpotify
spotyoutube.py
spotyoutube.py
py
6,243
python
en
code
0
github-code
36
[ { "api_name": "os.environ", "line_number": 39, "usage_type": "attribute" }, { "api_name": "google_auth_oauthlib.flow.flow.InstalledAppFlow.from_client_secrets_file", "line_number": 47, "usage_type": "call" }, { "api_name": "google_auth_oauthlib.flow.flow", "line_number": 47, ...
16515229074
import time from werkzeug.wrappers import Response import netmanthan import netmanthan.rate_limiter from netmanthan.rate_limiter import RateLimiter from netmanthan.tests.utils import netmanthanTestCase from netmanthan.utils import cint class TestRateLimiter(netmanthanTestCase): def test_apply_with_limit(self): n...
netmanthan/Netmanthan
netmanthan/tests/test_rate_limiter.py
test_rate_limiter.py
py
3,663
python
en
code
0
github-code
36
[ { "api_name": "netmanthan.tests.utils.netmanthanTestCase", "line_number": 12, "usage_type": "name" }, { "api_name": "netmanthan.conf", "line_number": 14, "usage_type": "attribute" }, { "api_name": "netmanthan.rate_limiter.apply", "line_number": 15, "usage_type": "call" ...
73325698663
from sklearn.datasets import load_iris from sklearn.model_selection import train_test_split from sklearn import tree import pydotplus iris = load_iris() iris_X = iris.data iris_Y = iris.target X_train, X_test, y_train, y_test = train_test_split( iris_X, iris_Y, test_size=0.3) clf = tree.DecisionTreeClassifier() c...
beancookie/sklearn
tree.py
tree.py
py
473
python
en
code
0
github-code
36
[ { "api_name": "sklearn.datasets.load_iris", "line_number": 6, "usage_type": "call" }, { "api_name": "sklearn.model_selection.train_test_split", "line_number": 9, "usage_type": "call" }, { "api_name": "sklearn.tree.DecisionTreeClassifier", "line_number": 12, "usage_type": ...
2986533119
from selenium.common.exceptions import NoSuchElementException from selenium.webdriver.common.by import By import time from constants import URL def get_product_properties(browser): properties = {} search_result = browser.find_element(By.CLASS_NAME, "sooqrSearchResults") title = search_result.fin...
Felix-95/programming_challenge
src/scraper.py
scraper.py
py
3,238
python
en
code
0
github-code
36
[ { "api_name": "selenium.webdriver.common.by.By.CLASS_NAME", "line_number": 10, "usage_type": "attribute" }, { "api_name": "selenium.webdriver.common.by.By", "line_number": 10, "usage_type": "name" }, { "api_name": "selenium.webdriver.common.by.By.CLASS_NAME", "line_number": 1...
72516592744
import time import datetime from timeit import default_timer as timer import settings from pymongo import MongoClient from faker import Faker from bson.decimal128 import Decimal128 import random fake = Faker() #### # Start script #### startTs = time.gmtime() start = timer() print("================================") p...
blainemincey/generate_sample_data
generate_transactions_data.py
generate_transactions_data.py
py
2,781
python
en
code
1
github-code
36
[ { "api_name": "faker.Faker", "line_number": 10, "usage_type": "call" }, { "api_name": "time.gmtime", "line_number": 15, "usage_type": "call" }, { "api_name": "timeit.default_timer", "line_number": 16, "usage_type": "call" }, { "api_name": "time.strftime", "lin...
35860587241
from fastapi import FastAPI, Depends from sqlalchemy.orm import Session from typing import List, Optional from database import SessionLocal, engine import models, schemas, crud # データベース作成 models.Base.metadata.create_all(bind=engine) app = FastAPI() def get_db(): db = SessionLocal() try: yield db ...
ishi23/fastapi-streamlit
conf_app_test/sql_app/main.py
main.py
py
3,816
python
en
code
0
github-code
36
[ { "api_name": "models.Base.metadata.create_all", "line_number": 9, "usage_type": "call" }, { "api_name": "models.Base", "line_number": 9, "usage_type": "attribute" }, { "api_name": "database.engine", "line_number": 9, "usage_type": "name" }, { "api_name": "fastapi...
14029297694
import asyncio import datetime import os import discord from new_skyline2 import SKYLINE token = os.environ['token'] loop = asyncio.get_event_loop() client = SKYLINE(loop=loop, intents=discord.Intents.all()) async def main(): now = datetime.datetime.utcnow() endtime = now.replace(hour=17, minute=1, second=...
Kesigomon/Skyline_py
run.py
run.py
py
870
python
en
code
7
github-code
36
[ { "api_name": "os.environ", "line_number": 9, "usage_type": "attribute" }, { "api_name": "asyncio.get_event_loop", "line_number": 10, "usage_type": "call" }, { "api_name": "new_skyline2.SKYLINE", "line_number": 11, "usage_type": "call" }, { "api_name": "discord.In...
19082484272
import cv2 import sys import numpy as np class Context: def __init__(self): self.sliders = {} self.toggles = {} self._redraw = False self.cur_buf_id = 0; self.buffers = [] self.buffers_by_name = {} self._once = [] self._store = {} cv2.namedWi...
Phaiax/sudoku
src/context.py
context.py
py
3,957
python
en
code
0
github-code
36
[ { "api_name": "cv2.namedWindow", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 35, "usage_type": "call" }, { "api_name": "numpy.uint8", "line_number": 35, "usage_type": "attribute" }, { "api_name": "sys.stdout.flush", "...
14054446569
import numpy as np import cv2 from .kalman import Kalman #https://github.com/uoip/monoVO-python def get_R(alpha): M = np.array([[np.cos(np.pi*alpha/180), np.sin(np.pi*alpha/180)], [-np.sin(np.pi*alpha/180), np.cos(np.pi*alpha/180)] ]) return M def show_direction(image, t, M): line_thic...
vvabi-sabi/drone_RK3588
addons/odometry/odometry.py
odometry.py
py
2,434
python
en
code
2
github-code
36
[ { "api_name": "numpy.array", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.cos", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.pi", "line_number": 9, "usage_type": "attribute" }, { "api_name": "numpy.sin", "line_number": 9, ...
39914551744
from fastapi import APIRouter, HTTPException, Request from utils.model import * from services.camera_service import camera_service from services.server_service import server_service import requests import threading router = APIRouter(prefix="/camera") @router.get("/{server_name}") async def get_camera(server_name: st...
ngocthien2306/be-cctv
src/router/camera_router.py
camera_router.py
py
4,936
python
en
code
0
github-code
36
[ { "api_name": "fastapi.APIRouter", "line_number": 8, "usage_type": "call" }, { "api_name": "services.server_service.server_service.get_by_server_name", "line_number": 12, "usage_type": "call" }, { "api_name": "services.server_service.server_service", "line_number": 12, "u...
31524035648
import pandas as pd import numpy as np from typing import List from loguru import logger from meche_copilot.utils.num_tokens_from_string import num_tokens_from_string def combine_dataframe_chunks(dfs: List[pd.DataFrame]) -> pd.DataFrame: if all(df.shape[1] == dfs[0].shape[1] for df in dfs): return pd.conca...
fuzzy-tribble/meche-copilot
meche_copilot/utils/chunk_dataframe.py
chunk_dataframe.py
py
4,373
python
en
code
1
github-code
36
[ { "api_name": "typing.List", "line_number": 7, "usage_type": "name" }, { "api_name": "pandas.DataFrame", "line_number": 7, "usage_type": "attribute" }, { "api_name": "pandas.concat", "line_number": 9, "usage_type": "call" }, { "api_name": "pandas.concat", "lin...
23382530066
# -*- coding: utf-8 -*- import re import json import time import scrapy import requests import itertools from lxml import etree from hashlib import md5 from overseaSpider.items import ShopItem, SkuAttributesItem, SkuItem from overseaSpider.util.scriptdetection import detection_main from overseaSpider.util.utils import...
husky-happy/templatespider
overseaSpider/spiders/xg/samys.py
samys.py
py
6,903
python
en
code
0
github-code
36
[ { "api_name": "scrapy.Spider", "line_number": 18, "usage_type": "attribute" }, { "api_name": "overseaSpider.util.utils.isLinux", "line_number": 27, "usage_type": "call" }, { "api_name": "re.findall", "line_number": 60, "usage_type": "call" }, { "api_name": "re.S",...
3784075084
############################################################################### # make park model ############################################################################### import cantera as ct import numpy as np import pandas as pd import os import matplotlib.pyplot as plt import rmgpy from rmgpy.data.thermo im...
comocheng/meOH-analysis
External_data/park_et_al_model_reconstruction/make_park_model.py
make_park_model.py
py
14,690
python
en
code
0
github-code
36
[ { "api_name": "rmgpy.species.Species", "line_number": 34, "usage_type": "call" }, { "api_name": "rmgpy.species.Species", "line_number": 62, "usage_type": "call" }, { "api_name": "copy.deepcopy", "line_number": 98, "usage_type": "call" }, { "api_name": "rmgpy.kinet...
23002903726
import sqlite3 connection = sqlite3.connect('databasePeças.db') c = connection.cursor() def CREATE(): # PEÇA # c.execute('CREATE TABLE IF NOT EXISTS PECA (\ `codigo` VARCHAR(5) NOT NULL,\ `nomeSingular` VARCHAR(25) NOT NULL,\ `nomePlural` VARCHAR(25) NOT NULL,\ `gene...
GilbertoMJ/Projeto-Andaimes
Scripts Banco de Dados/criar_database_Peça.py
criar_database_Peça.py
py
473
python
en
code
0
github-code
36
[ { "api_name": "sqlite3.connect", "line_number": 3, "usage_type": "call" } ]
7813711056
"""clean up unused tables Create Date: 2022-05-02 17:19:09.910095 """ from alembic import op # revision identifiers, used by Alembic. revision = "20220502_171903" down_revision = "20220425_225456" branch_labels = None depends_on = None def upgrade(): op.drop_table("region_types", schema="aspen") op.drop_ta...
chanzuckerberg/czgenepi
src/backend/database_migrations/versions/20220502_171903_clean_up_unused_tables.py
20220502_171903_clean_up_unused_tables.py
py
1,530
python
en
code
11
github-code
36
[ { "api_name": "alembic.op.drop_table", "line_number": 16, "usage_type": "call" }, { "api_name": "alembic.op", "line_number": 16, "usage_type": "name" }, { "api_name": "alembic.op.drop_table", "line_number": 17, "usage_type": "call" }, { "api_name": "alembic.op", ...
15826519032
import json import logging logging.basicConfig(level=logging.DEBUG) import argparse import uuid import emission.storage.decorations.user_queries as esdu import emission.net.ext_service.push.notify_usage as pnu import emission.net.ext_service.push.query.dispatch as pqd import emission.core.wrapper.user as ecwu import e...
e-mission/e-mission-server
bin/monitor/prompt_upgrade_to_latest.py
prompt_upgrade_to_latest.py
py
4,640
python
en
code
22
github-code
36
[ { "api_name": "logging.basicConfig", "line_number": 3, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 3, "usage_type": "attribute" }, { "api_name": "emission.net.ext_service.push.query.dispatch.get_query_fn", "line_number": 14, "usage_type": "call" ...
39157550873
#!/usr/bin/env python3 import click import sys from pathlib import Path from RecBlast.RecBlast import RecSearch import RecBlast.WarningsExceptions as RBWE def deduce_searchtype(query_type, db_type, search_algorithm): # a bit of cleaning query_type = query_type.lower() db_type = db_type.lower() search...
docmanny/smRecSearch
code/rbb.py
rbb.py
py
6,528
python
en
code
1
github-code
36
[ { "api_name": "RecBlast.WarningsExceptions.SearchEngineNotImplementedError", "line_number": 51, "usage_type": "call" }, { "api_name": "RecBlast.WarningsExceptions", "line_number": 51, "usage_type": "name" }, { "api_name": "pathlib.Path", "line_number": 86, "usage_type": "...
43110008124
from codecs import open from os import path import re from setuptools import setup, find_packages dot = path.abspath(path.dirname(__file__)) # get the dependencies and installs with open(path.join(dot, 'requirements.txt'), encoding='utf-8') as f: all_reqs = f.read().split('\n') install_requires = [x.strip() for ...
rarescosma/env.cloudy
setup.py
setup.py
py
1,466
python
en
code
0
github-code
36
[ { "api_name": "os.path.abspath", "line_number": 6, "usage_type": "call" }, { "api_name": "os.path", "line_number": 6, "usage_type": "name" }, { "api_name": "os.path.dirname", "line_number": 6, "usage_type": "call" }, { "api_name": "codecs.open", "line_number":...
36684803245
import pandas as pd import tekore as tk from config import CLIENT_ID, CLIENT_SECRET class SpotifyData: def get_one_song_data(self, query): token = tk.request_client_token(CLIENT_ID, CLIENT_SECRET) spotify = tk.Spotify(token) searched_track = spotify.search(query, types=('track',), market=...
SINEdowskY/spotify-songs-classification
spotify_data.py
spotify_data.py
py
3,351
python
en
code
1
github-code
36
[ { "api_name": "tekore.request_client_token", "line_number": 9, "usage_type": "call" }, { "api_name": "config.CLIENT_ID", "line_number": 9, "usage_type": "argument" }, { "api_name": "config.CLIENT_SECRET", "line_number": 9, "usage_type": "argument" }, { "api_name":...
30568657844
import matplotlib.pyplot as plt import numpy as np plt.rcParams["text.usetex"] = True LEGEND_FONTSIZE = 20 TICK_LABEL_FONTSIZE = 20 AXIS_LABEL_FONTSIZE = 20 TITLE_FONTSIZE = 20 CHART_SIZE = [10, 6] LONG_CHART_SIZE = [10, 10] def do_nothing_Rt_plot(Rt_dict, fname=None, ps=True): fig, ax = plt.subplots(1, 1, figs...
jvanyperen/exploring-interventions-manuscript
plotting_scripts/do_nothing_plots.py
do_nothing_plots.py
py
3,549
python
en
code
0
github-code
36
[ { "api_name": "matplotlib.pyplot.rcParams", "line_number": 4, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot", "line_number": 4, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.subplots", "line_number": 15, "usage_type": "call" }, { "api_na...
2922309209
import numpy as np import json def dump_to_file(arrays, filename): arrays_for_dump = {} for key, array in arrays.items(): if isinstance(array, np.ndarray): arrays_for_dump[key] = array.tolist() else: arrays_for_dump[key] = array if isinstance(array, dict): try: for k,v i...
sdemyanov/tensorflow-worklab
classes/utils.py
utils.py
py
951
python
en
code
24
github-code
36
[ { "api_name": "numpy.ndarray", "line_number": 7, "usage_type": "attribute" }, { "api_name": "json.dump", "line_number": 18, "usage_type": "call" }, { "api_name": "json.load", "line_number": 23, "usage_type": "call" }, { "api_name": "numpy.asarray", "line_numbe...
32259680615
# pylint: disable=W0613 from flask import request from injector import inject from app import app from app.regali_app.list.application.use_cases import ( get_gift_list, get_gift_lists, delete_gift_list, create_gift_list, delete_gift_list_element, create_gift_list_element ) from app.regali_app.s...
MikelDB/regali-app
api/app/regali_app/shared/infrastructure/routes/giftlist.py
giftlist.py
py
2,209
python
en
code
0
github-code
36
[ { "api_name": "app.regali_app.list.application.use_cases.create_gift_list.UseCase", "line_number": 22, "usage_type": "attribute" }, { "api_name": "app.regali_app.list.application.use_cases.create_gift_list", "line_number": 22, "usage_type": "name" }, { "api_name": "app.regali_app...
30715666439
import math from typing import List import os from app.resources.logger import logger def get_block_entropy(block: bytes, block_size: int) -> float: # start counters counters = {byte: 0 for byte in range(2 ** 8)} for byte in block: counters[byte] += 1 # calculate probabilities for each byte ...
jstrah00/entropy-service
app/entropy/entropy.py
entropy.py
py
1,960
python
en
code
0
github-code
36
[ { "api_name": "math.log2", "line_number": 16, "usage_type": "call" }, { "api_name": "typing.List", "line_number": 22, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 35, "usage_type": "name" }, { "api_name": "os.path.exists", "line_number":...
71760953383
"""module used to create a matrix containing the distances between the postcodes that specify the locations of the specified geographies""" import os import pandas as pd from math import radians, sin, cos, sqrt, atan2 import csv import datetime as dt def calc_dist(inlat1, inlat2, inlong1, inlong2): """simple fu...
ONSdigital/FOCUS
matrix_generation.py
matrix_generation.py
py
3,360
python
en
code
0
github-code
36
[ { "api_name": "math.radians", "line_number": 16, "usage_type": "call" }, { "api_name": "math.radians", "line_number": 17, "usage_type": "call" }, { "api_name": "math.radians", "line_number": 18, "usage_type": "call" }, { "api_name": "math.radians", "line_numbe...
15855737914
import threading import socket import json import termcolor import time import numpy as np import pandas as pd host = '127.0.0.1'#server ip port = 5555 #server port #Create a new socket using the given address family, socket type and protocol number. #ipv4 family #TCP (SOCK_STREAM) is a connection-based protocol. The ...
adnankarim/python_socket_chat_client_client
server.py
server.py
py
4,451
python
en
code
0
github-code
36
[ { "api_name": "socket.socket", "line_number": 14, "usage_type": "call" }, { "api_name": "socket.AF_INET", "line_number": 14, "usage_type": "attribute" }, { "api_name": "socket.SOCK_STREAM", "line_number": 14, "usage_type": "attribute" }, { "api_name": "socket.SOL_...
35692497306
from django.contrib.auth.models import User from django.http import HttpResponseRedirect from django.views.generic import FormView from atelier.models import Profile from django.views import generic from atelier.forms import ProfileRegisterForm, ProfileChangeForm from django.urls import reverse_lazy from atelier.views....
Vitamal/vokss
atelier/views/profile_view.py
profile_view.py
py
3,721
python
en
code
0
github-code
36
[ { "api_name": "atelier.views.base_view.TailorPermissionPreMixin", "line_number": 12, "usage_type": "name" }, { "api_name": "atelier.views.base_view.AtelierFilterObjectsPreMixin", "line_number": 12, "usage_type": "name" }, { "api_name": "atelier.views.base_view.BaseDetailView", ...
8688324279
import sys import gammalib from utils import * import numpy as np import matplotlib.pyplot as plt # first input is XML file name models = gammalib.GModels(sys.argv[1]) # second and third input are minimum and maximum energy in TeV emin = float(sys.argv[2]) emax = float(sys.argv[3]) lons, lats, radii, fluxes, names = ...
cta-observatory/cta-gps-simulation-paper
skymodel/scripts/logNlogS_fromgammalib.py
logNlogS_fromgammalib.py
py
1,141
python
en
code
0
github-code
36
[ { "api_name": "gammalib.GModels", "line_number": 8, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 8, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 10, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_numbe...
19075073256
import matplotlib.pyplot as plt import math def pre_processing(filename): file = open(filename) lines = file.readlines() cities = [[]] n = int(lines[0]) for l in lines[1:]: cities.append(list(map(float, l.split()))) adj_mat = [[None] * (n+1) for i in range(n+1)] x = [float(i[0]) ...
LouisYLWang/Algorithms
Traveling_salesman_problem/tsp.py
tsp.py
py
2,261
python
en
code
0
github-code
36
[ { "api_name": "matplotlib.pyplot.scatter", "line_number": 16, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 16, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.show", "line_number": 17, "usage_type": "call" }, { "api_name": "ma...
1535928941
import os import logging import shutil import json from packratAgent.Collection import Collection from packratAgent.LocalRepoManager import LocalRepoManager, hashFile MODULE_OWNER = 'packrat' class AnsibleGalaxyManager( LocalRepoManager ): def __init__( self, *args, **kargs ): super().__init__( *args, **karg...
pnhowe/packrat-agent
packratAgent/AnsibleGalaxyManager.py
AnsibleGalaxyManager.py
py
4,856
python
en
code
null
github-code
36
[ { "api_name": "packratAgent.LocalRepoManager.LocalRepoManager", "line_number": 13, "usage_type": "name" }, { "api_name": "os.path.join", "line_number": 22, "usage_type": "call" }, { "api_name": "os.path", "line_number": 22, "usage_type": "attribute" }, { "api_name...
2251848233
import argparse import pygame as pg def create_circle(size, circle_color, background_color, filename): # margin = int(0.1 * size) margin = 0 screen = pg.display.set_mode((2 * size + margin, 2 * size + margin)) screen.fill(background_color) x = screen.get_width() // 2 y = screen.get_height() // 2 pg.draw...
thbeucher/Games
life_games/create_image.py
create_image.py
py
2,507
python
en
code
0
github-code
36
[ { "api_name": "pygame.display.set_mode", "line_number": 8, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 8, "usage_type": "attribute" }, { "api_name": "pygame.draw.circle", "line_number": 12, "usage_type": "call" }, { "api_name": "pygame.d...
5750408592
import nltk from nltk.tokenize import sent_tokenize nltk.download('stopwords') nltk.download('punkt') nltk.download('gutenberg') from tqdm import tqdm import string from collections import Counter from flair.models import SequenceTagger from flair.data import Sentence book = nltk.corpus.gutenberg.raw('carroll-alice.t...
francelow/eBookSummarizer
NER_model.py
NER_model.py
py
2,245
python
en
code
0
github-code
36
[ { "api_name": "nltk.download", "line_number": 3, "usage_type": "call" }, { "api_name": "nltk.download", "line_number": 4, "usage_type": "call" }, { "api_name": "nltk.download", "line_number": 5, "usage_type": "call" }, { "api_name": "nltk.corpus.gutenberg.raw", ...
74050091304
from tempfile import NamedTemporaryFile from typing import Any, Dict, List, Tuple from parlai.core.image_featurizers import ImageLoader from parlai.core.message import Message from parlai.core.worlds import validate from parlai.crowdsourcing.tasks.model_chat.utils import Compatibility, get_image_src from parlai.crowds...
facebookresearch/ParlAI
parlai/crowdsourcing/tasks/model_chat/worlds_image_chat.py
worlds_image_chat.py
py
5,459
python
en
code
10,365
github-code
36
[ { "api_name": "parlai.crowdsourcing.tasks.model_chat.worlds.BaseModelChatWorld", "line_number": 14, "usage_type": "name" }, { "api_name": "parlai.core.message.Message", "line_number": 19, "usage_type": "name" }, { "api_name": "parlai.crowdsourcing.tasks.model_chat.utils.get_image...
1428891150
import argparse import shutil import numpy as np from matplotlib import image,pyplot import os import cv2 import json parser = argparse.ArgumentParser() parser.add_argument('--MaskedImageFolder', type=str) parser.add_argument('--FullImageFolder', type=str) args = parser.parse_args() pathX = os.path.join(args.MaskedIm...
unlugi/gen-inpainting-eccv
prepare_dataset_2.py
prepare_dataset_2.py
py
2,188
python
en
code
3
github-code
36
[ { "api_name": "argparse.ArgumentParser", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path", "line_number": 14, "usage_type": "attribute" }, { "api_name": "os.path.join", "...
43777238511
import numpy as np import cv2 as cv import matplotlib.pyplot as plt import time MIN_MATCH_COUNT = 10 img_sample = cv.cvtColor(cv.imread("./img/dataset/9.png",cv.IMREAD_COLOR),cv.COLOR_BGR2GRAY) img_q = cv.cvtColor(cv.imread("./img/query/3.png",cv.IMREAD_COLOR),cv.COLOR_BGR2GRAY) sift = cv.SIFT_create() keypoints_1...
Laurie-xzh/AI-Practice
CV/Point_Feature_Match/test.py
test.py
py
2,845
python
en
code
0
github-code
36
[ { "api_name": "cv2.cvtColor", "line_number": 8, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 8, "usage_type": "call" }, { "api_name": "cv2.IMREAD_COLOR", "line_number": 8, "usage_type": "attribute" }, { "api_name": "cv2.COLOR_BGR2GRAY", "...
15560983692
import argparse import os import subprocess import sys from pathlib import Path _SWIFT_PATH = Path(__file__).resolve().parents[1] _KNOWN_SCRIPT_PATHS = [ _SWIFT_PATH / "benchmark/scripts/Benchmark_Driver", _SWIFT_PATH / "benchmark/scripts/Benchmark_DTrace.in", _SWIFT_PATH / "benchmark/scripts/Benchmark_G...
apple/swift
utils/python_format.py
python_format.py
py
4,666
python
en
code
64,554
github-code
36
[ { "api_name": "pathlib.Path", "line_number": 8, "usage_type": "call" }, { "api_name": "sys.executable", "line_number": 70, "usage_type": "attribute" }, { "api_name": "os.devnull", "line_number": 78, "usage_type": "attribute" }, { "api_name": "subprocess.call", ...
42491959106
""" 10:05 시작 """ import sys import copy from collections import deque def func(): N, L, R = map(int, sys.stdin.readline().split()) land = [] for i in range(N): land.append(list(map(int, sys.stdin.readline().split()))) if N == 1: return 0 time = 0 while time < 2000: # 200...
Mugamta/Boostcamp_AITech5_CV11
3.22/서지훈_백준_16234_인구이동.py
서지훈_백준_16234_인구이동.py
py
2,430
python
ko
code
0
github-code
36
[ { "api_name": "sys.stdin.readline", "line_number": 12, "usage_type": "call" }, { "api_name": "sys.stdin", "line_number": 12, "usage_type": "attribute" }, { "api_name": "sys.stdin.readline", "line_number": 16, "usage_type": "call" }, { "api_name": "sys.stdin", ...
21159376882
#!/usr/bin/env python # coding: utf-8 # In[193]: get_ipython().run_line_magic('matplotlib', 'inline') import pandas as pd import matplotlib.pyplot as plt import numpy as np from sklearn.linear_model import LogisticRegression from matplotlib.colors import ListedColormap import pickle ''' このプログラムはCSVファイルから読み込んだデータから機械...
nagnag0707/hr_ai_solution_test
test_sklearn.py
test_sklearn.py
py
2,092
python
ja
code
0
github-code
36
[ { "api_name": "sklearn.linear_model.LogisticRegression", "line_number": 34, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 36, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 37, "usage_type": "call" }, { "api_name"...
16128455391
import secure from fastapi import FastAPI from webhooktesting.routes import diagnostics, core app = FastAPI() server = secure.Server().set("Secure") hsts = secure.StrictTransportSecurity().include_subdomains().preload().max_age(2592000) cache_value = secure.CacheControl().must_revalidate() secure_headers = secure.S...
Brightmd/WebhookTesting
src/webhooktesting/main.py
main.py
py
627
python
en
code
2
github-code
36
[ { "api_name": "fastapi.FastAPI", "line_number": 6, "usage_type": "call" }, { "api_name": "secure.Server", "line_number": 8, "usage_type": "call" }, { "api_name": "secure.StrictTransportSecurity", "line_number": 9, "usage_type": "call" }, { "api_name": "secure.Cach...
33204018569
import numpy as np from numpy.linalg import qr from scipy.special import erfc from scipy.linalg import hadamard from ..config import * def getMatrix(dim, k, res, rowSpace = 'random', spectrum = 'smooth gap', returnSVD = False, coherenceScalar = .1, steepness = 1): #Check for valid inputs a...
alexbuzali2233/RandomLowRank-Alex
src/helpers/getMatrix.py
getMatrix.py
py
2,666
python
en
code
0
github-code
36
[ { "api_name": "numpy.linalg.qr", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.random.normal", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 19, "usage_type": "attribute" }, { "api_name": "numpy.linalg.qr...
43303341114
import py import random from collections import OrderedDict from hypothesis import settings, given, strategies from hypothesis.stateful import run_state_machine_as_test from rpython.rtyper.lltypesystem import lltype, rffi from rpython.rtyper.lltypesystem import rordereddict, rstr from rpython.rlib.rarithmetic import ...
mozillazg/pypy
rpython/rtyper/test/test_rordereddict.py
test_rordereddict.py
py
22,081
python
en
code
430
github-code
36
[ { "api_name": "rpython.rtyper.lltypesystem.rordereddict", "line_number": 16, "usage_type": "name" }, { "api_name": "rpython.rtyper.lltypesystem.rffi.cast", "line_number": 24, "usage_type": "call" }, { "api_name": "rpython.rtyper.lltypesystem.rffi", "line_number": 24, "usa...
29351919666
from urllib.request import urlopen import datetime import ast, csv import pandas as pd # 获取今日日期(年月日) today = datetime.date.today() year = str(today.year) month = str(today.month) monthsub = str(today.month-1) # 用于大连商品交易所特殊的月份(比当前月份少一个月) # 将少于10的日期前加上0 if today.month < 10: month0 = '0'+month else: month0 = mont...
Katrina0406/My-Projects
autoDownload/lastestPrice/autodownload.py
autodownload.py
py
7,490
python
en
code
1
github-code
36
[ { "api_name": "datetime.date.today", "line_number": 7, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 7, "usage_type": "attribute" }, { "api_name": "ast.literal_eval", "line_number": 36, "usage_type": "call" }, { "api_name": "csv.DictWriter"...
8648522966
import os, shutil from pathlib import Path from tqdm import tqdm import pickle import torch import numpy as np from IDSL_MINT.utils.MINT_aggregate import MINT_peak_aggregate from IDSL_MINT.utils.msp_file_utils import MINT_address_check def FP2MS_DataLoader(pkl_deconvoluted_msp_directory, max_number_ions_per_batch): ...
idslme/IDSL_MINT
IDSL_MINT/FP2MS/FP2MS_DataLoader.py
FP2MS_DataLoader.py
py
2,433
python
en
code
1
github-code
36
[ { "api_name": "IDSL_MINT.utils.msp_file_utils.MINT_address_check", "line_number": 13, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 17, "usage_type": "call" }, { "api_name": "shutil.rmtree", "line_number": 18, "usage_type": "call" }, { "api_...
19696374653
import json import logging import uuid import sys sys.path.append('..') import errors from errors import build_response from models.user_model import UserModel from models.task_model import TaskModel from models.task_list_model import TaskListModel from pynamodb.exceptions import UpdateError, ScanError, GetError # log...
shimoch-214/todo_api
users/tasks_taskLists.py
tasks_taskLists.py
py
2,381
python
en
code
0
github-code
36
[ { "api_name": "sys.path.append", "line_number": 5, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 5, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 14, "usage_type": "call" }, { "api_name": "logging.DEBUG", "li...
15949680682
import argparse import os import pandas as pd import pathlib parser = argparse.ArgumentParser( description="Aggregate simulation results", formatter_class=argparse.ArgumentDefaultsHelpFormatter) parser.add_argument("name", type=str, help="name of the run") args = vars(parser.parse_args()) ...
matthieubulte/MAR
scripts/aggregate_sim_results.py
aggregate_sim_results.py
py
1,071
python
en
code
0
github-code
36
[ { "api_name": "argparse.ArgumentParser", "line_number": 6, "usage_type": "call" }, { "api_name": "argparse.ArgumentDefaultsHelpFormatter", "line_number": 8, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 15, "usage_type": "call" }, { ...
14114807410
import sys from collections import deque def bfs(): queue = deque() visited = [[False for _ in range(M)] for _ in range(N)] visited[0][0] = True queue.append(((0, 0), 1)) # ((x, y), dist) while queue: cur_node = queue.popleft() curX, curY = cur_node[0] cur_dist = cur_no...
nashs789/JGAlgo
Week02/Q2178/Q2178_Inbok.py
Q2178_Inbok.py
py
1,041
python
en
code
2
github-code
36
[ { "api_name": "collections.deque", "line_number": 5, "usage_type": "call" }, { "api_name": "sys.stdin.readline", "line_number": 33, "usage_type": "call" }, { "api_name": "sys.stdin", "line_number": 33, "usage_type": "attribute" }, { "api_name": "sys.stdin.readline...
4671586615
import datetime as dt from collections import defaultdict from itertools import chain import logging from difflib import get_close_matches, SequenceMatcher from sqlalchemy import and_ from footie_scores import settings from footie_scores import utils from footie_scores.utils.footie import score_from_events from foot...
fdav10/football-scores
footie_scores/interfaces/db_to_web.py
db_to_web.py
py
6,904
python
en
code
1
github-code
36
[ { "api_name": "logging.getLogger", "line_number": 18, "usage_type": "call" }, { "api_name": "footie_scores.settings.OVERRIDE_TIME", "line_number": 19, "usage_type": "attribute" }, { "api_name": "footie_scores.settings", "line_number": 19, "usage_type": "name" }, { ...
18134982980
from datetime import datetime as dt from datetime import timedelta import time import numpy as np import pandas as pd import pytz def gps_to_datetime(gps_time): def toYearFraction(date): def sinceEpoch(date): # returns seconds since epoch return time.mktime(date.timetuple()) s = sinceE...
jonbowr/pyMAP
pyMAP/tools/time.py
time.py
py
2,050
python
en
code
1
github-code
36
[ { "api_name": "time.mktime", "line_number": 12, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 16, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.array", "li...
73518708263
import os import json curr_dir = os.path.dirname(os.path.abspath(__file__)) def write_order_to_json(item, quantity, price, buyer, date): filename = os.path.join(curr_dir, 'orders.json') with open(filename, 'r', encoding="utf-8") as file: data = json.loads(file.read()) data['orders'].append({'ite...
Kederly84/async_chat_python
HomeWork2/Task2/Task_2.py
Task_2.py
py
679
python
en
code
0
github-code
36
[ { "api_name": "os.path.dirname", "line_number": 4, "usage_type": "call" }, { "api_name": "os.path", "line_number": 4, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 4, "usage_type": "call" }, { "api_name": "os.path.join", "line_nu...
19407950160
import pandas as pd import matplotlib.pyplot as plt import numpy as np import pyqt_fit.nonparam_regression as smooth from pyqt_fit import npr_methods import Path path = Path.GetHomePath() DataName = "SimulationResults/RData_Lobster.csv" SaveStarter = "SimulationResults/FOI_Pics/Lobster/Lobster_" a = pd.r...
matthewosborne71/NetworkSimulations
PicCode/MakePicCode/MakeLobsterPics.py
MakeLobsterPics.py
py
1,907
python
en
code
0
github-code
36
[ { "api_name": "Path.GetHomePath", "line_number": 8, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 13, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.subplots", "line_number": 29, "usage_type": "call" }, { "api_name": "matplotlib...
28972280127
import twitter, datetime #importing the libaries import urllib2 file = open("keys.txt") #reading in the twitter credentials and splitting them up creds = file.readline().strip().split(',') currentSession = open("/Users/tobystimpson/Library/Application Support/Google/Chrome/Default/Current Session") #finding the curre...
Spaceinvadini/Python
twitter/tweeting.py
tweeting.py
py
963
python
en
code
0
github-code
36
[ { "api_name": "twitter.Api", "line_number": 18, "usage_type": "call" }, { "api_name": "datetime.datetime.utcnow", "line_number": 20, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 20, "usage_type": "attribute" } ]
1128012119
import os from copy import deepcopy from secrets import token_urlsafe import numpy as np import torch from torch import nn from tqdm.auto import tqdm from torch.utils.data import Dataset, DataLoader class nnModule_with_fit(nn.Module): def fit(self, train, val, iterations=10_000, batch_size=256, loss_kwargs={},...
GerbenBeintema/metaSI
metaSI/utils/fitting.py
fitting.py
py
11,726
python
en
code
2
github-code
36
[ { "api_name": "torch.nn.Module", "line_number": 14, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 14, "usage_type": "name" }, { "api_name": "torch.utils.data.Dataset", "line_number": 28, "usage_type": "argument" }, { "api_name": "torch.util...
42893075767
# _*_ coding: utf-8 _*_ """ Created by Allen7D on 2020/4/10. """ __author__ = 'Allen7D' import hashlib import os from flask import current_app from werkzeug.datastructures import FileStorage from app.libs.error_code import FileTooLargeException, \ FileTooManyException, FileExtensionException, ParameterExceptio...
Allen7D/mini-shop-server
app/core/file.py
file.py
py
5,999
python
en
code
663
github-code
36
[ { "api_name": "werkzeug.datastructures.FileStorage", "line_number": 19, "usage_type": "name" }, { "api_name": "uuid.uuid1", "line_number": 37, "usage_type": "call" }, { "api_name": "hashlib.md5", "line_number": 50, "usage_type": "call" }, { "api_name": "werkzeug.d...
70653037864
from djoser.serializers import UserSerializer from rest_framework import serializers from django.contrib.auth.models import User from .models import Cart, Category, MenuItem, Order, OrderItem class CategorySerializer(serializers.ModelSerializer): class Meta: model = Category fields = ['id', 'tit...
lzytourist/LittleLemon
LittleLemonAPI/serializers.py
serializers.py
py
2,915
python
en
code
0
github-code
36
[ { "api_name": "rest_framework.serializers.ModelSerializer", "line_number": 8, "usage_type": "attribute" }, { "api_name": "rest_framework.serializers", "line_number": 8, "usage_type": "name" }, { "api_name": "models.Category", "line_number": 11, "usage_type": "name" }, ...
35941125845
# -*- coding: utf-8 -*- """ Created on Thu Jul 30 16:21:28 2018 @author: bob.lee """ import docx import re import xlrd import os from xlwt import Workbook DATA_HOME = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir, os.pardir, 'temp/')) if not os.path.isdir(DATA_HOME): os.mkdir(DAT...
lidunwei12/biao
src/step_two/content_create.py
content_create.py
py
5,519
python
en
code
0
github-code
36
[ { "api_name": "os.path.abspath", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path", "line_number": 13, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path.dirname", "line...
15596002112
#!/usr/bin/python """Estimate conditional probability distributions from walk data. The point of this program is to compute random walk probabilities over a graph. This is a simplified problem based on `walk_analyzer.py`. This program finds the conditional probabilities of reaching a node given a particular start n...
byu-aml-lab/mrs-mapreduce
examples/contrib/walk_analyzer/conditional_prob.py
conditional_prob.py
py
6,367
python
en
code
3
github-code
36
[ { "api_name": "logging.getLogger", "line_number": 40, "usage_type": "call" }, { "api_name": "struct.Struct", "line_number": 42, "usage_type": "call" }, { "api_name": "mrs.MapReduce", "line_number": 46, "usage_type": "attribute" }, { "api_name": "os.stat", "lin...
30240198017
import nltk import pandas import os import json import multiprocessing targetPosts = 'processed_data/posts.csv' posts_output = 'processed_data/posts_tokenized.json' targetNodes = 'processed_data/nodes.csv' nodes_output = 'processed_data/nodes_tokenized.json' def processLine(l): return json.dumps(nltk.word_tokeni...
reidmcy/csc-2611-final-project
scripts/tokenize_posts.py
tokenize_posts.py
py
1,642
python
en
code
0
github-code
36
[ { "api_name": "json.dumps", "line_number": 13, "usage_type": "call" }, { "api_name": "nltk.word_tokenize", "line_number": 13, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 13, "usage_type": "call" }, { "api_name": "multiprocessing.Pool", "...
69930858666
import tweepy consumer_key = "entering the key here" consumer_secret = "entering the key here" access_token = "entering the key here" access_token_secret = "entering the key here" from tweepy.auth import OAuthHandler #Creating the Auth Object auth = OAuthHandler(consumer_key, consumer_secret) #Setting the access toke...
JaySRT/Twitter-Sentiment-Analysis
Keyword_based_search.py
Keyword_based_search.py
py
862
python
en
code
1
github-code
36
[ { "api_name": "tweepy.auth.OAuthHandler", "line_number": 10, "usage_type": "call" }, { "api_name": "tweepy.API", "line_number": 14, "usage_type": "call" } ]
11297199192
import math import cv2 import numpy as np import subprocess import imghdr import traceback import os # finds angle between robot's heading and the perpendicular to the targets class VisionTargetDetector: # initilaze variables def __init__(self, input): self.input_path = input try: # if input is a camera po...
rithue/DepthCamera
cv.py
cv.py
py
5,497
python
en
code
0
github-code
36
[ { "api_name": "cv2.VideoCapture", "line_number": 19, "usage_type": "call" }, { "api_name": "cv2.VideoCapture", "line_number": 23, "usage_type": "call" }, { "api_name": "math.cos", "line_number": 28, "usage_type": "call" }, { "api_name": "math.radians", "line_n...
17832877059
from flask import Blueprint, jsonify, request from jwt_functions import write_token, validate_token, decode import bcrypt from os import getenv from dotenv import load_dotenv routes_users = Blueprint('routes_users', __name__) @routes_users.route('/signup', methods=['POST']) def signup(): from api import db e...
CesarMtzV/Hajime-Web
server/api/routes/users.py
users.py
py
4,036
python
en
code
2
github-code
36
[ { "api_name": "flask.Blueprint", "line_number": 7, "usage_type": "call" }, { "api_name": "api.db.users.find_one", "line_number": 13, "usage_type": "call" }, { "api_name": "api.db.users", "line_number": 13, "usage_type": "attribute" }, { "api_name": "api.db", "...
43328312480
from django.urls import path, re_path from .views import MainPageView, ArticlePageView, CreateArticle, redirect_m urlpatterns = [ path('news/', MainPageView.as_view()), path('', redirect_m), re_path('news/create/', CreateArticle.as_view()), re_path('news/(?P<number_of_link>[^/]*)/?', ArticlePageView.as...
maksimkamekspeks/Jet-Brains
HyperNews Portal/task/news/urls.py
urls.py
py
384
python
en
code
0
github-code
36
[ { "api_name": "django.urls.path", "line_number": 5, "usage_type": "call" }, { "api_name": "views.MainPageView.as_view", "line_number": 5, "usage_type": "call" }, { "api_name": "views.MainPageView", "line_number": 5, "usage_type": "name" }, { "api_name": "django.ur...
17453371949
import os import json from subslide import Cutter json_path = '/media/ldy/e5a10f4e-18fd-4656-80d8-055bc4078655/OSCC_gl/trainval_test_slide.json' file_dir = '/media/ldy/7E1CA94545711AE6/OSCC/coarse-key/orig_data/' mask_dir = '/media/ldy/7E1CA94545711AE6/OSCC/coarse-key/seg/filtered_mask/' anno_dir = '/media/ldy/7E1CA9...
yida2311/OSCC_SF
subslide/test.py
test.py
py
1,777
python
en
code
0
github-code
36
[ { "api_name": "json.load", "line_number": 18, "usage_type": "call" }, { "api_name": "subslide.Cutter", "line_number": 29, "usage_type": "call" } ]
21009255890
from collections import OrderedDict import hydra import numpy as np import torch import torch.nn as nn import torch.nn.functional as F import utils class Encoder(nn.Module): def __init__(self, obs_shape): super().__init__() assert len(obs_shape) == 3 self.repr_dim = 32 * 35 * 35 ...
Rooshy-yang/Four_Room_For_Exploartion
agent/sarsa.py
sarsa.py
py
4,277
python
en
code
0
github-code
36
[ { "api_name": "torch.nn.Module", "line_number": 10, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 10, "usage_type": "name" }, { "api_name": "torch.nn.Sequential", "line_number": 17, "usage_type": "call" }, { "api_name": "torch.nn", "lin...
27187115333
import array as arr import pandas as pd import numpy as np import random from run_dclamp_simulation import run_ind_dclamp from cell_recording import ExperimentalAPSet from multiprocessing import Pool from scipy.stats import lognorm from algorithms import eaMuCommaLambda from deap import base from deap import creator ...
dtilley/EA_fit_to_AP_set
scratch.py
scratch.py
py
5,078
python
en
code
0
github-code
36
[ { "api_name": "pandas.read_csv", "line_number": 20, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 22, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 24, "usage_type": "call" }, { "api_name": "pandas.read_csv", ...
72748742823
import pygame from src import constants class Button: def __init__(self, text, size, position, action): self.action = action self.rect = pygame.Rect((0, 0), size) self.rect.center = position self.idle_image = pygame.Surface(size, pygame.SRCALPHA) self.hover_image = self.id...
Farbfetzen/dimetric
src/button.py
button.py
py
2,487
python
en
code
0
github-code
36
[ { "api_name": "pygame.Rect", "line_number": 9, "usage_type": "call" }, { "api_name": "pygame.Surface", "line_number": 11, "usage_type": "call" }, { "api_name": "pygame.SRCALPHA", "line_number": 11, "usage_type": "attribute" }, { "api_name": "pygame.draw.rect", ...
7477122277
import urllib.request import time from lxml import etree from selenium import webdriver from utils.Utils import url_request import chardet # 资源解析类 # 百度搜索解析 # return: dic_source{} def baidu_search(word='', pagesNum=3, sleep=2): baidu_dic_source = {} # 百度元素资源 driver = webdriver.Chrome() # driver = webd...
AnubisASN/IVA_C
utils/Parsing.py
Parsing.py
py
4,485
python
en
code
0
github-code
36
[ { "api_name": "selenium.webdriver.Chrome", "line_number": 18, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 18, "usage_type": "name" }, { "api_name": "time.sleep", "line_number": 31, "usage_type": "call" }, { "api_name": "lxml.etree.HT...
17883239165
""" 该模块用于承载数据管理的功能,即工作空间。 ``DataManager`` 类,其实例就是工作空间,提供了包括添加变量、删除变量、历史记录回溯、历史记录访问量等内容。 该模块在设计时考虑了历史记录功能,不过该功能是否有必要,还有待商榷。 该模块的操作对象为 ``DataAdapter``。 将数据外面包上一层可以确保其元数据的识别等便利性。 关于 ``DataAdapter`` 的详细内容请参见相关文档。 """ from collections import OrderedDict from typing import Dict, Tuple, List, Any from lib.workspace.data_...
pyminer/pyminer
pyminer/lib/workspace/data_manager.py
data_manager.py
py
8,124
python
zh
code
77
github-code
36
[ { "api_name": "typing.Dict", "line_number": 45, "usage_type": "name" }, { "api_name": "typing.Tuple", "line_number": 45, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 45, "usage_type": "name" }, { "api_name": "lib.workspace.data_adapter.BaseA...
15441184700
import numpy as np import torch def squash(x, squashing_constant=1., dim=-1, eps=1e-7, safe=True, p=2, **kwargs): if safe: squared_norm = torch.sum(torch.square(x), axis=dim, keepdim=True) safe_norm = torch.sqrt(squared_norm + eps) ...
clementpoiret/bagginghsf
bagginghsf/models/helpers.py
helpers.py
py
3,122
python
en
code
1
github-code
36
[ { "api_name": "torch.sum", "line_number": 13, "usage_type": "call" }, { "api_name": "torch.square", "line_number": 13, "usage_type": "call" }, { "api_name": "torch.sqrt", "line_number": 14, "usage_type": "call" }, { "api_name": "torch.sum", "line_number": 29, ...
41165140913
# -*- coding: utf-8 -*- ''' This file is part of Habitam. Habitam is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Habitam is distr...
habitam/habitam-core
habitam/downloads/display_list.py
display_list.py
py
9,863
python
en
code
1
github-code
36
[ { "api_name": "logging.getLogger", "line_number": 40, "usage_type": "call" }, { "api_name": "reportlab.lib.pagesizes.A4", "line_number": 42, "usage_type": "name" }, { "api_name": "reportlab.lib.pagesizes.A4", "line_number": 43, "usage_type": "name" }, { "api_name"...
72177085225
#coding = utf-8 import requests def GET_Token_And_C_Header(URL): #获取token并返回header id = input("请输入学号:") password = input("请输入密码:") url = URL data={ "student_id": id, "password": password } res = requests.post(url,data).json() token = res["data"]["token"] ...
czl411/Pair-Programming
联机游戏/online.py
online.py
py
2,666
python
en
code
0
github-code
36
[ { "api_name": "requests.post", "line_number": 11, "usage_type": "call" }, { "api_name": "requests.post", "line_number": 21, "usage_type": "call" }, { "api_name": "requests.post", "line_number": 28, "usage_type": "call" }, { "api_name": "requests.put", "line_nu...
40502817176
# -*- coding: utf-8 -*- from django.shortcuts import render from .models import Athlete from random import shuffle, randrange from django.http import HttpResponse # Create your views here. def index(request): return render(request, 'draw/index.html') def submit(request): name = request.POST.get('name') ...
TJCA/ballot
draw/views.py
views.py
py
1,763
python
en
code
1
github-code
36
[ { "api_name": "django.shortcuts.render", "line_number": 11, "usage_type": "call" }, { "api_name": "models.Athlete.objects.filter", "line_number": 17, "usage_type": "call" }, { "api_name": "models.Athlete.objects", "line_number": 17, "usage_type": "attribute" }, { ...
21432524861
import boto3 def main(): # remember to `$ export AWS_PROFILE=a-profile` & `$ export AWS_REGION=a-region` # to pick up credentials for this exercise, or set env vars appropriately for AK/SK access ec2_conn = boto3.client('ec2') if __name__ == "__main__": main()
SteveL1/InterviewTest
scripting_py_bash/test.py
test.py
py
283
python
en
code
0
github-code
36
[ { "api_name": "boto3.client", "line_number": 7, "usage_type": "call" } ]
13782307429
from fastapi import APIRouter from conn import conn from model.event import Event event_router = APIRouter( prefix="/event", tags=["event"], ) @event_router.get("/") async def read_items(attr: list, where: dict): cursor = conn.cursor() sql = Event.querySql(attr=attr, where=where) cursor.execute(sq...
JulioHey/Banco-de-Dados---EP
server/router/event.py
event.py
py
1,028
python
en
code
0
github-code
36
[ { "api_name": "fastapi.APIRouter", "line_number": 5, "usage_type": "call" }, { "api_name": "conn.conn.cursor", "line_number": 12, "usage_type": "call" }, { "api_name": "conn.conn", "line_number": 12, "usage_type": "name" }, { "api_name": "model.event.Event.querySq...
14480873433
from django.conf import settings from django.core.mail import send_mail from mailing_list.models import Contact def send_email(contact_info: dict): return send_mail( subject=f'Hi, {contact_info.get("username")}. You were subscribe on mailing list', message='Now every day, we are going to send you...
kinfi4/django-examples
src/django-celery/project/mailing_list/service.py
service.py
py
466
python
en
code
0
github-code
36
[ { "api_name": "django.core.mail.send_mail", "line_number": 8, "usage_type": "call" }, { "api_name": "django.conf.settings.EMAIL_HOST_USER", "line_number": 11, "usage_type": "attribute" }, { "api_name": "django.conf.settings", "line_number": 11, "usage_type": "name" } ]
44333686531
from flask import Blueprint from flask import jsonify from flask import request from ..services import BrandService from ..models import BrandModel brand = Blueprint('brand', __name__, url_prefix="/brand") @brand.route('/<int:id>', methods=["GET"]) def get_by_id(id: int): try: if request....
EliezerRamirezRuiz/RestAPI-ecommerce
app/blueprints/brand.py
brand.py
py
1,942
python
en
code
1
github-code
36
[ { "api_name": "flask.Blueprint", "line_number": 9, "usage_type": "call" }, { "api_name": "flask.request.method", "line_number": 15, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 15, "usage_type": "name" }, { "api_name": "services.Brand...
20972435328
import matplotlib.pyplot as plt import numpy ### load the data for the map intervals in nanoseconds data1 = numpy.loadtxt("3clients.txt") data2 = numpy.loadtxt("13clients.txt") data3 = numpy.loadtxt("103clients.txt") data4 = numpy.loadtxt("1003clients.txt") ### get the data in milliseconds milli_data1 = [item / 10000...
abarg12/MinotaurGame
client/test_client/data_client/plot_map_scatter.py
plot_map_scatter.py
py
1,056
python
en
code
0
github-code
36
[ { "api_name": "numpy.loadtxt", "line_number": 5, "usage_type": "call" }, { "api_name": "numpy.loadtxt", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.loadtxt", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.loadtxt", "line_numb...
14042648229
import pytest data1 = ['linda', 'sevenruby'] @pytest.fixture(params=data1) def data2(request): print("数据准备unpack") # 解包 # return request.param a = request.param print(a) return a # @pytest.mark.parametrize('data2',data1) def test_data(data2): print(data2) if __name__ == '__main__': p...
duheng18/python-study
testframework/frameworkDemo/pytestDemoR/review/test_param_fixture3.py
test_param_fixture3.py
py
465
python
en
code
0
github-code
36
[ { "api_name": "pytest.fixture", "line_number": 6, "usage_type": "call" }, { "api_name": "pytest.main", "line_number": 21, "usage_type": "call" } ]
24196970445
# -*- coding: utf-8 -*- import clr clr.AddReference("RevitAPI") clr.AddReference("System") from System.Collections.Generic import List from Autodesk.Revit.DB import FilteredElementCollector as Fec from Autodesk.Revit.DB import BuiltInCategory as Bic from Autodesk.Revit.DB import Transaction, FillPattern, FillPatternEle...
karthi1015/Quality-Management
StructuralIntegrity_step1_script.py
StructuralIntegrity_step1_script.py
py
4,145
python
en
code
2
github-code
36
[ { "api_name": "clr.AddReference", "line_number": 3, "usage_type": "call" }, { "api_name": "clr.AddReference", "line_number": 4, "usage_type": "call" }, { "api_name": "Autodesk.Revit.DB.FillPatternElement", "line_number": 51, "usage_type": "argument" }, { "api_name...
70437856743
import wikipedia import numpy as np import re import nltk from nltk.stem import WordNetLemmatizer import matplotlib.pyplot as plt import random as rd import collections import nltk.data import nltk from nltk.tokenize import word_tokenize, sent_tokenize import random import pandas as pd import gensim from gensim import ...
keeganstlegerdenny/STTM-How-Short-Is-Short
CorporaCreation.py
CorporaCreation.py
py
3,405
python
en
code
0
github-code
36
[ { "api_name": "nltk.download", "line_number": 19, "usage_type": "call" }, { "api_name": "nltk.corpus.stopwords", "line_number": 23, "usage_type": "name" }, { "api_name": "nltk.corpus.stopwords.words", "line_number": 23, "usage_type": "call" }, { "api_name": "strin...
18192807224
import re import math import functools import copy inFile = open('inputs/11.txt', 'r') input = inFile.read() input = map(lambda s: s.split("\n"), input.split("\n\n")) class Monkey(): def __init__(self, num, items, operation, test, ifTrue, ifFalse): self.num = num self.items = items self.operation = operation ...
keune/aoc-2022
11.py
11.py
py
2,319
python
en
code
0
github-code
36
[ { "api_name": "re.search", "line_number": 22, "usage_type": "call" }, { "api_name": "re.findall", "line_number": 25, "usage_type": "call" }, { "api_name": "re.search", "line_number": 31, "usage_type": "call" }, { "api_name": "re.search", "line_number": 34, ...
37532715553
from flask_restful import Resource from flask import jsonify, abort, request from backend.app import db, logger, app from sqlalchemy import exc from backend.models import Patient, Visit, Lab, Imaging, Appointment from webargs import fields from marshmallow import validate from webargs.flaskparser import parser from fla...
LedoKun/hiv-clinic-backend
resources/child_resource.py
child_resource.py
py
11,450
python
en
code
0
github-code
36
[ { "api_name": "flask_restful.Resource", "line_number": 12, "usage_type": "name" }, { "api_name": "backend.models.Patient.__children__", "line_number": 17, "usage_type": "attribute" }, { "api_name": "backend.models.Patient", "line_number": 17, "usage_type": "name" }, {...
15231900014
import sys import io import urllib.request print('hi') print('한글') sys.stdout = io.TextIOWrapper(sys.stdout.detach(), encoding = 'utf-8') sys.stderr = io.TextIOWrapper(sys.stderr.detach(), encoding = 'utf-8') imgUrl = "http://blogfiles.naver.net/20130502_54/dbsgusrl77_136748336507323OOv_JPEG/%BF%B5%C8%AD_%C0%BA%B9%D...
leyuri/Crawling
Chapter2/download2-1.py
download2-1.py
py
1,112
python
en
code
0
github-code
36
[ { "api_name": "sys.stdout", "line_number": 8, "usage_type": "attribute" }, { "api_name": "io.TextIOWrapper", "line_number": 8, "usage_type": "call" }, { "api_name": "sys.stdout.detach", "line_number": 8, "usage_type": "call" }, { "api_name": "sys.stderr", "lin...
72466882663
""" WSGI config for mintemplate project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/ """ import os import sys import site prev_sys_path = list(sys.path) root = os.path.normpath(os.p...
kfarr2/Minimal-Template
mintemplate/wsgi.py
wsgi.py
py
1,128
python
en
code
0
github-code
36
[ { "api_name": "sys.path", "line_number": 14, "usage_type": "attribute" }, { "api_name": "os.path.normpath", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path", "line_number": 15, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_...
36050060179
from typing import List, Dict from aiohttp import ClientSession from common.decorators import catch_timeout from web.integrations.email_client.abstract import AbstractEmailClient from web.integrations.http import BaseHTTPClient class ClientError(Exception): pass class EmailHTTPClient(AbstractEmailClient, Base...
MFrackowiak/sc_r_mailmarketing
web/integrations/email_client/http.py
http.py
py
1,526
python
en
code
0
github-code
36
[ { "api_name": "web.integrations.email_client.abstract.AbstractEmailClient", "line_number": 14, "usage_type": "name" }, { "api_name": "web.integrations.http.BaseHTTPClient", "line_number": 14, "usage_type": "name" }, { "api_name": "aiohttp.ClientSession", "line_number": 18, ...
2291746376
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Author: HuHao <huhao1@cmcm.com> Date: '2018/8/25' Info: """ # 获取系统环境 import os # 创建app实例和数据库实例 from app import create_app,db # 获取数据据类模板 from app.models import User,Role,Post,Permission # 使用 Manage 丰富启动参数支持,和 Shell 环境支持 from flask_script import Manager,Shell # ...
happy-place/flasky
manage.py
manage.py
py
3,574
python
zh
code
0
github-code
36
[ { "api_name": "os.environ.get", "line_number": 24, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 24, "usage_type": "attribute" }, { "api_name": "coverage.coverage", "line_number": 26, "usage_type": "call" }, { "api_name": "app.create_app", ...
2531159065
from __future__ import print_function,division import numpy as np import six.moves.cPickle as pickle import theano import theano.tensor as T from optimize import rmsprop from lmlp import LMLP class Simple_Discriminator(object): def __init__(self,rng,input_fake,input_real,info_layers): self.input=input_fake...
davikrehalt/WGAN-mod
simple_discriminator.py
simple_discriminator.py
py
6,543
python
en
code
0
github-code
36
[ { "api_name": "lmlp.LMLP", "line_number": 13, "usage_type": "call" }, { "api_name": "lmlp.LMLP", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.asarray", "line_number": 26, "usage_type": "call" }, { "api_name": "numpy.random.random", "line_num...
28875886668
from __future__ import absolute_import, unicode_literals from draftjs_exporter.dom import DOM from draftjs_exporter.error import ExporterException from draftjs_exporter.options import Options class EntityException(ExporterException): pass class EntityState: def __init__(self, entity_decorators, entity_map)...
mohit-n-rajput/BT-Real-Estate
venv/lib/python3.6/site-packages/draftjs_exporter/entity_state.py
entity_state.py
py
2,098
python
en
code
1
github-code
36
[ { "api_name": "draftjs_exporter.error.ExporterException", "line_number": 8, "usage_type": "name" }, { "api_name": "draftjs_exporter.options.Options.for_entity", "line_number": 47, "usage_type": "call" }, { "api_name": "draftjs_exporter.options.Options", "line_number": 47, ...
16413307502
import googlemaps import json import random from django.conf import settings from datetime import date as todaysDate from django.utils.timezone import make_aware from django.db import models from usuarios.models import MyUser, Cliente, Transportista, Unidades from django.urls import reverse from django.utils import tim...
Zarate96/userTestFS
fletes/models.py
models.py
py
28,527
python
es
code
0
github-code
36
[ { "api_name": "django.core.exceptions.ValidationError", "line_number": 54, "usage_type": "call" }, { "api_name": "django.db.models.Model", "line_number": 56, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 56, "usage_type": "name" }, { ...
17233781871
import argparse rows = 128 ### sliced spectrogram height cols = 1024 ### sliced spectrogram width channels = 2 max_width = 10337 ### maximum raw spectrogram width split_count = 10 ### number of slices per song epochs = 100 batch_size = 32 spectrogram_features = ['h', 'p'] ### Percussive & harmonic componen...
taprosoft/music-genre-classification
src/config.py
config.py
py
1,525
python
en
code
24
github-code
36
[ { "api_name": "argparse.ArgumentParser", "line_number": 18, "usage_type": "call" } ]
34198323203
import pytest from loguru import logger from pytest_mock import MockerFixture from fastapi_cloud_logging.fastapi_cloud_logging_handler import FastAPILoggingHandler @pytest.fixture def logging_handler(mocker: MockerFixture) -> FastAPILoggingHandler: return FastAPILoggingHandler( mocker.Mock(), transport=m...
quoth/fastapi-cloud-logging
tests/test_loguru.py
test_loguru.py
py
1,376
python
en
code
5
github-code
36
[ { "api_name": "pytest_mock.MockerFixture", "line_number": 9, "usage_type": "name" }, { "api_name": "fastapi_cloud_logging.fastapi_cloud_logging_handler.FastAPILoggingHandler", "line_number": 10, "usage_type": "call" }, { "api_name": "pytest.fixture", "line_number": 8, "us...