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
18672969440
import pandas as pd import argparse import yaml import os import io import json def retrieve_params(config): with open(config) as yaml_file: params= yaml.safe_load(yaml_file) return params def generate_metadata_csv(params): excel_file_path = params["data"]["standard_excel_file"] df = pd.read...
sagar-harry/Youtube_Trending_data
generate_meta_data_file_2.py
generate_meta_data_file_2.py
py
1,708
python
en
code
0
github-code
36
[ { "api_name": "yaml.safe_load", "line_number": 10, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 17, "usage_type": "call" }, { "api_name": "io.StringIO", "line_number": 19, "usage_type": "call" }, { "api_name": "json.load", "line_numb...
15381149189
import requests from weather_message import WeatherStation LINE_URL = 'https://notify-api.line.me/api/notify' def send_message(token, msg): headers = {'Authorization': 'Bearer ' + token} payload = {'message': msg} response = requests.post(LINE_URL, headers=headers, params=payload) return re...
shamiOuO/weather_report
Line_notify.py
Line_notify.py
py
544
python
en
code
0
github-code
36
[ { "api_name": "requests.post", "line_number": 10, "usage_type": "call" } ]
21123419493
from sqlalchemy.ext.declarative import declarative_base from sqlalchemy import Column, Integer, Text, TIMESTAMP from sqlalchemy import func Base = declarative_base() class TestData(Base): __tablename__ = 'test' id = Column(Integer, primary_key = True) data = Column(Text) created_at = Column(TIMESTAMP...
tosiaki/windyfall_bot
testdata.py
testdata.py
py
423
python
en
code
0
github-code
36
[ { "api_name": "sqlalchemy.ext.declarative.declarative_base", "line_number": 5, "usage_type": "call" }, { "api_name": "sqlalchemy.Column", "line_number": 10, "usage_type": "call" }, { "api_name": "sqlalchemy.Integer", "line_number": 10, "usage_type": "argument" }, { ...
72177063783
import json import traceback from flask import Blueprint, jsonify from bson.json_util import dumps from models.users import User get_users_blueprint = Blueprint("get_users_blueprint", __name__) @get_users_blueprint.route("/get-users") def get_users(): try: users = User.find(User.record_status=="ALIVE").a...
emacliam/REDIS-HACKERTHON---CRM
CRM BACKEND/controllers/users/get_users.py
get_users.py
py
947
python
en
code
0
github-code
36
[ { "api_name": "flask.Blueprint", "line_number": 8, "usage_type": "call" }, { "api_name": "models.users.User.find", "line_number": 13, "usage_type": "call" }, { "api_name": "models.users.User", "line_number": 13, "usage_type": "name" }, { "api_name": "models.users....
25175834547
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sun Apr 2 17:19:48 2023 @author: acomeau """ import matplotlib.pyplot as plt import time import numpy as np import math x=np.zeros((1,100)) x1=np.zeros((1,100)) x2=np.zeros((1,100)) for timeSetepNdx in range(1,100): x[0,timeSetepNdx]=timeS...
adriencomeau/Telescopium
untitled1.py
untitled1.py
py
749
python
en
code
0
github-code
36
[ { "api_name": "numpy.zeros", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 16, "usage_type": "call" }, { "api_name": "math.cos", "line_number": 22,...
27435754821
import os import pathlib import numpy as np import matplotlib.pyplot as plt from matplotlib.image import imsave, imread def add_noise(noise_type, image): if noise_type == "gauss": shp = image.shape mean = 0 var = 0.01 sigma = var ** 0.5 gauss = np.random.normal(mean, sigma...
206081/psio
Lab2/zad1.py
zad1.py
py
2,703
python
en
code
0
github-code
36
[ { "api_name": "numpy.random.normal", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 15, "usage_type": "attribute" }, { "api_name": "numpy.random.rand", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.random"...
12532422975
"""empty message Revision ID: 8f71e60633a3 Revises: 2e7679aa003d Create Date: 2023-01-24 23:57:44.856118 """ from alembic import op import sqlalchemy as sa from sqlalchemy.dialects import mysql # revision identifiers, used by Alembic. revision = '8f71e60633a3' down_revision = '2e7679aa003d' branch_labels = None depe...
lusferror/SugestionCties
src/migrations/versions/8f71e60633a3_.py
8f71e60633a3_.py
py
1,087
python
en
code
0
github-code
36
[ { "api_name": "alembic.op.batch_alter_table", "line_number": 21, "usage_type": "call" }, { "api_name": "alembic.op", "line_number": 21, "usage_type": "name" }, { "api_name": "sqlalchemy.Column", "line_number": 22, "usage_type": "call" }, { "api_name": "sqlalchemy....
69941827626
import pickle import os import numpy as np import torch from sklearn.datasets import make_blobs from torch.utils.data import Dataset from torch.utils.data.dataset import T_co def prepare_blob_dataset(city_num: int = 50, feature_dim: int = 2, sample_num: int = 100000...
ma-shangao/rl_waypoint_mrta
dataset_preparation.py
dataset_preparation.py
py
3,367
python
en
code
2
github-code
36
[ { "api_name": "numpy.zeros", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 17, "usage_type": "call" }, { "api_name": "sklearn.datasets.make_blobs", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.ndarray", ...
17393417065
import sqlite3 import constants #from constants import insert_base_user DB_NAME = "vehicle_management.db" db = sqlite3.connect(DB_NAME) db.row_factory = sqlite3.Row c = db.cursor() # # insert_base_user = """ # INSERT INTO BASE_USER (user_name, email, phone_number, address) # VALUES (:user_name, :email,...
bonevb/HackBulgaria-Programming101-Python-2018
week10/01-Vehicle-Repair-Manager/mechanic.py
mechanic.py
py
1,904
python
en
code
0
github-code
36
[ { "api_name": "sqlite3.connect", "line_number": 7, "usage_type": "call" }, { "api_name": "sqlite3.Row", "line_number": 8, "usage_type": "attribute" }, { "api_name": "constants.insert_base_user", "line_number": 34, "usage_type": "attribute" } ]
42985186741
import psycopg2 def create_table(connection): # il cursore è utillizato esequire comandi e accedere alla risposta cursor = connection.cursor() try: # prepara il comando create_table_query = '''CREATE TABLE students (ID SERIAL PRIMARY KEY , NAME TEX...
Torla/postgres_ex
main.py
main.py
py
5,031
python
en
code
0
github-code
36
[ { "api_name": "psycopg2.Error", "line_number": 39, "usage_type": "attribute" }, { "api_name": "psycopg2.Error", "line_number": 60, "usage_type": "attribute" }, { "api_name": "psycopg2.Error", "line_number": 79, "usage_type": "attribute" }, { "api_name": "psycopg2....
70506020904
#importing libraries import pandas as pd from selenium import webdriver # for webdriver from selenium.common.exceptions import NoSuchElementException # for exception handling import time # for delay # setting platform for selenium path = r'C:\Users\haqab\Desktop\DS\chromedriver.exe' driver = webdriver.Chrome(path) ...
Abdulhaq005/Web-Scraping-scrapy-and-selenium-
cars/spiders/selenium_script.py
selenium_script.py
py
3,645
python
en
code
0
github-code
36
[ { "api_name": "selenium.webdriver.Chrome", "line_number": 10, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 10, "usage_type": "name" }, { "api_name": "time.sleep", "line_number": 35, "usage_type": "call" }, { "api_name": "selenium.comm...
29261172588
import xml.etree.ElementTree as ET def xml_parse(file_byte): def get_recursive(parent): res = {} if not parent.getchildren(): res[parent.tag] = '' return res res[parent.tag] = [] for child in parent: if child.getchildren(): res[p...
oktavianustjoea/ap-app
xml_converter/utils.py
utils.py
py
529
python
en
code
0
github-code
36
[ { "api_name": "xml.etree.ElementTree.fromstring", "line_number": 19, "usage_type": "call" }, { "api_name": "xml.etree.ElementTree", "line_number": 19, "usage_type": "name" } ]
70307229865
import os import requests import json from requests_oauthlib import OAuth1 from dotenv import load_dotenv load_dotenv() CONSUMER_KEY = os.getenv("TWITTER_API_KEY") CONSUMER_SECRET = os.getenv("TWITTER_API_SECRET") ACCESS_TOKEN = os.getenv("TWITTER_ACCESS_TOKEN") ACCESS_TOKEN_SECRET = os.getenv("TWITTER_ACCESS_TOKEN_...
homeGrownCheese/tweet_waka_daily
tweet_stats.py
tweet_stats.py
py
2,688
python
en
code
1
github-code
36
[ { "api_name": "dotenv.load_dotenv", "line_number": 8, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 10, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 11, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": ...
72215373865
# Download the helper library from https://www.twilio.com/docs/python/install from twilio.rest import Client # Your Account Sid and Auth Token from twilio.com/console # DANGER! This is insecure. See http://twil.io/secure account_sid = 'AC3f72ddfebffe2adae5b4efe0c6d9c9b6' auth_token = 'd45d3fcfab5be3e08985b77a3fd13103'...
leemengwei/tasty_shrimp_skype
phone_with_twilio.py
phone_with_twilio.py
py
1,069
python
en
code
1
github-code
36
[ { "api_name": "twilio.rest.Client", "line_number": 8, "usage_type": "call" }, { "api_name": "twilio.rest.Client", "line_number": 19, "usage_type": "call" } ]
39687720281
import networkx as nx, matplotlib.pyplot as plt, numpy as np, copy import MarkovChain as SMC from Randomized import * from time import time Pps = 0.4 # float(input('Ingrese la probabilidad de que un dispositivo protegido pase a ser susceptible: ')) Psp = 0.3 # float(input('Ingrese la probabilidad de que un dispositi...
Zharet-Bautista-Montes/Markov_Inspector
venv/core/MultipleMC.py
MultipleMC.py
py
9,302
python
en
code
0
github-code
36
[ { "api_name": "numpy.array", "line_number": 28, "usage_type": "call" }, { "api_name": "copy.deepcopy", "line_number": 29, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 29, "usage_type": "call" }, { "api_name": "numpy.array", "line_number"...
17169329371
import os import telebot from dotenv import load_dotenv import client load_dotenv() bot_token = os.getenv('BOT_TOKEN') admin = os.getenv('TG_ADMIN_ID') bot = telebot.TeleBot(bot_token) states_list = ["ADDRESS", "AMOUNT", "CONFIRM"] states_of_users = {} @bot.message_handler(commands=['start']) def start_message(...
Lexxar91/bitcoin_api_bot
tg_bot/bot.py
bot.py
py
12,039
python
ru
code
0
github-code
36
[ { "api_name": "dotenv.load_dotenv", "line_number": 8, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 10, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 11, "usage_type": "call" }, { "api_name": "telebot.TeleBot", "line_num...
31850440252
import matplotlib.pyplot as plt import numpy as np # x axis u = np.arange(0.0,2.74,0.01,dtype=np.cdouble) v = np.arange(2.74,5.0,0.01,dtype=np.cdouble) x = np.arange(0.0,5.0,0.01,dtype=np.cdouble) y = np.arange(0.0,3.83,0.01, dtype=np.cdouble) z = np.arange(3.83,5.0,0.01, dtype=np.cdouble) # y axis def f(t, option =...
cesaregarza/QMResearch
plotter.py
plotter.py
py
1,812
python
en
code
0
github-code
36
[ { "api_name": "numpy.arange", "line_number": 5, "usage_type": "call" }, { "api_name": "numpy.cdouble", "line_number": 5, "usage_type": "attribute" }, { "api_name": "numpy.arange", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.cdouble", "line_n...
26626844923
import astropy.units as u from astropy.coordinates.sky_coordinate import SkyCoord from astropy.units import Quantity from astropy.io.votable import parse from astropy.table import Table from matplotlib.colors import LogNorm import matplotlib.pyplot as plt import numpy as np extra_data = np.genfromtxt("Data/Mean_extinc...
spacer730/Gaia_research
Queries-CM-Diagrams/CM-Diagram-corrected_mean_AG-EBminR .py
CM-Diagram-corrected_mean_AG-EBminR .py
py
2,142
python
en
code
0
github-code
36
[ { "api_name": "numpy.genfromtxt", "line_number": 10, "usage_type": "call" }, { "api_name": "astropy.table.Table.read", "line_number": 13, "usage_type": "call" }, { "api_name": "astropy.table.Table", "line_number": 13, "usage_type": "name" }, { "api_name": "numpy.a...
31987030282
# !/usr/bin/env python # -*- coding: utf-8 -*- import contextlib import os import zipfile import os.path import yaml import json applets_index = [] @contextlib.contextmanager def change_dir(path): old_path = os.getcwd() os.chdir(path) yield os.chdir(old_path) def read_applet_config(applet_path) -> ...
jumpserver/applets
build.py
build.py
py
2,560
python
en
code
9
github-code
36
[ { "api_name": "os.getcwd", "line_number": 15, "usage_type": "call" }, { "api_name": "os.chdir", "line_number": 16, "usage_type": "call" }, { "api_name": "os.chdir", "line_number": 18, "usage_type": "call" }, { "api_name": "contextlib.contextmanager", "line_num...
40861542036
import numpy as np from typing import List, Dict from math import ceil def _valleys(hist: Dict[int, int]) -> List[int]: """ Find the valleys of a histogram of gray levels Arguments: hist frequencies in the histogram of gray levels 0,1,...,L-1 (dictionary) Value: valleys returns ...
image-multithresholding/Image-multithresholding
src/image_multi_thresholding/thresholding_windows.py
thresholding_windows.py
py
2,140
python
en
code
1
github-code
36
[ { "api_name": "typing.Dict", "line_number": 6, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 6, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 41, "usage_type": "name" }, { "api_name": "numpy.zeros", "line_number": 57...
29028425647
import json import os import matplotlib.pyplot as plt import numpy as np import pandas as pd import torch from torchvision import transforms from src.constants import ( DICT_CLASS, EMB_ARRAY, EMBEDDINGS, METADATA, NUM_CLOSEST_PLOT, NUMBER_RANDOM_IMAGES, PREDICTION, SKETCHY, TUBERL...
VisiumCH/AMLD-2021-Sketchy
src/models/inference/inference.py
inference.py
py
9,160
python
en
code
0
github-code
36
[ { "api_name": "torchvision.transforms.Compose", "line_number": 47, "usage_type": "call" }, { "api_name": "torchvision.transforms", "line_number": 47, "usage_type": "name" }, { "api_name": "torchvision.transforms.ToTensor", "line_number": 47, "usage_type": "call" }, { ...
72547899303
from tools.build_utils import * import os, shutil import argparse def main(): # Command line parser options parser = argparse.ArgumentParser( formatter_class=argparse.RawTextHelpFormatter) parser.add_argument( '--tf_version', type=str, help="TensorFlow tag/branch/SHA\n", ...
openvinotoolkit/openvino_tensorflow
build_tf.py
build_tf.py
py
4,841
python
en
code
176
github-code
36
[ { "api_name": "argparse.ArgumentParser", "line_number": 8, "usage_type": "call" }, { "api_name": "argparse.RawTextHelpFormatter", "line_number": 9, "usage_type": "attribute" }, { "api_name": "os.path.isdir", "line_number": 48, "usage_type": "call" }, { "api_name":...
13019170409
import torch import math from torch import nn import torch.nn.functional as F # Objective: learn embedding vector for each "relative" position # Steps: (1) Identify matrix of possible relatives (sent_len, sent_len) "clamped values" # (2) Identify embedding vector with possible vocabs of relatives (vocab, emb) ...
hosnaa/bert-implement
src/relative_position.py
relative_position.py
py
10,928
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.Embedding", "line_number": 19, "usage_type": "call" }, { "api_name": "torch.nn", "line...
36478211178
from django import forms from ..models import Modelo class ModeloForm(forms.ModelForm): class Meta: model = Modelo fields = ["marca", "nombre"] def __init__(self, *args, **kwargs): super(ModeloForm, self).__init__(*args, **kwargs) for i, (fname, field) in enumerate(self.fields....
xcarlx/Venta
apps/producto/formstotal/modelo.py
modelo.py
py
390
python
en
code
0
github-code
36
[ { "api_name": "django.forms.ModelForm", "line_number": 4, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 4, "usage_type": "name" }, { "api_name": "models.Modelo", "line_number": 6, "usage_type": "name" } ]
35291375172
""" Created on Tue Apr 26 20:17:37 2022 @author: celiaberon """ import os import numpy as np import pandas as pd import scipy from nta.features.select_trials import match_trial_ids from nta.preprocessing.signal_processing import snr_photo_signal def QC_included_trials(ts: pd.DataFrame, tria...
celiaberon/neural-timeseries-analysis
nta/preprocessing/quality_control.py
quality_control.py
py
12,580
python
en
code
0
github-code
36
[ { "api_name": "pandas.DataFrame", "line_number": 17, "usage_type": "attribute" }, { "api_name": "pandas.DataFrame", "line_number": 18, "usage_type": "attribute" }, { "api_name": "nta.features.select_trials.match_trial_ids", "line_number": 63, "usage_type": "call" }, {...
33938514931
import pytest from schema import cities async def test_database(sqlite_database): tables_query = "SELECT * FROM sqlite_master where type='table';" tables = await sqlite_database.fetch_all(query=tables_query) assert len(tables) != 0 city_query = cities.insert( values={"name": 'London', ...
roman808080/route_planner
tests/test_db_manager.py
test_db_manager.py
py
497
python
en
code
0
github-code
36
[ { "api_name": "schema.cities.insert", "line_number": 12, "usage_type": "call" }, { "api_name": "schema.cities", "line_number": 12, "usage_type": "name" } ]
1141324769
import re import base64 import math from glob import glob from getpass import getpass from pprint import pprint from marshals.interface import api import tns.sedm_auto_tns as tns fritz_base_url = 'https://fritz.science/api/' fritz_classification_url = fritz_base_url + 'classification' fritz_redshift_update_url = frit...
scizen9/sedmpy
fritz/fritz_commenter.py
fritz_commenter.py
py
14,311
python
en
code
5
github-code
36
[ { "api_name": "base64.b64encode", "line_number": 36, "usage_type": "call" }, { "api_name": "marshals.interface.api", "line_number": 49, "usage_type": "call" }, { "api_name": "marshals.interface.api", "line_number": 88, "usage_type": "call" }, { "api_name": "tns.se...
32331024727
#!/usr/bin/python3 """Contains a class named Base""" import json class Base: """Class named Base""" __nb_objects = 0 def __init__(self, id=None): """initialize Base class""" if id is None: Base.__nb_objects += 1 self.id = Base.__nb_objects else: ...
ammartica/holbertonschool-higher_level_programming
0x0C-python-almost_a_circle/models/base.py
base.py
py
1,956
python
en
code
0
github-code
36
[ { "api_name": "json.dumps", "line_number": 24, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 31, "usage_type": "call" } ]
15618824234
#!/usr/bin/env python3 import argparse from datetime import datetime import json import os import sys import time import uuid from aiosmtpd.controller import Controller import mailparser DATA_PATH = 'messages' class Handler(object): # noinspection PyPep8Naming,PyMethodMayBeStatic async def handle_DATA(self...
OPSnet/PostOffice
smtpd.py
smtpd.py
py
1,929
python
en
code
1
github-code
36
[ { "api_name": "os.path.join", "line_number": 23, "usage_type": "call" }, { "api_name": "os.path", "line_number": 23, "usage_type": "attribute" }, { "api_name": "uuid.uuid4", "line_number": 23, "usage_type": "call" }, { "api_name": "mailparser.parse_from_string", ...
9588266467
import unittest from tests import PluginTest from plugins.basketball import basketball from mock import patch, call import requests import datetime from packages.memory.memory import Memory class BasketballTest(PluginTest): """ Tests For Basketball Plugin !!! test will be executed only if user has added h...
sukeesh/Jarvis
jarviscli/tests/test_basketball.py
test_basketball.py
py
2,571
python
en
code
2,765
github-code
36
[ { "api_name": "tests.PluginTest", "line_number": 10, "usage_type": "name" }, { "api_name": "plugins.basketball.basketball", "line_number": 17, "usage_type": "argument" }, { "api_name": "packages.memory.memory.Memory", "line_number": 18, "usage_type": "call" }, { "...
29138207241
from random import randint as rand import pygame import time row_max =16 column_max =16 mine_count = 50 square_list = [] square_size = 30 BLACK = (0,0,0) WHITE = (255,255,255) BLUE = (0,0,255) RED = (255,0,0) pygame.init() stage = "setup" check_list = [] screen = pygame.display.set_mode((square...
OOCam1/Minesweeper
Minesweeper.py
Minesweeper.py
py
19,511
python
en
code
0
github-code
36
[ { "api_name": "pygame.init", "line_number": 17, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 21, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 21, "usage_type": "attribute" }, { "api_name": "pygame.displa...
11249142498
import torch import copy import numpy as np from torch.nn import Dropout from torch.nn import Linear from torch.nn import LayerNorm from torch.nn import functional as F from RprMultiheadAttention import MultiheadAttention def _get_activation_fn(activation): if activation == "relu": return F.relu elif activation =...
perathambkk/lipreading
short1.27fast_nlls_xl_2mem_lattransconv_p_OSL_500_cosine/RprTransformerEncoderLayer.py
RprTransformerEncoderLayer.py
py
3,370
python
en
code
3
github-code
36
[ { "api_name": "torch.nn.functional.relu", "line_number": 13, "usage_type": "attribute" }, { "api_name": "torch.nn.functional", "line_number": 13, "usage_type": "name" }, { "api_name": "torch.nn.functional.gelu", "line_number": 15, "usage_type": "attribute" }, { "a...
6797122561
import logging import requests from django.urls import reverse from django.conf import settings from django.core.mail import get_connection from django.core.mail.backends.base import BaseEmailBackend from .engine import send_email from mail.models import Message logger = logging.getLogger('mails') def get_admins(...
tomasgarzon/exo-services
service-exo-mail/mail/backend.py
backend.py
py
2,657
python
en
code
0
github-code
36
[ { "api_name": "logging.getLogger", "line_number": 13, "usage_type": "call" }, { "api_name": "mail.models", "line_number": 17, "usage_type": "name" }, { "api_name": "django.conf.settings.ADMINS", "line_number": 17, "usage_type": "attribute" }, { "api_name": "django...
37412068955
############################################################################## # # File format versions: # # 1: initial version # # 2: now contains reciprocal planck opacity and rosseland opacity # previous rosseland opacity was actually reciprocal planck opacity # ###############################################...
hyperion-rt/hyperion
hyperion/dust/dust_type.py
dust_type.py
py
31,342
python
en
code
51
github-code
36
[ { "api_name": "util.functions.FreezableClass", "line_number": 43, "usage_type": "name" }, { "api_name": "optical_properties.OpticalProperties", "line_number": 65, "usage_type": "call" }, { "api_name": "mean_opacities.MeanOpacities", "line_number": 66, "usage_type": "call"...
21891037955
import json import logging import traceback from django.views import View from django.http import JsonResponse from backend.models import AnnotationCategory, Video # from django.core.exceptions import BadRequest class AnnoatationCategoryCreate(View): def post(self, request): try: if not requ...
TIBHannover/tibava-backend
backend/views/annotation_category.py
annotation_category.py
py
2,854
python
en
code
0
github-code
36
[ { "api_name": "django.views.View", "line_number": 12, "usage_type": "name" }, { "api_name": "django.http.JsonResponse", "line_number": 16, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 24, "usage_type": "call" }, { "api_name": "django.http.Jso...
5102702223
"""fask_dj URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.11/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') ...
ZompaSenior/fask
fask/src/fask_dj/task/urls.py
urls.py
py
1,085
python
en
code
0
github-code
36
[ { "api_name": "django.conf.urls.url", "line_number": 21, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 22, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 23, "usage_type": "call" }, { "api_name": "django...
6377162291
from django.db import models import uuid class apiKeys(models.Model): id = models.CharField(max_length=200, null=False, blank=False) key = models.TextField(primary_key=True, default=uuid.uuid4().hex) def __unicode__(self): return self.id class ButtonTable(models.Model): SKRANKE = 0 TELE...
OrakeltjenestenDragvoll/nix
apps/bujumbura/models.py
models.py
py
837
python
en
code
0
github-code
36
[ { "api_name": "django.db.models.Model", "line_number": 5, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 5, "usage_type": "name" }, { "api_name": "django.db.models.CharField", "line_number": 6, "usage_type": "call" }, { "api_name": "...
74146205863
from flair.data import Sentence from flair.models import SequenceTagger from flair.embeddings import (DocumentPoolEmbeddings, FlairEmbeddings, StackedEmbeddings) from torch import dot, norm, squeeze from pathlib import Path import pickle from odm.nlp.tensors import PCA, plot_embeddings...
ixxie/odm
src/odm/nlp/model.py
model.py
py
2,615
python
en
code
0
github-code
36
[ { "api_name": "pathlib.Path", "line_number": 24, "usage_type": "call" }, { "api_name": "flair.models.SequenceTagger.load_from_file", "line_number": 26, "usage_type": "call" }, { "api_name": "flair.models.SequenceTagger", "line_number": 26, "usage_type": "name" }, { ...
7919024721
from __future__ import division import geojson from helper import load_geom, degrees_to_radians, get_coord, PRECISION from math import pow, sqrt, pi, tan, cos, sin from measurement import rhumb_destination from transformation import transform_rotate def ellipse(center, x_semi_axis, y_semi_axis, options={}): steps...
CartoDB/analytics-toolbox-core
clouds/redshift/libraries/python/lib/constructors/ellipse/__init__.py
__init__.py
py
3,027
python
en
code
181
github-code
36
[ { "api_name": "helper.load_geom", "line_number": 37, "usage_type": "call" }, { "api_name": "helper.get_coord", "line_number": 38, "usage_type": "call" }, { "api_name": "helper.degrees_to_radians", "line_number": 41, "usage_type": "call" }, { "api_name": "measureme...
29317958483
from keras.utils.data_utils import get_file import os import numpy as np from os import listdir from os.path import isfile, join, isdir import cv2 from random import shuffle import math from keras.callbacks import TensorBoard, EarlyStopping, ModelCheckpoint, ReduceLROnPlateau, LearningRateScheduler from keras.models im...
LifengFan/Shared-Attention
src/gazemap.py
gazemap.py
py
23,892
python
en
code
4
github-code
36
[ { "api_name": "random.shuffle", "line_number": 199, "usage_type": "call" }, { "api_name": "random.shuffle", "line_number": 200, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 205, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_...
18735221514
import scrapy from module.items import HotlineItem class HotlineSpider(scrapy.Spider): name = "hotline" allowed_domains = ["hotline.ua"] start_urls = [f"https://hotline.ua/ua/bt/holodilniki/?p={page}" for page in range(1, 4)] def parse(self, response): catalog = response.xpath('//div[contains...
Ivan7281/Lab-Data-Scraping
Lab7/module/spiders/hotline.py
hotline.py
py
1,258
python
en
code
0
github-code
36
[ { "api_name": "scrapy.Spider", "line_number": 5, "usage_type": "attribute" }, { "api_name": "scrapy.Request", "line_number": 16, "usage_type": "call" }, { "api_name": "module.items.HotlineItem", "line_number": 26, "usage_type": "call" } ]
34530261292
from __future__ import absolute_import import hashlib import json import os import re import socket from mercurial.i18n import _ from mercurial import ( error, pathutil, url as urlmod, util, vfs as vfsmod, worker, ) from ..largefiles import lfutil # 64 bytes for SHA256 _lfsre = re.compile(r...
bruno-oliveira/twilioHackathon-whats-around-me
env/lib/python2.7/site-packages/hgext/lfs/blobstore.py
blobstore.py
py
17,091
python
en
code
0
github-code
36
[ { "api_name": "re.compile", "line_number": 23, "usage_type": "call" }, { "api_name": "mercurial.vfs.vfs", "line_number": 25, "usage_type": "attribute" }, { "api_name": "mercurial.vfs", "line_number": 25, "usage_type": "name" }, { "api_name": "mercurial.error.Progr...
12185429190
# Creating a regression line - aka line of best fit # Y = mx + b from statistics import mean import numpy as np import matplotlib.pyplot as plt from matplotlib import style style.use('fivethirtyeight') # defined as numpy arrays xs = np.array([1,2,3,4,5,6], dtype=np.float64) ys = np.array([5,4,6,5,6,7], dtype=np...
Wcdunn3/pythonProjects
MachineLearning/MlLesson9LineFit.py
MlLesson9LineFit.py
py
790
python
en
code
0
github-code
36
[ { "api_name": "matplotlib.style.use", "line_number": 8, "usage_type": "call" }, { "api_name": "matplotlib.style", "line_number": 8, "usage_type": "name" }, { "api_name": "numpy.array", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.float64", "...
13509904582
#!/usr/bin/env python # -*- coding: utf-8 -*- """Resize and add text to videos Usage example: $ python transform.py """ import random import os import shutil from moviepy.editor import * from moviepy.video.tools.subtitles import SubtitlesClip from sqlite import * class VideoTransform: def __init__(self, video...
miguel-faggioni/zap-bot
transform.py
transform.py
py
4,335
python
en
code
0
github-code
36
[ { "api_name": "moviepy.video.tools.subtitles.SubtitlesClip", "line_number": 48, "usage_type": "call" }, { "api_name": "moviepy.video.tools.subtitles.SubtitlesClip", "line_number": 64, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 77, "usage_type": "...
17299275140
from django.shortcuts import render, get_object_or_404 from .models import Post, Comment from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger from .forms import CommentForm from django.views.decorators.http import require_POST from taggit.models import Tag """ This is the Count aggregation function ...
m-abdelgawad/automagic-developer-django-postgres-docker-compose-stack
automagic-website/blog/views.py
views.py
py
4,620
python
en
code
0
github-code
36
[ { "api_name": "models.Post.published.all", "line_number": 30, "usage_type": "call" }, { "api_name": "models.Post.published", "line_number": 30, "usage_type": "attribute" }, { "api_name": "models.Post", "line_number": 30, "usage_type": "name" }, { "api_name": "djan...
74540930982
# -*- coding: utf-8 -*- from enum import Enum class SolarTerms(Enum): the_beginning_of_spring = "the Beginning of Spring", "立春" rain_water = "Rain Water", "雨水" the_waking_of_insects = "the Waking of Insects", "惊蛰" the_spring_equinox = "the Spring Equinox", "春分" pure_brightness = "Pure Brightness",...
LKI/chinese-calendar
chinese_calendar/solar_terms.py
solar_terms.py
py
4,541
python
en
code
866
github-code
36
[ { "api_name": "enum.Enum", "line_number": 5, "usage_type": "name" } ]
70539338983
from intrinsic_types import intrinsic_types, is_float from bitstring import Bits, BitArray import random from tempfile import NamedTemporaryFile import os import subprocess from interp import interpret from compiler import compile from bit_util import * import math import z3 import functools import operator from spec_s...
ychen306/upgraded-succotash
fuzzer.py
fuzzer.py
py
12,802
python
en
code
0
github-code
36
[ { "api_name": "os.path.dirname", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path", "line_number": 16, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 16, "usage_type": "call" }, { "api_name": "z3.Solver", "line_nu...
23565614159
#!/usr/bin/python3 import sys import pyvips im = pyvips.Image.new_from_file(sys.argv[1], access="sequential") text = pyvips.Image.text(f"<span color=\"red\">{sys.argv[3]}</span>", width=500, dpi=100, align="centre", r...
libvips/pyvips
examples/watermark.py
watermark.py
py
945
python
en
code
558
github-code
36
[ { "api_name": "pyvips.Image.new_from_file", "line_number": 6, "usage_type": "call" }, { "api_name": "pyvips.Image", "line_number": 6, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 6, "usage_type": "attribute" }, { "api_name": "pyvips.Image....
35701573370
from PyQt5 import QtCore, QtGui, QtWidgets class Ui_MainWindow(object): def setupUi(self, MainWindow): MainWindow.setObjectName("MainWindow") MainWindow.resize(899, 563) MainWindow.setMinimumSize(QtCore.QSize(700, 480)) MainWindow.setStyleSheet("*{\n" "background:#18162A;\n" "borde...
MyLongCode/project1
ui_interface.py
ui_interface.py
py
19,084
python
en
code
0
github-code
36
[ { "api_name": "PyQt5.QtCore.QSize", "line_number": 8, "usage_type": "call" }, { "api_name": "PyQt5.QtCore", "line_number": 8, "usage_type": "name" }, { "api_name": "PyQt5.QtWidgets.QWidget", "line_number": 14, "usage_type": "call" }, { "api_name": "PyQt5.QtWidgets...
8346930934
import os import random import tempfile from copy import copy from functools import partial from multiprocessing import cpu_count import pickle import numpy as np import tensorflow as tf from joblib import Parallel, delayed from .tokenization import printable_text from .utils import (BOS_TOKEN, EOS_TOKEN, add_special...
hauwenc/bert-multitask-learning
bert_multitask_learning/create_generators.py
create_generators.py
py
20,858
python
en
code
null
github-code
36
[ { "api_name": "utils.punc_augument", "line_number": 34, "usage_type": "call" }, { "api_name": "utils.tokenize_text_with_seqs", "line_number": 38, "usage_type": "call" }, { "api_name": "utils.tokenize_text_with_seqs", "line_number": 40, "usage_type": "call" }, { "a...
35614129449
import msgpack import redis import click import socket import pandas as pd import numpy as np import ujson as json #Extra Functions (for enrichment purpose) df_port_name = pd.read_csv('enrichments/port_name.txt',delimiter=",", names=['port_num','port_name']) df_ip_proto_name = pd.read_csv('enrichments/ip_proto_name.tx...
jdcc2/ddoshackathon
packet_patterns.py
packet_patterns.py
py
17,497
python
en
code
0
github-code
36
[ { "api_name": "pandas.read_csv", "line_number": 10, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 11, "usage_type": "call" }, { "api_name": "click.group", "line_number": 14, "usage_type": "call" }, { "api_name": "redis.StrictRedis", "...
22143984130
from art import logo def greet(name, location, time): print(f"Hi {name} from {location}. Good {time}.") print(f"Hey {name} from {location}. Good {time}.") print(f"Hello {name} from {location}. Good {time}.") #greet("Angela", location="London", time="evening") def caeser(direction, text, shift): caeser_text ...
tarunchandel/python-ceaser-cipher
main.py
main.py
py
1,367
python
en
code
0
github-code
36
[ { "api_name": "art.logo", "line_number": 38, "usage_type": "argument" } ]
35478168713
#!/usr/bin/env python3 # -*- coding: UTF-8 -*- import argparse import codecs import sys import openapc_toolkit as oat ARG_HELP_STRINGS = { "csv_file": "The csv file where rows should be reordered", "column": "The numerical index of the column to be used as sorting key", "encoding": "The encoding of the C...
OpenAPC/openapc-de
python/csv_row_reorder.py
csv_row_reorder.py
py
6,006
python
en
code
114
github-code
36
[ { "api_name": "argparse.ArgumentParser", "line_number": 44, "usage_type": "call" }, { "api_name": "codecs.lookup", "line_number": 67, "usage_type": "call" }, { "api_name": "sys.exit", "line_number": 76, "usage_type": "call" }, { "api_name": "sys.exit", "line_n...
74297991462
from collections import defaultdict from itertools import product, chain class Rule: def __init__(self, registry): self.registry = registry self.or_rules = [] self._generated = None def __iter__(self): for r in self.value: yield r def parse_rule(self, rule): ...
maarten-dp/adventofcode2020
solvers/day19.py
day19.py
py
2,835
python
en
code
2
github-code
36
[ { "api_name": "itertools.product", "line_number": 33, "usage_type": "call" }, { "api_name": "itertools.chain", "line_number": 34, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 40, "usage_type": "call" } ]
16746507107
import os import sys import gensim import smart_open import collections import random import json import os.path from gensim.models.doc2vec import Doc2Vec, TaggedDocument from gensim.test.utils import get_tmpfile import time from corpus_indexer import CorpusIndexer class CorpusModeler: def __init__(self, model_nam...
kcculhwch/prayer2vec
build/scripts/corpus_modeler.py
corpus_modeler.py
py
5,038
python
en
code
0
github-code
36
[ { "api_name": "os.path.exists", "line_number": 40, "usage_type": "call" }, { "api_name": "os.path", "line_number": 40, "usage_type": "attribute" }, { "api_name": "json.loads", "line_number": 43, "usage_type": "call" }, { "api_name": "json.dumps", "line_number"...
14144674644
import numpy as np from PIL import Image import torch class GenericDataset: def __init__(self): self.patch_width = None self.image_height = None def add(self, dataset): return SummedDataset(self, dataset) def resize_image(self, image): original_width, original_height = i...
EauDeData/oda_ocr
src/dataloaders/summed_dataloader.py
summed_dataloader.py
py
6,678
python
en
code
0
github-code
36
[ { "api_name": "torch.zeros", "line_number": 72, "usage_type": "call" }, { "api_name": "torch.zeros", "line_number": 73, "usage_type": "call" }, { "api_name": "torch.from_numpy", "line_number": 125, "usage_type": "call" }, { "api_name": "torch.from_numpy", "lin...
37338865985
from distutils.core import setup import os.path import setuptools with open("README.md", "r") as fh: long_description = fh.read() setuptools.setup( name="python_obfuscator", packages=setuptools.find_packages(), version="0.0.2", license="MIT", description="It's a python obfuscator.", author...
davidteather/python-obfuscator
setup.py
setup.py
py
1,182
python
en
code
133
github-code
36
[ { "api_name": "setuptools.setup", "line_number": 8, "usage_type": "call" }, { "api_name": "setuptools.find_packages", "line_number": 10, "usage_type": "call" } ]
69904854506
from flask import Flask, request, jsonify from config import Config from flask_cors import CORS, cross_origin from database import db def create_app(config_class=Config): app = Flask(__name__) app.config.from_object(config_class) app.config['CORS_HEADERS'] = 'Content-Type' db.init_app(app) # imp...
danme-l/website-v2-backend
app.py
app.py
py
1,479
python
en
code
0
github-code
36
[ { "api_name": "config.Config", "line_number": 6, "usage_type": "name" }, { "api_name": "flask.Flask", "line_number": 7, "usage_type": "call" }, { "api_name": "database.db.init_app", "line_number": 12, "usage_type": "call" }, { "api_name": "database.db", "line_...
30872218901
# -*- coding: utf-8 -*- # from rest_framework.generics import ListAPIView, CreateAPIView, UpdateAPIView, RetrieveAPIView, DestroyAPIView # from django.shortcuts import render # from django.views import View # from rest_framework.views import APIView from rest_framework.authentication import BasicAuthentication, Session...
ietar/huluobei
book_drf/views2.py
views2.py
py
4,527
python
en
code
0
github-code
36
[ { "api_name": "rest_framework.generics.GenericAPIView", "line_number": 20, "usage_type": "name" }, { "api_name": "crawlers.models.Book.objects.all", "line_number": 22, "usage_type": "call" }, { "api_name": "crawlers.models.Book.objects", "line_number": 22, "usage_type": "...
70442787624
#coding: utf-8 # __author__ = jqy import logging class Logger(object): def __init__(self, log_file): """Initialize logging module.""" # disable requests log logging.getLogger("requests").setLevel(logging.DEBUG) logger = logging.getLogger() logger.setLevel(logging.DEBUG) ...
stkaeljason/TjgbSpider
logdealer.py
logdealer.py
py
932
python
en
code
1
github-code
36
[ { "api_name": "logging.getLogger", "line_number": 12, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 12, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 14, "usage_type": "call" }, { "api_name": "logging.DEBUG"...
36748155431
from collections import OrderedDict from fudge.index import Index, read_index, write_index from fudge.object import Object, load_object, store_object from fudge.parsing.builder import Builder from fudge.parsing.parser import Parser from fudge.utils import FudgeException class Node(object): def __init__(self, nam...
QuantamKawts/fudge
fudge/tree.py
tree.py
py
3,926
python
en
code
0
github-code
36
[ { "api_name": "collections.OrderedDict", "line_number": 16, "usage_type": "call" }, { "api_name": "fudge.object.load_object", "line_number": 80, "usage_type": "call" }, { "api_name": "fudge.utils.FudgeException", "line_number": 82, "usage_type": "call" }, { "api_n...
24770123438
#!/usr/bin/python3 import requests # pip3 install requests import sys from lxml import etree # pip3 install lxml import re class Item: category = '' detName = '' detDesc = '' link = '' def __init__(self, category, detName, detDesc, link): self.category = category self.detName = det...
echcz/sak
piratebay-cli.py
piratebay-cli.py
py
10,776
python
en
code
2
github-code
36
[ { "api_name": "requests.get", "line_number": 71, "usage_type": "call" }, { "api_name": "sys.exit", "line_number": 74, "usage_type": "call" }, { "api_name": "lxml.etree.HTML", "line_number": 76, "usage_type": "call" }, { "api_name": "lxml.etree", "line_number":...
20336422398
# -*- coding: utf-8 -*- # Resource object code # # Created by: The Resource Compiler for PyQt5 (Qt v5.6.2) # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore qt_resource_data = b"\ \x00\x00\x00\xcc\ \x89\ \x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\ \x00\x00\x40\x0...
NIRVANALAN/TU_rcm
resources.py
resources.py
py
612,926
python
ja
code
2
github-code
36
[ { "api_name": "PyQt5.QtCore.qRegisterResourceData", "line_number": 9381, "usage_type": "call" }, { "api_name": "PyQt5.QtCore", "line_number": 9381, "usage_type": "name" }, { "api_name": "PyQt5.QtCore.qUnregisterResourceData", "line_number": 9384, "usage_type": "call" },...
24428229816
import numpy as np import matplotlib.pyplot as plt import random class Tuihuo: path = [] def __init__(self, graph, num, value=0): # 初始化类 self.num = num self.graph = graph self.value = 0 def output_graph(self): # 输出初始图 for i in self.graph: for j in i: ...
blue-vegetable/AI_TSP_HOMEWORK
SA.py
SA.py
py
3,558
python
en
code
0
github-code
36
[ { "api_name": "numpy.random.rand", "line_number": 53, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 53, "usage_type": "attribute" }, { "api_name": "random.randrange", "line_number": 56, "usage_type": "call" }, { "api_name": "random.randrange...
72172630823
""" Inventarios Componentes v3, CRUD (create, read, update, and delete) """ from typing import Any from sqlalchemy.orm import Session from lib.exceptions import MyIsDeletedError, MyNotExistsError from lib.safe_string import safe_string from ...core.inv_componentes.models import InvComponente from ..inv_categorias.cr...
PJECZ/pjecz-plataforma-web-api-key
plataforma_web/v4/inv_componentes/crud.py
crud.py
py
1,709
python
es
code
0
github-code
36
[ { "api_name": "sqlalchemy.orm.Session", "line_number": 17, "usage_type": "name" }, { "api_name": "core.inv_componentes.models.InvComponente", "line_number": 23, "usage_type": "argument" }, { "api_name": "inv_categorias.crud.get_inv_categoria", "line_number": 25, "usage_ty...
33815850991
from django.shortcuts import get_object_or_404 from rest_framework.decorators import api_view, permission_classes from rest_framework.response import Response from rest_framework import status from rest_framework.permissions import IsAdminUser, IsAuthenticated from .models import Exercise from .serializers import Exerc...
christianbeckham/capstone-app
backend/exercises/views.py
views.py
py
2,944
python
en
code
0
github-code
36
[ { "api_name": "os.environ.get", "line_number": 22, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 22, "usage_type": "attribute" }, { "api_name": "requests.get", "line_number": 25, "usage_type": "call" }, { "api_name": "rest_framework.response.R...
40660876105
# -*- coding:utf-8 -*- import os import sys import time import tensorflow as tf import seq2seqModel import getConfig import io gConfig = {} gConfig=getConfig.get_config(config_file='seq2seq.ini') vocab_inp_size = gConfig['enc_vocab_size'] vocab_tar_size = gConfig['dec_vocab_size'] embedding_dim=gConfig['embedding_di...
zhangzhiqiangccm/NLP-project
chineseChatbotWeb/execute.py
execute.py
py
4,645
python
en
code
120
github-code
36
[ { "api_name": "getConfig.get_config", "line_number": 12, "usage_type": "call" }, { "api_name": "io.open", "line_number": 27, "usage_type": "call" }, { "api_name": "tensorflow.keras.preprocessing.text.Tokenizer", "line_number": 45, "usage_type": "call" }, { "api_na...
5603104189
import discord cogs_list = [ "help", "unveil", "bet", "account" ] class Dealer(discord.Bot): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) for cog in cogs_list: self.load_extension(f"cogs.{cog}") async def on_ready(self): print(f"{...
liang799/rivenDealer
bot.py
bot.py
py
359
python
en
code
1
github-code
36
[ { "api_name": "discord.Bot", "line_number": 11, "usage_type": "attribute" } ]
12338769948
################011011100110010101101111#### ### neo Command Line ####################### ############################################ def getcmdlist(): cmds = { "os" :"Open active Schedule View in Excel.", "ov" :"Open selected views in Project Browser." } return c...
0neo/pyRevit.neoCL
neoCL.extension/neocl_o.py
neocl_o.py
py
700
python
en
code
7
github-code
36
[ { "api_name": "lib.views.neocl_open_schedule_xl.ExportActiveScheduleViewToExcel", "line_number": 16, "usage_type": "call" }, { "api_name": "lib.views.neocl_open_schedule_xl", "line_number": 16, "usage_type": "name" }, { "api_name": "lib.views.neocl_views_open.OpenSelectedViews", ...
15442973460
from __future__ import absolute_import, print_function import json import os import tempfile import mock import mesos.cli.cfg import mesos.cli.cmds.config from .. import utils config_path = os.path.normpath(os.path.join( os.path.dirname(__file__), "..", "data", "config.json")) class TestConfig(utils.MockStat...
mesosphere-backup/mesos-cli
tests/integration/test_config.py
test_config.py
py
1,613
python
en
code
116
github-code
36
[ { "api_name": "os.path.normpath", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path", "line_number": 14, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path.dirname", "lin...
7551769686
from web3 import Web3, EthereumTesterProvider from etherscan import Etherscan import json class Node: def __init__(self, name, value, address, children=[]): self.name = name self.value = value self.children = children self.searched = False self.address = Web3.toChecksumAddr...
DoominEth/Web3DataSandbox
ContractCompossitionNode.py
ContractCompossitionNode.py
py
3,793
python
en
code
0
github-code
36
[ { "api_name": "web3.Web3.toChecksumAddress", "line_number": 12, "usage_type": "call" }, { "api_name": "web3.Web3", "line_number": 12, "usage_type": "name" }, { "api_name": "json.loads", "line_number": 42, "usage_type": "call" } ]
34168133396
from bs4 import BeautifulSoup import requests def wsearch(word): word = word.replace(" ", "-") url = f"https://dictionary.cambridge.org/dictionary/english/{word}" user_agent = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge...
Chris4496/TheDictionaryHubAPI
app/scrapers/cambridge.py
cambridge.py
py
3,117
python
en
code
0
github-code
36
[ { "api_name": "requests.get", "line_number": 12, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 13, "usage_type": "call" } ]
8919279602
import subprocess import json import argparse import os import requests args = None def main(): global args parser = argparse.ArgumentParser( description='update cloudflare dns records') parser.add_argument('Domain', metavar='domain', type=str, ...
bobbae/examples-2021
Python/cloudflare/update_dns.py
update_dns.py
py
4,011
python
en
code
3
github-code
36
[ { "api_name": "argparse.ArgumentParser", "line_number": 11, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 69, "usage_type": "call" }, { "api_name": "os.exit", "line_number": 72, "usage_type": "call" }, { "api_name": "os.getenv", "line_numbe...
36041433257
#!/usr/bin/python import httplib import random import argparse import sys #Get options parser = argparse.ArgumentParser( description='Testing vote app') parser.add_argument( '-port', type=int, help='port of server', default=8000) parser.add_argument( '-host', ...
JoseIbanez/testing
redis/p02-vote/client/c02.py
c02.py
py
1,136
python
en
code
3
github-code
36
[ { "api_name": "argparse.ArgumentParser", "line_number": 8, "usage_type": "call" }, { "api_name": "httplib.HTTPConnection", "line_number": 34, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 47, "usage_type": "call" } ]
14557064993
import sys import cv2 import numpy import copy import scipy.misc import itertools from PIL import Image, ImageOps, ImageDraw from scipy.ndimage import morphology, label from copy import deepcopy from operator import itemgetter from statistics import median, mean from math import sqrt from random import randint from sc...
stepmat/ScienceBirds_sketch_generation
generate_sketch.py
generate_sketch.py
py
114,707
python
en
code
4
github-code
36
[ { "api_name": "sys.argv", "line_number": 24, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 77, "usage_type": "attribute" }, { "api_name": "PIL.ImageOps.grayscale", "line_number": 161, "usage_type": "call" }, { "api_name": "PIL.ImageOps", ...
37853605555
#!/usr/bin/env python # # import common import os, sys, re, random, itertools, functools from atoslib import utils from atoslib import atos_lib from atoslib import generators from atoslib import process TEST_CASE = "ATOS generators - pruning" args = common.atos_setup_args(ATOS_DEBUG_FILE="debug.log") # #########...
atos-tools/atos-utils
tests/test116.py
test116.py
py
9,009
python
en
code
5
github-code
36
[ { "api_name": "common.atos_setup_args", "line_number": 16, "usage_type": "call" }, { "api_name": "atoslib.process.commands.mkdir", "line_number": 25, "usage_type": "call" }, { "api_name": "atoslib.process.commands", "line_number": 25, "usage_type": "attribute" }, { ...
70606542505
import json from wsgiref import simple_server from wsgiref.simple_server import make_server def load_html(file_name,**kwargs): try: with open(file_name,'r',encoding='utf-8') as file: content = file.read() if kwargs: # kwargs = {'username ': 'zhangsan ', 'age':19, 'gender': 'male'} ...
cgyPension/pythonstudy_space
01_base/$05_wsg服务器.py
$05_wsg服务器.py
py
2,943
python
zh
code
7
github-code
36
[ { "api_name": "json.dumps", "line_number": 38, "usage_type": "call" }, { "api_name": "wsgiref.simple_server.make_server", "line_number": 60, "usage_type": "call" } ]
38841107343
import re import random from django.shortcuts import render from django.views.decorators.csrf import csrf_exempt import razorpay from django.db.models import Q from operator import itemgetter from django.core.paginator import Paginator import datetime from property_management_system.settings import razorpay_api_key, ra...
karan7864/property_management
pms/views.py
views.py
py
38,362
python
en
code
0
github-code
36
[ { "api_name": "pms.models.Property.objects.filter", "line_number": 42, "usage_type": "call" }, { "api_name": "pms.models.Property.objects", "line_number": 42, "usage_type": "attribute" }, { "api_name": "pms.models.Property", "line_number": 42, "usage_type": "name" }, ...
43231808566
""" <风格>复古</风格>的旗袍款式 1. 先分词,再标签。 """ import os import re from transformers import BertTokenizer from collections import defaultdict, Counter PATTEN_BIO = re.compile('<?.*>?') def parse_tag_words(subwords): """ HC<领型>圆领</领型><风格>拼接</风格>连衣裙 """ tags = [] new_subwords = [] i = 0 entity = '' wh...
WaveLi123/m-kplug
m_kplug/data_process/bpe_kb_encoder.py
bpe_kb_encoder.py
py
2,910
python
en
code
4
github-code
36
[ { "api_name": "re.compile", "line_number": 13, "usage_type": "call" }, { "api_name": "transformers.BertTokenizer", "line_number": 60, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 61, "usage_type": "call" }, { "api_name": "os.path", "lin...
18338901118
import os import wave import numpy as np import calRMSE import dsp import pylab as pl import scipy.signal as signal import numpy as np import cv2 import matplotlib.pyplot as plt import scipy from scipy.fftpack import fft from scipy.io import wavfile as wav from scipy import signal as sig from scipy.signal import window...
wzt1512978386/Surtify
app/src/main/python/DataPreprocessing2.py
DataPreprocessing2.py
py
12,746
python
en
code
1
github-code
36
[ { "api_name": "wave.open", "line_number": 34, "usage_type": "call" }, { "api_name": "numpy.fromstring", "line_number": 43, "usage_type": "call" }, { "api_name": "numpy.short", "line_number": 43, "usage_type": "attribute" }, { "api_name": "numpy.fix", "line_num...
6508918488
import numpy as np import csv import chainer import chainer.functions as F import chainer.links as L import sys import matplotlib.pyplot as plt class LaughNeuralNet(chainer.Chain): def __init__(self): super(LaughNeuralNet, self).__init__( l1=L.Linear(None, 200), l2=L.Linear(None, 10...
awkrail/laugh_maker
validation_src/predict.py
predict.py
py
4,519
python
en
code
0
github-code
36
[ { "api_name": "chainer.Chain", "line_number": 9, "usage_type": "attribute" }, { "api_name": "chainer.links.Linear", "line_number": 12, "usage_type": "call" }, { "api_name": "chainer.links", "line_number": 12, "usage_type": "name" }, { "api_name": "chainer.links.Li...
22530028718
"""Implementation of a space that represents textual strings.""" from typing import Any, Dict, FrozenSet, Optional, Set, Tuple, Union import numpy as np from gym.spaces.space import Space alphanumeric: FrozenSet[str] = frozenset( "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" ) class Text(Spa...
openai/gym
gym/spaces/text.py
text.py
py
7,660
python
en
code
33,110
github-code
36
[ { "api_name": "typing.FrozenSet", "line_number": 8, "usage_type": "name" }, { "api_name": "gym.spaces.space.Space", "line_number": 13, "usage_type": "name" }, { "api_name": "typing.Union", "line_number": 31, "usage_type": "name" }, { "api_name": "typing.Set", ...
37697513017
import streamlit as st from streamlit_option_menu import option_menu from pages import home, dashboard, login class MultiApp: def __init__(self): self.apps = [] def add_app(self, title, func): self.apps.append({ "title": title, "function": func ...
Ashwani132003/Attendace-Tracker-using-Face-recognition
main.py
main.py
py
976
python
en
code
0
github-code
36
[ { "api_name": "streamlit.sidebar", "line_number": 21, "usage_type": "attribute" }, { "api_name": "streamlit_option_menu.option_menu", "line_number": 22, "usage_type": "call" }, { "api_name": "pages.home.app", "line_number": 35, "usage_type": "call" }, { "api_name"...
24192841460
import requests def check_security_headers(url): headers_to_check = [ 'Strict-Transport-Security', 'Content-Security-Policy', 'X-Content-Type-Options', 'X-Frame-Options', 'X-XSS-Protection', 'Referrer-Policy', 'Permissions-Policy' ] missing_headers =...
hexodotsh/WebSite_Header_Scanner
headers-security-check.py
headers-security-check.py
py
999
python
en
code
0
github-code
36
[ { "api_name": "requests.get", "line_number": 17, "usage_type": "call" }, { "api_name": "requests.exceptions", "line_number": 24, "usage_type": "attribute" } ]
23331780439
from utility_functions import * import matplotlib.pyplot as plt def lemke_optimizer_sparse(eco, payoff_matrix = None, dirac_mode = True): A = np.zeros((eco.populations.size, eco.populations.size * eco.layers)) for k in range(eco.populations.size): A[k, k * eco.layers:(k + 1) * eco.layers] = -1 q ...
jemff/food_web
old_sims/sparse_testing.py
sparse_testing.py
py
4,391
python
en
code
0
github-code
36
[ { "api_name": "matplotlib.pyplot.plot", "line_number": 88, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 88, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 89, "usage_type": "call" }, { "api_name": "matpl...
74477215464
from rdflib import Graph, RDF, Literal, RDFS, plugin, OWL, XSD, SKOS, PROV plugin.register('json-ld', 'Serializer', 'rdfextras.serializers.jsonld', 'JsonLDSerializer') import csv import pandas as pd from collections import Counter from nltk.tag import StanfordNERTagger import spacy import jellyfish as jf import json im...
AsaraSenaratne/anomaly-detection-kg
source-files/yago_nodes.py
yago_nodes.py
py
21,397
python
en
code
2
github-code
36
[ { "api_name": "rdflib.plugin.register", "line_number": 2, "usage_type": "call" }, { "api_name": "rdflib.plugin", "line_number": 2, "usage_type": "name" }, { "api_name": "pandas.read_csv", "line_number": 28, "usage_type": "call" }, { "api_name": "collections.Counte...
43103024978
from celery import shared_task from celery.utils.log import get_task_logger from decouple import config logger = get_task_logger("tasks") expiration_time = config("EXPIRATION_TIME", default=1800, cast=int) @shared_task( bind=True, default_retry_delay=3, eta=expiration_time, retry_kwargs={...
guilhermehgbrito/qrcode-api
qrcode_api/apps/api/tasks.py
tasks.py
py
721
python
en
code
0
github-code
36
[ { "api_name": "celery.utils.log.get_task_logger", "line_number": 5, "usage_type": "call" }, { "api_name": "decouple.config", "line_number": 6, "usage_type": "call" }, { "api_name": "qrcode_api.apps.api.models.QrCode.objects.get", "line_number": 19, "usage_type": "call" ...
37208016314
from datetime import datetime, timedelta birthdate = input("Tell us your bidrthay in DD.MM.YYYY format ") print(birthdate) date_obj = datetime.strptime(birthdate, '%d.%m.%Y').date() print(date_obj) time_difference = datetime.now().date() - date_obj time_now = datetime.now() if (time_now.year < date_obj.year): pr...
KyleKiske/DI-Bootcamp
Week2/Day2/ChallengeGold.py
ChallengeGold.py
py
1,248
python
en
code
0
github-code
36
[ { "api_name": "datetime.datetime.strptime", "line_number": 5, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 5, "usage_type": "name" }, { "api_name": "datetime.datetime.now", "line_number": 8, "usage_type": "call" }, { "api_name": "datet...
17300324237
from django.conf.urls import url from django.views.generic import TemplateView from .views import ( klasses_list_view, klasses_detail_view, klasses_create_view, klasses_delete_view, klasses_update_view, ) urlpatterns =[ # This is Klasses pages url(r'^list/$', klasses_list_view, name='klasse...
SaramCodes/School-Management-System
klass/urls.py
urls.py
py
683
python
en
code
1
github-code
36
[ { "api_name": "django.conf.urls.url", "line_number": 13, "usage_type": "call" }, { "api_name": "views.klasses_list_view", "line_number": 13, "usage_type": "argument" }, { "api_name": "django.conf.urls.url", "line_number": 14, "usage_type": "call" }, { "api_name": ...
42576581221
""" Exercício para mostras as faces encontradas com variação de parâmetro """ import cv2 classificador = cv2.CascadeClassifier('cascades\\haarcascade_frontalface_default.xml') imagem = cv2.imread('pessoas\\pessoas3.jpg') imagemcinza = cv2.cvtColor(imagem, cv2.COLOR_BGR2GRAY) facesdetectadas = classificador.detectMu...
alans96/PythonProject
Computer Vision/1 Detecção de Faces com Python e OpenCV/3 exe.py
3 exe.py
py
583
python
pt
code
0
github-code
36
[ { "api_name": "cv2.CascadeClassifier", "line_number": 5, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 7, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 8, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2GRAY", "...
36829740540
import pytest from launch_jenkins import launch_jenkins from launch_jenkins import log from launch_jenkins import errlog from launch_jenkins import CaseInsensitiveDict def test_log(monkeypatch, capsys): monkeypatch.setitem(launch_jenkins.CONFIG, 'quiet', False) log('hello', 'world') out, err = capsys.rea...
ocaballeror/jenkins-launch
tests/test_misc.py
test_misc.py
py
1,681
python
en
code
0
github-code
36
[ { "api_name": "launch_jenkins.launch_jenkins.CONFIG", "line_number": 10, "usage_type": "attribute" }, { "api_name": "launch_jenkins.launch_jenkins", "line_number": 10, "usage_type": "name" }, { "api_name": "launch_jenkins.log", "line_number": 11, "usage_type": "call" },...
38916812011
import discord from discord.ext.commands import Bot from discord.ext import commands import asyncio import time import random from discord import Game Client = discord.client client = commands.Bot(command_prefix = '-') Clientdiscord = discord.Client() TOKEN = ("NTczNDkxODgzOTc2ODE4Njk4.XMroNg.Pzwl-RFn...
ANATLANTIDA/BOT
Bot.py
Bot.py
py
2,165
python
en
code
0
github-code
36
[ { "api_name": "discord.client", "line_number": 10, "usage_type": "attribute" }, { "api_name": "discord.ext.commands.Bot", "line_number": 11, "usage_type": "call" }, { "api_name": "discord.ext.commands", "line_number": 11, "usage_type": "name" }, { "api_name": "dis...
7870435087
from bs4 import BeautifulSoup from uk_bin_collection.uk_bin_collection.common import * from uk_bin_collection.uk_bin_collection.get_bin_data import \ AbstractGetBinDataClass # import the wonderful Beautiful Soup and the URL grabber class CouncilClass(AbstractGetBinDataClass): """ Concrete classes have to ...
robbrad/UKBinCollectionData
uk_bin_collection/uk_bin_collection/councils/ValeofGlamorganCouncil.py
ValeofGlamorganCouncil.py
py
4,863
python
en
code
51
github-code
36
[ { "api_name": "uk_bin_collection.uk_bin_collection.get_bin_data.AbstractGetBinDataClass", "line_number": 8, "usage_type": "name" }, { "api_name": "bs4.BeautifulSoup", "line_number": 65, "usage_type": "call" } ]
44145316591
import json import logging import typing class JSONDumpReader(typing.Iterator[dict]): def __init__(self, dump_path: str): self.__dump_path = dump_path def __iter__(self): with open(self.__dump_path) as f: for l in f: l = JSONDumpReader.__clean_line(l) ...
AlexandraBaier/bachelorthesis
data_analysis/dumpio.py
dumpio.py
py
1,344
python
en
code
0
github-code
36
[ { "api_name": "typing.Iterator", "line_number": 7, "usage_type": "attribute" }, { "api_name": "json.loads", "line_number": 17, "usage_type": "call" }, { "api_name": "logging.log", "line_number": 19, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_...
37955494687
from flask import Flask, request, jsonify import util app = Flask(__name__) # @app.route decorator exposes the http enedpoint @app.route("/hello") def test(): return "hello world" @app.route("/get-locations") def get_locations(): response = jsonify( { "locations": util.get_locations() ...
Chiemerie1/house_prices_ML_model_deployment
server/server.py
server.py
py
963
python
en
code
0
github-code
36
[ { "api_name": "flask.Flask", "line_number": 5, "usage_type": "call" }, { "api_name": "flask.jsonify", "line_number": 16, "usage_type": "call" }, { "api_name": "util.get_locations", "line_number": 18, "usage_type": "call" }, { "api_name": "flask.request.form", ...
4640657000
from django.http import Http404 from rest_framework.views import APIView from rest_framework.response import Response from rest_framework import status, permissions from .models import CustomUser from .serializers import CustomUserSerializer # Create your views here. class CustomUserList(APIView): permission_cl...
SheCodesAus/heading_for_success_backend_bris_2023
SheFunds_backend/users/views.py
views.py
py
1,915
python
en
code
1
github-code
36
[ { "api_name": "rest_framework.views.APIView", "line_number": 12, "usage_type": "name" }, { "api_name": "rest_framework.permissions.IsAuthenticated", "line_number": 13, "usage_type": "attribute" }, { "api_name": "rest_framework.permissions", "line_number": 13, "usage_type"...
42603056105
import os import json import shutil import time import traceback __author__ = 'Michael Ryan Harlich' def update_paths(paths): paths['partial_prediction'] = paths['output'] + 'partial_predication.ent' paths['partial_ground_truth'] = paths['output'] + 'partial_ground_truth.ent' paths['aligned_prediction'] ...
RyanHarlich/Ca-Prediction-Automated-Testing-Quick-Tools
segments_rmsd/partial_protein/partial_protein.py
partial_protein.py
py
2,534
python
en
code
0
github-code
36
[ { "api_name": "shutil.copyfile", "line_number": 24, "usage_type": "call" }, { "api_name": "json.load", "line_number": 51, "usage_type": "call" }, { "api_name": "os.system", "line_number": 60, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 6...
28930913211
#!/usr/bin/python3 # -*- coding: utf8 -*- # Code from here: # https://stackoverflow.com/a/26289475 import psutil import subprocess import time import os class SSHTunnel(object): """ A context manager implementation of an ssh tunnel opened from python """ def __init__(self, tunnel_command): a...
Vasilesk/quotes-posting
sshtunnel.py
sshtunnel.py
py
2,205
python
en
code
0
github-code
36
[ { "api_name": "subprocess.Popen", "line_number": 25, "usage_type": "call" }, { "api_name": "subprocess.PIPE", "line_number": 26, "usage_type": "attribute" }, { "api_name": "subprocess.STDOUT", "line_number": 26, "usage_type": "attribute" }, { "api_name": "subproce...
21594616095
import spacy import plac import numpy as np import time import re import os import sys import argparse from sklearn.metrics import accuracy_score from conllToSpacy import main # Parsing argument for command-line. parser = argparse.ArgumentParser(description="Testing an NER model with SpaCy.") parser.add_argument("-tp"...
Djia09/Named-Entity-Recognition-spaCy
test_ner_spacy.py
test_ner_spacy.py
py
3,496
python
en
code
3
github-code
36
[ { "api_name": "argparse.ArgumentParser", "line_number": 13, "usage_type": "call" }, { "api_name": "conllToSpacy.main", "line_number": 19, "usage_type": "call" }, { "api_name": "sys.exit", "line_number": 23, "usage_type": "call" }, { "api_name": "sys.exit", "li...
74582104744
from rest_framework.decorators import api_view, permission_classes from rest_framework.permissions import IsAuthenticated from rest_framework.permissions import AllowAny from rest_framework.response import Response from .models import File from .models import Folder from .serializers import FileSerializer from .s...
balibabu/backend
fileapi/views.py
views.py
py
4,763
python
en
code
0
github-code
36
[ { "api_name": "models.File.objects.filter", "line_number": 19, "usage_type": "call" }, { "api_name": "models.File.objects", "line_number": 19, "usage_type": "attribute" }, { "api_name": "models.File", "line_number": 19, "usage_type": "name" }, { "api_name": "seria...