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
43427847703
from .common import deploy def _parse_sub(subparsers): parser = subparsers.add_parser("rtt_isolated", help="Round-trip time for each node in isolation (only node on network)") return parser def _main(args, script_fmt): cmd_list = [ "cd mqtt-benchmark", script_fmt.format(pub="to...
arjunr2/mqtt-benchmark
bench_scripts/rtt_isolated.py
rtt_isolated.py
py
405
python
en
code
0
github-code
36
[ { "api_name": "common.deploy", "line_number": 14, "usage_type": "call" } ]
74473655465
from inspect import getsource from IPython.core.display import HTML, display from pygments import highlight from pygments.lexers import PythonLexer from pygments.formatters import HtmlFormatter _formatter = HtmlFormatter() def get_source(obj, preprocess=None): # comments = f'# decorated by: {obj.decorated_by}\n...
krassowski/jupyter-helpers
jupyter_helpers/source.py
source.py
py
983
python
en
code
45
github-code
36
[ { "api_name": "pygments.formatters.HtmlFormatter", "line_number": 8, "usage_type": "call" }, { "api_name": "inspect.getsource", "line_number": 18, "usage_type": "call" }, { "api_name": "IPython.core.display.HTML", "line_number": 21, "usage_type": "call" }, { "api_...
28969560543
from django.contrib import admin from ..models import Player class PlayerAdmin(admin.ModelAdmin): list_display = ( 'name', 'lastname', 'birth_date', 'team', 'photo', 'position', 'player_number', 'is_first_team', ) admin.site.register(Player, P...
dexer13/rebus-project
world_cup/admin/player_admin.py
player_admin.py
py
332
python
en
code
0
github-code
36
[ { "api_name": "django.contrib.admin.ModelAdmin", "line_number": 6, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 6, "usage_type": "name" }, { "api_name": "django.contrib.admin.site.register", "line_number": 19, "usage_type": "call" },...
19160015551
""" Contains author & document records in dict() form for self-contained testing """ import contextlib import copy import time from collections import defaultdict from itertools import zip_longest from unittest.mock import MagicMock import path_finder from cache.cache_buddy import CacheMiss, AUTHOR_VERSION_NUMBER, \ ...
svank/appa-backend
appa/tests/mock_backing_cache.py
mock_backing_cache.py
py
9,020
python
en
code
0
github-code
36
[ { "api_name": "path_finder.is_bibcode", "line_number": 18, "usage_type": "attribute" }, { "api_name": "path_finder.is_orcid_id", "line_number": 19, "usage_type": "attribute" }, { "api_name": "path_finder.normalize_orcid_id", "line_number": 20, "usage_type": "attribute" ...
61098782
from collections import deque from typing import Union import numpy as np from stlpy.STL import STLTree, STLFormula, LinearPredicate COLORED = False if COLORED: from termcolor import colored else: def colored(text, color): return text class STL: def __init__(self, ast: Union[list, str, STLTree,...
ZikangXiong/STL-Mobile-Robot
src/stl_mob/stl/stl.py
stl.py
py
10,389
python
en
code
4
github-code
36
[ { "api_name": "typing.Union", "line_number": 17, "usage_type": "name" }, { "api_name": "stlpy.STL.STLTree", "line_number": 17, "usage_type": "name" }, { "api_name": "stlpy.STL.STLFormula", "line_number": 17, "usage_type": "name" }, { "api_name": "stlpy.STL.LinearP...
41566426879
import os import testinfra.utils.ansible_runner testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all') def test_readonly(host): f = '/mnt/ro/hello-ro' with host.sudo('test'): c = host.run('touch %s', f) assert c.rc == 1 ass...
ome/ansible-role-nfs-mount
molecule/default/tests/test_default.py
test_default.py
py
640
python
en
code
14
github-code
36
[ { "api_name": "testinfra.utils.ansible_runner.utils.ansible_runner.AnsibleRunner", "line_number": 5, "usage_type": "call" }, { "api_name": "testinfra.utils.ansible_runner.utils", "line_number": 5, "usage_type": "attribute" }, { "api_name": "testinfra.utils.ansible_runner", "l...
889427858
from connection import create_connection import numpy as np,numpy.random from numpy.core.fromnumeric import size import requests from bson.objectid import ObjectId from tag_classes import classifications import random def random_classification(): random_classifcations = {} for tag in classifications.keys(): ...
saarthakbabuta1/loan-agreement
classify.py
classify.py
py
1,858
python
en
code
0
github-code
36
[ { "api_name": "tag_classes.classifications.keys", "line_number": 13, "usage_type": "call" }, { "api_name": "tag_classes.classifications", "line_number": 13, "usage_type": "name" }, { "api_name": "random.choice", "line_number": 14, "usage_type": "call" }, { "api_na...
20580965010
from django import forms from .models import Recipe from channel.models import Channel class RecipeForm(forms.ModelForm): def __init__(self, *args, **kwargs): super(RecipeForm, self).__init__(*args, **kwargs) if self.instance.id: self.fields['trigger_channel'].initial = self.instance.t...
theju/dtwt
recipe/forms.py
forms.py
py
650
python
en
code
9
github-code
36
[ { "api_name": "django.forms.ModelForm", "line_number": 6, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 6, "usage_type": "name" }, { "api_name": "django.forms.ModelChoiceField", "line_number": 13, "usage_type": "call" }, { "api_name": "...
20681014178
__author__ = 'elmira' import numpy as np import itertools from matplotlib import mlab import re with open('corpus1.txt', encoding='utf-8') as f: news = f.read() with open('corpus2.txt', encoding='utf-8') as f: anna = f.read() anna_sentences = re.split(r'(?:[.]\s*){3}|[.?!]', anna) news_sentences = re.split(r...
elmiram/homework
seminar9/task1 (2 points)/genre-by-letters.py
genre-by-letters.py
py
2,438
python
en
code
0
github-code
36
[ { "api_name": "re.split", "line_number": 13, "usage_type": "call" }, { "api_name": "re.split", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.median", "line_number": 51, "usage_type": "call" }, { "api_name": "numpy.median", "line_number": 52, ...
35387136484
#!/usr/bin/env python3 from sys import stderr from multilanguage import Env, Lang, TALcolors from TALinputs import TALinput from TALfiles import TALfilesHelper import os import random import networkx as nx import vertex_cover_lib as vcl import matplotlib import multiprocessing # METADATA OF THIS TAL_SERVICE: args_li...
romeorizzi/TALight
example_problems/tutorial/vertex_cover/services/check_approx_vc_driver.py
check_approx_vc_driver.py
py
10,368
python
en
code
11
github-code
36
[ { "api_name": "multilanguage.Env", "line_number": 32, "usage_type": "call" }, { "api_name": "multilanguage.TALcolors", "line_number": 33, "usage_type": "call" }, { "api_name": "multilanguage.Lang", "line_number": 34, "usage_type": "call" }, { "api_name": "TALfiles...
27478835009
# 1 задание my_list = [1, 1.2, None, True, 'Text', ['list'], {'key_1':'Val_1'}] for itam in my_list: print(type(itam)) # 2 задание my_list2 = input('Введите элементы списка через запятую: ') my_list2 = my_list2.split(',') print(my_list2) my_list2_len = len(my_list2) if len(my_list2) % 2 ==0 else len...
Glen1679/GeekBrains
Homework2.py
Homework2.py
py
4,241
python
ru
code
0
github-code
36
[ { "api_name": "json.dumps", "line_number": 99, "usage_type": "call" }, { "api_name": "json.dump", "line_number": 101, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 111, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 119...
16528703119
from scipy import signal from pywebio.input import * from pywebio.output import * from pywebio import start_server import matplotlib.pyplot as plt import numpy as np from PIL import Image import io def fig2img(fig): """ Converts a Matplotlib figure to a PIL Image and return it """ buf = io.BytesIO() ...
tirthajyoti/PyWebIO
apps/bode.py
bode.py
py
4,531
python
en
code
9
github-code
36
[ { "api_name": "io.BytesIO", "line_number": 14, "usage_type": "call" }, { "api_name": "PIL.Image.open", "line_number": 17, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 17, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.close", "li...
2251885893
import math import numpy as np import pygame as pg def box_l2_loss(obj1, obj2): r1 = np.array([obj1.rect.x, obj1.rect.y, obj1.rect.width, obj1.rect.height]) r2 = np.array([obj2.rect.x, obj2.rect.y, obj2.rect.width, obj2.rect.height]) return np.linalg.norm(r1 - r2) def move_from_vector(vector): angle, speed ...
thbeucher/Games
life_games/utils.py
utils.py
py
1,395
python
en
code
0
github-code
36
[ { "api_name": "numpy.array", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.linalg.norm", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.linalg", "line_numbe...
41763630844
import random from terminaltables import AsciiTable import curses GAME_TITLE = "`•.,¸¸ [ JEU DU TAQUIN ] ¸¸,.•´" # Nombre de cases par côté TAQUIN_SIZE = 4 # Valeur de la case vide EMPTY_CASE_VALUE = "" # Taquin correct, dans l'ordre CORRECT_SOLUTION = [list(a) for a in zip(*[iter(list(range(1, TAQUIN_SIZE ** 2)) ...
martync/taquin-py
taquin.py
taquin.py
py
3,373
python
en
code
0
github-code
36
[ { "api_name": "curses.A_REVERSE", "line_number": 48, "usage_type": "attribute" }, { "api_name": "curses.A_REVERSE", "line_number": 53, "usage_type": "attribute" }, { "api_name": "curses.A_REVERSE", "line_number": 58, "usage_type": "attribute" }, { "api_name": "cur...
4392041881
import json import base64 import pymongo import time from json.encoder import JSONEncoder from azure.storage.queue import ( QueueClient, BinaryBase64EncodePolicy, BinaryBase64DecodePolicy ) azure_storage_account = None mongo_connect = None queue = "test" queue = "general-image-2-crawl" cookies ...
harveyaot/AlphaTaiBai
scripts/send_imageurl2crawl.py
send_imageurl2crawl.py
py
2,867
python
en
code
24
github-code
36
[ { "api_name": "json.load", "line_number": 18, "usage_type": "call" }, { "api_name": "azure.storage.queue.QueueClient.from_connection_string", "line_number": 25, "usage_type": "call" }, { "api_name": "azure.storage.queue.QueueClient", "line_number": 25, "usage_type": "name...
22625649989
import pygame import random import time #飞机大战 #手机上单手操作游戏 #屏幕长方形 # **************************我方飞机 class Hero(object): def __init__(self, _screen, _x, _y): self.image = pygame.image.load("images\hero.gif") self.rect = self.image.get_rect() self.width = self.rect.width self.height = se...
gaicigame99/GuangdongUniversityofFinance-Economics
airplaneWar/黄海辉/飞机大战.py
飞机大战.py
py
7,173
python
en
code
3
github-code
36
[ { "api_name": "pygame.image.load", "line_number": 11, "usage_type": "call" }, { "api_name": "pygame.image", "line_number": 11, "usage_type": "attribute" }, { "api_name": "pygame.init", "line_number": 26, "usage_type": "call" }, { "api_name": "pygame.mixer.init", ...
4801788061
from django.contrib.auth import get_user_model from django.test import TestCase, Client from django.urls import reverse from django.utils import timezone from manager.models import Task, TaskType class TaskPublicTest(TestCase): def test_task_list_public(self): res = self.client.get(reverse("manager:task-...
kovaliskoveronika/task_manager
manager/tests/test_views_task.py
test_views_task.py
py
3,088
python
en
code
0
github-code
36
[ { "api_name": "django.test.TestCase", "line_number": 9, "usage_type": "name" }, { "api_name": "django.urls.reverse", "line_number": 11, "usage_type": "call" }, { "api_name": "django.test.TestCase", "line_number": 17, "usage_type": "name" }, { "api_name": "django.c...
74974903784
"""empty message Revision ID: 3c8f0856b635 Revises: a7b5e34eac58 Create Date: 2018-02-24 13:05:25.721719 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '3c8f0856b635' down_revision = 'a7b5e34eac58' branch_labels = None depends_on = None def upgrade(): # ...
LDouble/cernet_ipv6_server
migrations/versions/3c8f0856b635_.py
3c8f0856b635_.py
py
911
python
en
code
0
github-code
36
[ { "api_name": "alembic.op.create_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.Integ...
41852000033
from flask import send_file, Flask, redirect, render_template, url_for # from crypt import methods import logging from nltk.stem import WordNetLemmatizer from fuzzywuzzy import fuzz from nltk.corpus import wordnet import nltk from flask import send_from_directory, Flask, request, render_template, url_for, redirect, j...
Rohit-S-Singh/Research-Project
app.py
app.py
py
9,288
python
en
code
0
github-code
36
[ { "api_name": "flask.Flask", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path.path.join", "line_number": 21, "usage_type": "call" }, { "api_name": "os.path.path", "line_number": 21, "usage_type": "attribute" }, { "api_name": "os.path", "line_n...
16505504555
from nltk.tag.hmm import * import codecs import statistics import numpy as np from sklearn.metrics import confusion_matrix import metrics from metrics import EditDistance from hmm import HMM from memm import MEMM from crf_word import CRF as CRF_WORD from crf_sentence import CRF as CRF_SENT from rnn import Encoder as RN...
albert-shalumov/nlp_proj
test.py
test.py
py
4,674
python
en
code
1
github-code
36
[ { "api_name": "metrics.MicroAvg", "line_number": 19, "usage_type": "call" }, { "api_name": "metrics.Fscore", "line_number": 20, "usage_type": "call" }, { "api_name": "metrics.MacroAvg", "line_number": 24, "usage_type": "call" }, { "api_name": "metrics.Fscore", ...
74027964263
from mysql_connect import MysqlConnect from s_config import config import requests import re import json import csv import time import random def get_video_type(video_name): res = re.findall(r'-(.*)-|_(.*)_', video_name) if len(res): for item in res[0]: if item: return item...
jercheng/js_video_scrapy
crawl/v_qq_com/data_base/t_main2.py
t_main2.py
py
3,091
python
en
code
0
github-code
36
[ { "api_name": "re.findall", "line_number": 12, "usage_type": "call" }, { "api_name": "requests.session", "line_number": 24, "usage_type": "call" }, { "api_name": "re.match", "line_number": 26, "usage_type": "call" }, { "api_name": "json.loads", "line_number": ...
18446560206
# -*- coding: utf-8 -*- """ @author: DongXiaoning """ import numpy as np import operator import collections import sklearn.datasets # compute gini index def compute_gini(group): m,n = group.shape data = group[:,:-1] label = group[:,-1] dict_label = collections.Counter(label) group_...
xndong/ML-foundation-and-techniques
Decision stump/decision_stump.py
decision_stump.py
py
3,428
python
en
code
0
github-code
36
[ { "api_name": "collections.Counter", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 21, "usage_type": "call" }, { "api_name": "numpy.dot", "line_number": 22, "usage_type": "call" }, { "api_name": "sklearn.datasets.datasets.l...
1528415930
import cv2 import tensorflow as tf import numpy as np import glob import os import time import argparse import configparser from auto_pose.ae import factory, utils parser = argparse.ArgumentParser() parser.add_argument("experiment_name") parser.add_argument("-f", "--file_str", required=True, help='folder or filena...
logivations/AugmentedAutoencoder
auto_pose/test/encoder_inference.py
encoder_inference.py
py
2,190
python
en
code
1
github-code
36
[ { "api_name": "argparse.ArgumentParser", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path.isdir", "line_number": 29, "usage_type": "call" }, { "api_name": "os.path", "line_number": 29, "usage_type": "attribute" }, { "api_name": "glob.glob", "l...
770438494
#Import libraries import scipy.io as spio from scipy import fftpack import matplotlib.pyplot as plt import numpy as np #Process the dataset into samples def process_positions(dataset, positions): output_range = 10 classification_input = [] for position in positions: lower = position - ...
khb00/peak_classifier_and_detector
TimeFreq.py
TimeFreq.py
py
1,337
python
en
code
0
github-code
36
[ { "api_name": "scipy.fftpack.fft", "line_number": 21, "usage_type": "call" }, { "api_name": "scipy.fftpack", "line_number": 21, "usage_type": "name" } ]
21121065737
"""File system hook for the S3 file system.""" from builtins import super import posixpath try: import s3fs except ImportError: s3fs = None from . import FsHook class S3Hook(FsHook): """Hook for interacting with files in S3.""" def __init__(self, conn_id=None): super().__init__() s...
jrderuiter/airflow-fs
src/airflow_fs/hooks/s3_hook.py
s3_hook.py
py
2,720
python
en
code
16
github-code
36
[ { "api_name": "builtins.super", "line_number": 18, "usage_type": "call" }, { "api_name": "s3fs.S3FileSystem", "line_number": 28, "usage_type": "call" }, { "api_name": "s3fs.S3FileSystem", "line_number": 38, "usage_type": "call" }, { "api_name": "posixpath.dirname"...
27502593085
#!/usr/bin/env python # coding: utf-8 # In[33]: import pandas as pd import streamlit as st import requests # In[34]: username = 'ContainiumTE' token = 'RRopW0EJvVEcfS5EGt1rxxswfGF5IfzU3Bh4VkPHS10' github_session = requests.Session() github_session.auth = (username,token) # In[30]: st.title("Discontinuity W...
ContainiumTE/discontinuity_refinement
Discontinuity_Selector.py
Discontinuity_Selector.py
py
18,910
python
en
code
0
github-code
36
[ { "api_name": "requests.Session", "line_number": 18, "usage_type": "call" }, { "api_name": "streamlit.title", "line_number": 26, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 28, "usage_type": "call" }, { "api_name": "streamlit.sidebar.se...
3825597824
"""A setuptools based setup module. See: https://packaging.python.org/guides/distributing-packages-using-setuptools/ """ # Always prefer setuptools over distutils from setuptools import setup, find_packages from os import path here = path.abspath(path.dirname(__file__)) # Arguments marked as "Required" below must be...
kneczaj/android-emulator-docker
setup.py
setup.py
py
1,553
python
en
code
0
github-code
36
[ { "api_name": "os.path.abspath", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path", "line_number": 10, "usage_type": "name" }, { "api_name": "os.path.dirname", "line_number": 10, "usage_type": "call" }, { "api_name": "setuptools.setup", "line_...
26299614326
### ===== Load libraries ===== from langchain.document_loaders.csv_loader import CSVLoader from langchain.embeddings import CacheBackedEmbeddings, HuggingFaceEmbeddings from langchain.vectorstores import FAISS from langchain.storage import LocalFileStore from langchain.text_splitter import TokenTextSplitter from lang...
Valkea/Omdena_Falcon
deployment02/backend/llm_setup.py
llm_setup.py
py
5,289
python
en
code
1
github-code
36
[ { "api_name": "locale.getpreferredencoding", "line_number": 23, "usage_type": "attribute" }, { "api_name": "langchain.document_loaders.csv_loader.CSVLoader", "line_number": 30, "usage_type": "call" }, { "api_name": "langchain.text_splitter.TokenTextSplitter", "line_number": 3...
74197853543
from collections.abc import Iterable from circkit import Circuit, Operation, Node import logging log = logging.getLogger("Transformer") class Transformer: """Base transformer class.""" START_FROM_VARS = False source_circuit: Circuit = None current_node: Node = None current_operation: Operation...
hellman/ches2022wbc
circkit/transformers/core.py
core.py
py
5,704
python
en
code
18
github-code
36
[ { "api_name": "logging.getLogger", "line_number": 7, "usage_type": "call" }, { "api_name": "circkit.Circuit", "line_number": 14, "usage_type": "name" }, { "api_name": "circkit.Node", "line_number": 15, "usage_type": "name" }, { "api_name": "circkit.Operation", ...
8828088539
#!/usr/bin/python # -*- coding: utf-8 -*- import cv2 import math import numpy as np class trackerPoint(object): def __init__(self, x, y, size, frame): # KCF tracker init self.tracker = cv2.TrackerKCF_create() self.bbox = (x-size/2, y-size/2, size,size) self.tracker.init(frame, self.bbo...
ThibaudMZN/GeneralWork
ArmAngleCalculation/ArmAngle.py
ArmAngle.py
py
3,041
python
en
code
0
github-code
36
[ { "api_name": "cv2.TrackerKCF_create", "line_number": 11, "usage_type": "call" }, { "api_name": "cv2.rectangle", "line_number": 27, "usage_type": "call" }, { "api_name": "math.sqrt", "line_number": 34, "usage_type": "call" }, { "api_name": "math.pow", "line_nu...
69889167786
import torch import torch.nn as nn from attention import MultiheadedAttention from feed_forward import PositionWiseDenseNetwork, LayerNorm class DecoderBlock(nn.Module): def __init__(self, key_dim: int = 64, embedding_dim: int = 512, heads_number: int = 8, ...
KolodziejczykWaldemar/Transformers
decoder.py
decoder.py
py
4,651
python
en
code
0
github-code
36
[ { "api_name": "torch.nn.Module", "line_number": 8, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 8, "usage_type": "name" }, { "api_name": "attention.MultiheadedAttention", "line_number": 20, "usage_type": "call" }, { "api_name": "feed_forwa...
21871433231
import jieba,re #去除标点 def get_text(file_name): with open(file_name, 'r', encoding='utf-8') as fr: text = fr.read() #删除的标点 del_ch = ['《',',','》','\n','。','、',';','"',\ ':',',','!','?',' '] for ch in del_ch: text = text.replace(ch,'') return text file_name = 'comment.txt' ...
2412322029/bilibili-spyder
词频.py
词频.py
py
1,370
python
en
code
0
github-code
36
[ { "api_name": "jieba.lcut", "line_number": 16, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 43, "usage_type": "call" } ]
27541539070
#! /usr/bin/env python # -*- coding: utf-8 -*- __author__ = "Travis Anderson" """ This is for contacting twitter, and watching a specific user or word """ import logging import tweepy import time import os import datetime from threading import Thread import threading logger = logging.getLogger(__name__) exit_flag =...
tander29/backend-slackbot
twitbot.py
twitbot.py
py
4,752
python
en
code
0
github-code
36
[ { "api_name": "logging.getLogger", "line_number": 18, "usage_type": "call" }, { "api_name": "threading.Thread", "line_number": 28, "usage_type": "call" }, { "api_name": "tweepy.StreamListener", "line_number": 35, "usage_type": "attribute" }, { "api_name": "os.gete...
32886590499
import discord from discord.ext import commands from discord.ui import Select, View from discord.ext.commands import bot from discord import app_commands class Select(discord.ui.Select): def __init__(self): options=[ discord.SelectOption(label="НАВИГАЦИЯ: команды до игры", value="1", emoji="📜", description="Ком...
FoxSweets/PhasmoBot
cogs/help.py
help.py
py
3,732
python
ru
code
0
github-code
36
[ { "api_name": "discord.ui", "line_number": 7, "usage_type": "attribute" }, { "api_name": "discord.SelectOption", "line_number": 10, "usage_type": "call" }, { "api_name": "discord.SelectOption", "line_number": 11, "usage_type": "call" }, { "api_name": "discord.Sele...
37591561830
#!/usr/bin/env python ''' Rutgers Data Science Homework Week 3, Assignment #1 To run this script: pybank.py [--summary_file=SUMMARY_FILE] input_file_1 input_file_2 ... <Chan Feng> 2018-02 ''' import os import csv from argparse import ArgumentParser _SUMMARY_FILE = 'pybank_summary.txt' _SUMMARY_...
feng443/RUDSWeek3
PyBank/pybank.py
pybank.py
py
3,904
python
en
code
0
github-code
36
[ { "api_name": "argparse.ArgumentParser", "line_number": 45, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 53, "usage_type": "call" }, { "api_name": "os.path", "line_number": 53, "usage_type": "attribute" }, { "api_name": "csv.reader", "l...
74229865385
import configparser from pathlib import Path from flask import Flask from flask_restful import Resource, Api import sqlite3 from todo import DB_WRITE_ERROR, SUCCESS DEFAULT_DB_FILE_PATH = Path.cwd().joinpath( "." + Path.cwd().stem + "_todo.db" ) def get_database_path(config_file: Path) -> Path: """Return th...
CR-Lough/todo_app
core/src/todo/database.py
database.py
py
1,220
python
en
code
0
github-code
36
[ { "api_name": "pathlib.Path.cwd", "line_number": 9, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 9, "usage_type": "name" }, { "api_name": "pathlib.Path.cwd", "line_number": 10, "usage_type": "call" }, { "api_name": "pathlib.Path", "line...
19665159792
from flask import Flask, render_template from flask.ext.sqlalchemy import SQLAlchemy from flask.ext.security import Security, SQLAlchemyUserDatastore, UserMixin, RoleMixin, login_required, current_user, AnonymousUser, roles_required from flask.ext.security.utils import * from flask.ext.security.confirmable import * fro...
rparikh42790/roverpass1
kickstart.py
kickstart.py
py
2,047
python
en
code
0
github-code
36
[ { "api_name": "flask.Flask", "line_number": 11, "usage_type": "call" }, { "api_name": "flask.ext.sqlalchemy.SQLAlchemy", "line_number": 13, "usage_type": "call" }, { "api_name": "flask.ext.login.LoginManager", "line_number": 49, "usage_type": "call" } ]
71648501864
from PIL import Image, ImageDraw import random as rd import imageio def create_simple_tile(size: int, bg_color:str, fg_color: str) -> Image: tile_img = Image.new("RGB", (size, size)) tile_img_draw = ImageDraw.Draw(tile_img) tile_img_draw.rectangle([(0, 0), (size, size)], fill = bg_color) tile_img_draw...
antigones/py-truchet
truchet.py
truchet.py
py
1,782
python
en
code
0
github-code
36
[ { "api_name": "PIL.Image.new", "line_number": 7, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 7, "usage_type": "name" }, { "api_name": "PIL.ImageDraw.Draw", "line_number": 8, "usage_type": "call" }, { "api_name": "PIL.ImageDraw", "line_num...
27031060369
import subprocess import sys import json from workflow import Workflow3 log = None GITHUB_SLUG = 'tilmanginzel/alfred-bluetooth-workflow' def _read_devices(): proc = subprocess.Popen(['./blueutil', '--paired', '--format=JSON'], stdout=subprocess.PIPE) devices_raw = json.loads(proc.stdout.read()) blueto...
tilmanginzel/alfred-bluetooth-workflow
alfred_bluetooth_workflow.py
alfred_bluetooth_workflow.py
py
1,825
python
en
code
188
github-code
36
[ { "api_name": "subprocess.Popen", "line_number": 12, "usage_type": "call" }, { "api_name": "subprocess.PIPE", "line_number": 12, "usage_type": "attribute" }, { "api_name": "json.loads", "line_number": 14, "usage_type": "call" }, { "api_name": "workflow.Workflow3",...
10495520006
from django.test import TestCase from djlotrek.templatetags.djlotrek_filters import ( key, is_in, is_not_in, get_class, get_sorted, media_url, regex_match, ) class TemplateFiltersTestCase(TestCase): def test_key(self): """ templatefilter key is use for get value from d...
lotrekagency/djlotrek
tests/test_templatefilters.py
test_templatefilters.py
py
2,463
python
en
code
7
github-code
36
[ { "api_name": "django.test.TestCase", "line_number": 14, "usage_type": "name" }, { "api_name": "djlotrek.templatetags.djlotrek_filters.key", "line_number": 22, "usage_type": "call" }, { "api_name": "djlotrek.templatetags.djlotrek_filters.key", "line_number": 23, "usage_ty...
37502296937
# https://school.programmers.co.kr/learn/courses/19344/lessons/242261 from collections import deque dire = [[-1, 0], [1, 0], [0, -1], [0, 1]] def CHECK(a, b, g): return not (0 <= a < len(g) and 0 <= b < len(g[0])) def BFS(graph, visit, RB): global answer que = deque() RB.extend([0, False, False]) ...
junsgi/Algorithm
BFS_DFS/기출문제 4번_BFS.py
기출문제 4번_BFS.py
py
2,756
python
en
code
0
github-code
36
[ { "api_name": "collections.deque", "line_number": 9, "usage_type": "call" } ]
3521482660
import pytest import yaml from meltano.core.behavior.canonical import Canonical definition = { # a, b, …, z chr(ord("a") + i): i if i % 2 else None for i in range(10) } class TestCanonical: @pytest.fixture def subject(self): return Canonical(**definition) def test_canonical(self, sub...
learningequality/meltano
tests/meltano/core/behavior/test_canonical.py
test_canonical.py
py
3,836
python
en
code
1
github-code
36
[ { "api_name": "meltano.core.behavior.canonical.Canonical", "line_number": 15, "usage_type": "call" }, { "api_name": "pytest.fixture", "line_number": 13, "usage_type": "attribute" }, { "api_name": "yaml.dump", "line_number": 24, "usage_type": "call" }, { "api_name"...
26510682653
#!/usr/bin/python3 # ***** BEGIN GPL LICENSE BLOCK ***** # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This pro...
patins1/raas4emf
build/mac/blender/blender.app/Contents/MacOS/2.64/scripts/modules/bl_i18n_utils/clean_po.py
clean_po.py
py
3,338
python
en
code
1
github-code
36
[ { "api_name": "settings.TRUNK_PO_DIR", "line_number": 36, "usage_type": "attribute" }, { "api_name": "settings.BRANCHES_DIR", "line_number": 37, "usage_type": "attribute" }, { "api_name": "utils.parse_messages", "line_number": 42, "usage_type": "call" }, { "api_na...
32138192143
import discord from discord.ext import commands import response import re import logging from get_token import get_token imageKWS = ['img','imgs','image','images','pic','pics','pictures','picture'] class botName(commands.Bot): intents = discord.Intents.default() def __init__(self): super().__init__(command_...
benwen2511/chatGBT-discord-bot
main.py
main.py
py
2,311
python
en
code
7
github-code
36
[ { "api_name": "discord.ext.commands.Bot", "line_number": 10, "usage_type": "attribute" }, { "api_name": "discord.ext.commands", "line_number": 10, "usage_type": "name" }, { "api_name": "discord.Intents.default", "line_number": 11, "usage_type": "call" }, { "api_na...
7504092122
from selenium import webdriver from selenium.webdriver.common.keys import Keys from selenium.webdriver.common.by import By from selenium.common.exceptions import WebDriverException import time from django.test import LiveServerTestCase MAX_WAIT = 10 class NewVisitorTest(LiveServerTestCase): '''New visitor test'...
ollko/tdd_book
functional_tests/tests.py
tests.py
py
2,043
python
en
code
0
github-code
36
[ { "api_name": "django.test.LiveServerTestCase", "line_number": 12, "usage_type": "name" }, { "api_name": "selenium.webdriver.Firefox", "line_number": 16, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 16, "usage_type": "name" }, { "api_...
21200837689
# coding: utf-8 import websocket from threading import Thread import time from secrets import token_hex from hashlib import sha256 import hmac import json class RealtimeAPIWebsocket: def __init__(self, logger, parameters, public_handler, private_handler): self.logger = logger self._parameters = pa...
PP-lib/BFS
BFS-X/libs/realtimeapi.py
realtimeapi.py
py
5,448
python
en
code
2
github-code
36
[ { "api_name": "time.time", "line_number": 24, "usage_type": "call" }, { "api_name": "time.time", "line_number": 27, "usage_type": "call" }, { "api_name": "secrets.token_hex", "line_number": 28, "usage_type": "call" }, { "api_name": "hmac.new", "line_number": 2...
70714190504
#!/usr/bin/env python # coding: utf-8 # ## Import des librairies # In[2]: import numpy as np import pandas as pd from pandas_profiling import ProfileReport import matplotlib.pyplot as plt import plotly.offline as py import seaborn as sns import plotly.graph_objs as go import plotly import plotly.figure_factory as ...
bg-mohamed/RFS677-Y
Machine Learning/Machine_Learning_Classification.py
Machine_Learning_Classification.py
py
31,870
python
fr
code
1
github-code
36
[ { "api_name": "warnings.filterwarnings", "line_number": 41, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 49, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 50, "usage_type": "call" }, { "api_name": "pandas.concat...
29226135271
#!/usr/bin/env python # coding: utf-8 # In[1]: from pymongo import MongoClient import numpy as np from tqdm import tqdm def insertInfo(df): client = MongoClient('mongodb://localhost:27017/') infodb = client.Infodb userInfo = infodb.userInfo for index, instance in tqdm(df.iterrows(), total=df.sha...
inhye6-6/project_face_authentication
connect_db.py
connect_db.py
py
1,131
python
en
code
0
github-code
36
[ { "api_name": "pymongo.MongoClient", "line_number": 15, "usage_type": "call" }, { "api_name": "tqdm.tqdm", "line_number": 19, "usage_type": "call" }, { "api_name": "pymongo.MongoClient", "line_number": 34, "usage_type": "call" }, { "api_name": "numpy.frombuffer", ...
71578894183
#!/usr/bin/env python from __future__ import print_function import vtk def main(): # Create a square in the x-y plane. points = vtk.vtkPoints() points.InsertNextPoint(0.0, 0.0, 0.0) points.InsertNextPoint(1.0, 0.0, 0.0) points.InsertNextPoint(1.0, 1.0, 0.0) points.InsertNextPoint(0.0, 1.0, 0.0...
lorensen/VTKExamples
src/Python/GeometricObjects/PolygonIntersection.py
PolygonIntersection.py
py
1,059
python
en
code
319
github-code
36
[ { "api_name": "vtk.vtkPoints", "line_number": 8, "usage_type": "call" }, { "api_name": "vtk.vtkPolygon", "line_number": 15, "usage_type": "call" }, { "api_name": "vtk.mutable", "line_number": 27, "usage_type": "call" }, { "api_name": "vtk.mutable", "line_numbe...
21546274042
#!/Users/shounak/anaconda3/bin/python3 #This program plots histograms to depict genome-wide methylation patterns import matplotlib.pyplot as plt import numpy as np import pandas as pd import argparse import matplotlib import matplotlib.axes matplotlib.rcParams['font.family']="monospace" matplotlib.rcParams['font.monosp...
lanl/DNA_methylation_analysis
Genome_meth_ratio_distribution histograms.py
Genome_meth_ratio_distribution histograms.py
py
2,883
python
en
code
0
github-code
36
[ { "api_name": "matplotlib.rcParams", "line_number": 9, "usage_type": "attribute" }, { "api_name": "matplotlib.rcParams", "line_number": 10, "usage_type": "attribute" }, { "api_name": "matplotlib.rcParams", "line_number": 11, "usage_type": "attribute" }, { "api_nam...
18764507379
""" Given a list of UQ course codes, crawl the UQ course website and scrape information pertaining to said course. """ import sys import requests from bs4 import BeautifulSoup # Headers for making web requests look like a real user (or they may be # rejected by the UQ website) headers = requests.utils.default_headers...
tompoek/uq-course-prereqs-viz
data-crawler/crawl.py
crawl.py
py
1,826
python
en
code
0
github-code
36
[ { "api_name": "requests.utils.default_headers", "line_number": 12, "usage_type": "call" }, { "api_name": "requests.utils", "line_number": 12, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 35, "usage_type": "attribute" }, { "api_name": "sys....
39398980966
# Python Project B # Multinomial Naive Bayes # By # Valdar Rudman # R00081134 from nltk.corpus import stopwords from nltk.tokenize import word_tokenize import matplotlib.pyplot as plt import numpy as np # Read a file in and split on the white space def readFile(source): return open(source).read...
ValdarRudman/Multinomial-Naive-Bayes
Multinomial Naive Bayes.py
Multinomial Naive Bayes.py
py
5,233
python
en
code
0
github-code
36
[ { "api_name": "nltk.corpus.stopwords.words", "line_number": 32, "usage_type": "call" }, { "api_name": "nltk.corpus.stopwords", "line_number": 32, "usage_type": "name" }, { "api_name": "nltk.tokenize.word_tokenize", "line_number": 33, "usage_type": "call" }, { "api...
933471323
import abc from neutron import quota from neutron.api import extensions from neutron.api.v2 import attributes as attr from neutron.api.v2 import resource_helper from neutron.common import exceptions as qexception from neutron.plugins.common import constants UOS_SERVICE_PROVIDER = 'uos:service_provider' UOS_NAME = 'u...
CingHu/neutron-ustack
neutron/extensions/uosfloatingipset.py
uosfloatingipset.py
py
6,685
python
en
code
0
github-code
36
[ { "api_name": "neutron.api.v2.attributes._validate_dict_or_none", "line_number": 25, "usage_type": "attribute" }, { "api_name": "neutron.api.v2.attributes", "line_number": 25, "usage_type": "name" }, { "api_name": "neutron.api.v2.attributes.convert_to_list", "line_number": 29...
29423648678
import logging from collections import namedtuple, defaultdict from copy import deepcopy from dataclasses import dataclass, field from typing import List, Tuple import numpy as np import networkx as nx import parmed as pm from IPython.display import display, SVG from rdkit import Chem from rdkit.Chem import AllChem, D...
wiederm/transformato
transformato/mutate.py
mutate.py
py
90,744
python
en
code
16
github-code
36
[ { "api_name": "rdkit.Chem.Draw.IPythonConsole.molSize", "line_number": 16, "usage_type": "attribute" }, { "api_name": "rdkit.Chem.Draw.IPythonConsole", "line_number": 16, "usage_type": "name" }, { "api_name": "rdkit.Chem.Draw.IPythonConsole.ipython_useSVG", "line_number": 17,...
21054969908
import numpy as np from scipy.special import logsumexp, gammaln from astropy import constants, units as au from astropy.units import Quantity Gauss = 1e-4 * au.T au.set_enabled_equivalencies(au.dimensionless_angles()) def pad_with_absorbing_boundary_conditions(k2, k02, N, *coords, dn_max=0.05): if dn_max is None...
Joshuaalbert/born_rime
born_rime/potentials.py
potentials.py
py
7,396
python
en
code
1
github-code
36
[ { "api_name": "astropy.units.T", "line_number": 6, "usage_type": "attribute" }, { "api_name": "astropy.units", "line_number": 6, "usage_type": "name" }, { "api_name": "astropy.units.set_enabled_equivalencies", "line_number": 7, "usage_type": "call" }, { "api_name"...
8445188718
import operator import cupy from cupy._core import internal from cupy._core._scalar import get_typename from cupyx.scipy.sparse import csr_matrix import numpy as np TYPES = ['double', 'thrust::complex<double>'] INT_TYPES = ['int', 'long long'] INTERVAL_KERNEL = r''' #include <cupy/complex.cuh> extern "C" { __glob...
cupy/cupy
cupyx/scipy/interpolate/_bspline.py
_bspline.py
py
29,962
python
en
code
7,341
github-code
36
[ { "api_name": "cupy.RawModule", "line_number": 69, "usage_type": "call" }, { "api_name": "cupy.RawModule", "line_number": 172, "usage_type": "call" }, { "api_name": "cupy.RawModule", "line_number": 202, "usage_type": "call" }, { "api_name": "cupy._core._scalar.get...
29752329020
# days to seconds, hours to minutes # to repr an interval of time,create timedelta instance like this from datetime import timedelta a = timedelta(days=2, hours=6) b = timedelta(hours=4.5) c = a + b print(c.days) print(c.seconds) print(c.seconds / 3600) print(c.total_seconds() / 3600) from datetime import datetime ...
pranavchandran/redtheme_v13b
chapter_2_strings_and_text/days_to_seconds/days_to_seconds_other.py
days_to_seconds_other.py
py
1,950
python
en
code
0
github-code
36
[ { "api_name": "datetime.timedelta", "line_number": 6, "usage_type": "call" }, { "api_name": "datetime.timedelta", "line_number": 7, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 17, "usage_type": "call" }, { "api_name": "datetime.timede...
39253734345
from functools import reduce from collections import Counter import math import operator import numpy as np class SpamHamClassifier(object): def __init__(self, training_data, vocabulary_size, compute_mutual_information, lambda_constant=0): self._num_training_data = len(training_data) ...
jvmsangkal/spam-filter-py
spamfilter/classifier.py
classifier.py
py
6,440
python
en
code
1
github-code
36
[ { "api_name": "collections.Counter", "line_number": 17, "usage_type": "call" }, { "api_name": "collections.Counter", "line_number": 18, "usage_type": "call" }, { "api_name": "collections.Counter", "line_number": 20, "usage_type": "call" }, { "api_name": "collectio...
42886474434
import logging from json import JSONDecodeError from typing import Dict, Any import requests from .exceptions import TrefleException from .models import Result class RestAdapter: def __init__(self, token: str, logger: logging.Logger = None): """ Constructor for RestAdapter ...
Overlrd/trefle
src/trefleapi/rest_adapter.py
rest_adapter.py
py
2,929
python
en
code
1
github-code
36
[ { "api_name": "logging.Logger", "line_number": 13, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 20, "usage_type": "call" }, { "api_name": "typing.Dict", "line_number": 24, "usage_type": "name" }, { "api_name": "requests.request", ...
5255273641
import os from re import I import sys from openpyxl import Workbook from openpyxl.styles import Border, Side, PatternFill, Font, Alignment from datetime import datetime sys.path.insert(0, os.path.abspath('..\\pycatia')) from pycatia import catia from pycatia.enumeration.enumeration_types import cat_work_mode_type ca...
kang851216/CATIA_macro
manufacturing and process list_adding drawing list_test.py
manufacturing and process list_adding drawing list_test.py
py
24,204
python
en
code
0
github-code
36
[ { "api_name": "sys.path.insert", "line_number": 8, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path", "line_number...
35865754669
""" no longer needed since pointnet2_ssg_cls can provide this form """ import torch import torch.nn as nn import torch.nn.functional as F import sys,os BASE_DIR = os.path.dirname(os.path.abspath(__file__)) ROOT_DIR = os.path.dirname(os.path.dirname(BASE_DIR)) sys.path.append(ROOT_DIR) sys.path.append(os.path.join(ROO...
PointCloudYC/PointNet-modern.pytorch
models/pointnet2/pointnet2_msg_cls.py
pointnet2_msg_cls.py
py
1,339
python
en
code
3
github-code
36
[ { "api_name": "os.path.dirname", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path.dirname", "line...
73881080745
from flask import Flask, request import json from jwt.exceptions import JWTException from jwt.jwt import JWT from jwt.jwk import OctetJWK def login(app: Flask): @app.post("/api/auth/login") def test(): reqest_data = request.get_json() try: jwt = JWT() login = reqest_dat...
Axime/Aska2.0
server/routes/auth/login.py
login.py
py
1,121
python
en
code
0
github-code
36
[ { "api_name": "flask.Flask", "line_number": 8, "usage_type": "name" }, { "api_name": "flask.request.get_json", "line_number": 11, "usage_type": "call" }, { "api_name": "flask.request", "line_number": 11, "usage_type": "name" }, { "api_name": "jwt.exceptions", ...
3204081333
# -*- coding: utf-8 -*- """ Created on Mon Apr 1 21:36:27 2019 @author: Rodrigo """ import csv import sqlite3 e = csv.writer(open('output.csv', 'w')) e.writerow(['cpf','UC']) conn = sqlite3.connect('enel.db') cursor = conn.cursor() # lendo os dados cursor.execute(""" SELECT * FROM enel; """) f...
rasiqueira/enel
bd.py
bd.py
py
409
python
en
code
0
github-code
36
[ { "api_name": "csv.writer", "line_number": 10, "usage_type": "call" }, { "api_name": "sqlite3.connect", "line_number": 13, "usage_type": "call" } ]
31628499109
import traceback import sys from discord.ext import commands import discord class ErrorHandler(commands.Cog): def __init__(self, bot): self.bot = bot @commands.Cog.listener() async def on_command_error(self, ctx, error): if hasattr(ctx.command, 'on_error'): return igno...
docgonzo2015/Botler-discord-bot
cogs/errors.py
errors.py
py
1,104
python
en
code
0
github-code
36
[ { "api_name": "discord.ext.commands.Cog", "line_number": 6, "usage_type": "attribute" }, { "api_name": "discord.ext.commands", "line_number": 6, "usage_type": "name" }, { "api_name": "discord.ext.commands.CommandNotFound", "line_number": 15, "usage_type": "attribute" },...
27980759583
""" Simulated Annealing Class """ import pickle import random import math import numpy as np import sklearn import pandas as pd import configparser import random from pathlib import Path import joblib from Utils.attack_utils import get_constrains from Models.scikitlearn_wrapper import SklearnClassifier from Utils.da...
adiashk/search_AI_project
Simulated_Annealing.py
Simulated_Annealing.py
py
17,737
python
en
code
0
github-code
36
[ { "api_name": "configparser.ConfigParser", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.linspace", "line_number": 98, "usage_type": "call" }, { "api_name": "numpy.linspace", "line_number": 99, "usage_type": "call" }, { "api_name": "numpy.linspac...
9993622660
import json from django.core.management import call_command from django.core.management.base import BaseCommand from people.models import Person, Address class Command(BaseCommand): help = 'Loads sample data into the database' def handle(self, *args, **options): # Clear the database call_comm...
finlay422/challenge_project
people/management/commands/load_sample_data.py
load_sample_data.py
py
734
python
en
code
0
github-code
36
[ { "api_name": "django.core.management.base.BaseCommand", "line_number": 7, "usage_type": "name" }, { "api_name": "django.core.management.call_command", "line_number": 12, "usage_type": "call" }, { "api_name": "json.load", "line_number": 15, "usage_type": "call" }, { ...
36568920733
from django.urls import path, re_path from . import views app_name = 'adminapp' urlpatterns = [ path('', views.login, name='login'), path('category/add/', views.add_category, name='add_category'), path('article/add/', views.add_post), path('article/list/', views.post_list), path('category/list/', v...
MicroPyramid/ngo-cms
admin/urls.py
urls.py
py
2,514
python
en
code
8
github-code
36
[ { "api_name": "django.urls.path", "line_number": 6, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 8, "usage_type": "call" }, { "api_name": "django.urls.path", ...
35648526405
from src.knowledge_graph import KGEntity, KGProperty from .kgqa_dataset import KGQADataSet from .kgqa_data import KGQAData from typing import List import logging import json class Mintaka(KGQADataSet): def load(self, path: str) -> List[KGQAData]: datasets: List[KGQAData] = [] with open(path, enco...
bumsikki/KAPPR
src/dataset/mintaka.py
mintaka.py
py
1,837
python
en
code
null
github-code
36
[ { "api_name": "kgqa_dataset.KGQADataSet", "line_number": 8, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 11, "usage_type": "name" }, { "api_name": "kgqa_data.KGQAData", "line_number": 11, "usage_type": "name" }, { "api_name": "json.load", ...
3843330309
import numpy import numpy as np import pandas as pd import pygad import tlsh import json from tools import featurer import sys import csv import tensorflow as tf from tensorflow import keras from keras import layers import filenames_modified as filenames MALWAREIDX = int(sys.argv[1]) BATCH_SIZE = 10 # print(MALWAREID...
ZsZs88/Poisoning
genetic_modified.py
genetic_modified.py
py
7,404
python
en
code
0
github-code
36
[ { "api_name": "sys.argv", "line_number": 15, "usage_type": "attribute" }, { "api_name": "pandas.read_csv", "line_number": 20, "usage_type": "call" }, { "api_name": "filenames_modified.arm_training", "line_number": 20, "usage_type": "attribute" }, { "api_name": "pa...
23108069207
from flask import Flask, app from flask_login import LoginManager from flask_sqlalchemy import SQLAlchemy # init SQLAlchemy so we can use it later in our models db = SQLAlchemy() def create_app(): application = Flask(__name__) application.config['SECRET_KEY'] = '9OLWxND4o83j4K4iuopO' application.config['...
peastuti/sb-admin-2-flask-login
project/__init__.py
__init__.py
py
946
python
en
code
1
github-code
36
[ { "api_name": "flask_sqlalchemy.SQLAlchemy", "line_number": 6, "usage_type": "call" }, { "api_name": "flask.Flask", "line_number": 9, "usage_type": "call" }, { "api_name": "flask_login.LoginManager", "line_number": 17, "usage_type": "call" }, { "api_name": "models...
7773371889
import random import time from pathlib import Path from typing import Any import numpy as np from midi.decode import get_array_of_notes from midi.encode import get_file_from_standard_features from models.music_model import MusicModel, ProgressCallback, ProgressMetadata class MarkovChain(MusicModel): n_gram_size...
piotrowskv/music_generation
models/models/markov_chain/markov_chain.py
markov_chain.py
py
6,790
python
en
code
0
github-code
36
[ { "api_name": "models.music_model.MusicModel", "line_number": 13, "usage_type": "name" }, { "api_name": "numpy.ndarray", "line_number": 22, "usage_type": "attribute" }, { "api_name": "typing.Any", "line_number": 25, "usage_type": "name" }, { "api_name": "models.mu...
71877366824
#!/usr/bin/env python # coding: utf-8 import sys import io import json import numpy as np from matplotlib import pyplot as plt from tensorflow import keras import tensorflow as tf from tensorflow.compat.v1 import ConfigProto from tensorflow.compat.v1 import InteractiveSession from pathlib import Path import cv2 import...
DanilKonon/Seismic_Data_Inpainting
unet_autoencoder.py
unet_autoencoder.py
py
22,825
python
en
code
0
github-code
36
[ { "api_name": "tensorflow.compat.v1.ConfigProto", "line_number": 31, "usage_type": "call" }, { "api_name": "tensorflow.compat.v1.InteractiveSession", "line_number": 33, "usage_type": "call" }, { "api_name": "tensorflow.test.is_gpu_available", "line_number": 34, "usage_typ...
2286169944
""" Created on Sat Sep 25 00:00:00 2018 @author: Nikhil """ """ If you have any questions or suggestions regarding this script, feel free to contact me via nikhil.ss4795@gmail.com """ # Polynomial Regression # Importing the libraries import numpy as np import matplotlib.pyplot as plt import pandas as pd #...
Nikhil4795/Polynomial_Linear_Regression
Polynomial_regression_2/polynomial_regression.py
polynomial_regression.py
py
1,854
python
en
code
0
github-code
36
[ { "api_name": "pandas.read_csv", "line_number": 20, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.scatter", "line_number": 24, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 24, "usage_type": "name" }, { "api_name": "matplotli...
8460276839
from time import sleep from appium import webdriver from appium.webdriver.common.mobileby import MobileBy from appium.webdriver.extensions.android.gsm import GsmCallActions from selenium.webdriver.support import expected_conditions from selenium.webdriver.support.wait import WebDriverWait class TestBrowser(): de...
yyw15910852287/hogwarts_appium
交互api/test_jiaohu.py
test_jiaohu.py
py
1,876
python
zh
code
0
github-code
36
[ { "api_name": "appium.webdriver.Remote", "line_number": 32, "usage_type": "call" }, { "api_name": "appium.webdriver", "line_number": 32, "usage_type": "name" } ]
40961448639
# coding: utf-8 import itertools import re from simpleai.search import (backtrack, CspProblem, LEAST_CONSTRAINING_VALUE, min_conflicts, MOST_CONSTRAINED_VARIABLE) largos = { '1H': 2, '2H': 3, '4H': 2, '5H': 2, '7H': 2, '8H': 2, '10H': 3, '11H': 2, '1V': 2, '2V': 2, '3V': 3, '4V': ...
ucse-ia/ucse_ia
practicas/crucigramas.py
crucigramas.py
py
5,727
python
en
code
5
github-code
36
[ { "api_name": "re.sub", "line_number": 13, "usage_type": "call" }, { "api_name": "itertools.combinations", "line_number": 74, "usage_type": "call" }, { "api_name": "simpleai.search.CspProblem", "line_number": 102, "usage_type": "call" }, { "api_name": "simpleai.se...
27040895007
import argparse import auxil.mydata as mydata import auxil.mymetrics as mymetrics import gc import tensorflow as tf import keras.backend as K from keras.callbacks import ModelCheckpoint from keras.models import load_model from keras.losses import categorical_crossentropy from keras.layers import * from keras.models imp...
deeplearning2020/comparison
algorithms/proposed.py
proposed.py
py
7,971
python
en
code
0
github-code
36
[ { "api_name": "tensorflow.multiply", "line_number": 52, "usage_type": "call" }, { "api_name": "keras.models.Model", "line_number": 88, "usage_type": "call" }, { "api_name": "keras.optimizers.Adam", "line_number": 90, "usage_type": "call" }, { "api_name": "argparse...
39974821125
# USAGE # python align_faces.py --shape-predictor shape_predictor_68_face_landmarks.dat --image images/example_01.jpg # import the necessary packages from imutils.face_utils import FaceAligner from imutils.face_utils import rect_to_bb import argparse import imutils import dlib import cv2 # construct the argument par...
juanluisrosaramos/dataset_tuning
align_faces.py
align_faces.py
py
1,729
python
en
code
1
github-code
36
[ { "api_name": "argparse.ArgumentParser", "line_number": 14, "usage_type": "call" }, { "api_name": "dlib.get_frontal_face_detector", "line_number": 23, "usage_type": "call" }, { "api_name": "dlib.shape_predictor", "line_number": 24, "usage_type": "call" }, { "api_n...
41907946588
import torch import torch.nn as nn class CNN(nn.Module): def __init__(self): super(CNN, self).__init__() self.conv_1 = self._con_dw_sep(3, 16) self.conv_2 = self._con_dw_sep(16, 32) self.conv_3 = self._con_dw_sep(32, 64) self.fc1 = nn.Linear(10816, 512) sel...
CSID-DGU/2022-2-SCS4031-EZ_SW
age_prediction_model/model.py
model.py
py
1,212
python
en
code
0
github-code
36
[ { "api_name": "torch.nn.Module", "line_number": 5, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 5, "usage_type": "name" }, { "api_name": "torch.nn.Linear", "line_number": 12, "usage_type": "call" }, { "api_name": "torch.nn", "line_numb...
14566552628
from django.contrib.auth.models import User from django.db import models import cover.models from documents.models import (Book, Chunk, Image, BookPublishRecord, ImagePublishRecord) from documents.signals import post_publish from dvcs.signals import post_publishable def book_changed(sender, instance, created,...
fnp/redakcja
src/documents/models/listeners.py
listeners.py
py
1,794
python
en
code
4
github-code
36
[ { "api_name": "django.db.models.signals.post_save.connect", "line_number": 14, "usage_type": "call" }, { "api_name": "django.db.models.signals", "line_number": 14, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 14, "usage_type": "name" }, ...
11476729859
"""AD&D Second Edition Combat Simulator""" # Always prefer setuptools over distutils from setuptools import setup, find_packages from codecs import open from os import path here = path.abspath(path.dirname(__file__)) # Get the long description from the README file with open(path.join(here, 'README.rst'), encoding='u...
gene1wood/adnd2e-combat-simulator
setup.py
setup.py
py
1,409
python
en
code
2
github-code
36
[ { "api_name": "os.path.abspath", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path", "line_number": 8, "usage_type": "name" }, { "api_name": "os.path.dirname", "line_number": 8, "usage_type": "call" }, { "api_name": "codecs.open", "line_number":...
17884750945
import pprint import threading from typing import Dict, TYPE_CHECKING from PySide2.QtWidgets import QTabWidget, QTextBrowser, QWidget from lib.comm import get_var, set_var from widgets import PMTableView, PMGTableWidget, PMDockObject, PMGTableViewer, PMGJsonTree if TYPE_CHECKING: from lib.extensions.extensionlib....
pyminer/pyminer
pyminer/packages/workspace_inspector/data_viewer.py
data_viewer.py
py
8,746
python
en
code
77
github-code
36
[ { "api_name": "typing.TYPE_CHECKING", "line_number": 9, "usage_type": "name" }, { "api_name": "widgets.PMGTableViewer", "line_number": 32, "usage_type": "name" }, { "api_name": "widgets.PMGTableViewer.__init__", "line_number": 38, "usage_type": "call" }, { "api_na...
23701537076
import argparse import os import shutil import numpy as np import torch import torchvision from torch import nn as nn from torch.utils.tensorboard import SummaryWriter from torch.utils.data import Dataset, DataLoader from tqdm import tqdm import helpers from dcgan import generators, discriminators from dcgan.train_con...
dfridman1/GANs
dcgan/train.py
train.py
py
7,028
python
en
code
0
github-code
36
[ { "api_name": "torch.utils.data.Dataset", "line_number": 17, "usage_type": "name" }, { "api_name": "dcgan.train_config.TrainConfig", "line_number": 17, "usage_type": "name" }, { "api_name": "os.path.exists", "line_number": 22, "usage_type": "call" }, { "api_name":...
5515862018
from __future__ import absolute_import from __future__ import division from __future__ import print_function import argparse import os from vgg import load_pretrained_VGG16_pool5 import cifar10_utils import tensorflow as tf import numpy as np LEARNING_RATE_DEFAULT = 1e-4 BATCH_SIZE_DEFAULT = 128 MAX_STEPS_DEFAULT = 1...
frhrdr/dlc2016
practical_3/retrain_vgg.py
retrain_vgg.py
py
10,700
python
en
code
1
github-code
36
[ { "api_name": "tensorflow.train.AdamOptimizer", "line_number": 40, "usage_type": "call" }, { "api_name": "tensorflow.train", "line_number": 40, "usage_type": "attribute" }, { "api_name": "tensorflow.name_scope", "line_number": 50, "usage_type": "call" }, { "api_na...
410387277
"""gistandard 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') Class...
RobbieHan/gistandard
gistandard/urls.py
urls.py
py
4,296
python
en
code
546
github-code
36
[ { "api_name": "django.conf.urls.url", "line_number": 29, "usage_type": "call" }, { "api_name": "xadmin.site", "line_number": 29, "usage_type": "attribute" }, { "api_name": "django.conf.urls.url", "line_number": 30, "usage_type": "call" }, { "api_name": "django.vie...
34846072669
#!/usr/bin/env python # coding: utf-8 # refer to https://machinelearningmastery.com/multivariate-time-series-forecasting-lstms-keras/ # # to tune parameters # refer to http://yangguang2009.github.io/2017/01/08/deeplearning/grid-search-hyperparameters-for-deep-learning/ # In[1]: from __future__ import print_functio...
dxcv/TradingAlgo
Multi-LSTM/LSTMsinKeras-VirtualCurrency-Simple.py
LSTMsinKeras-VirtualCurrency-Simple.py
py
7,561
python
en
code
0
github-code
36
[ { "api_name": "urllib.request.urlopen", "line_number": 33, "usage_type": "call" }, { "api_name": "urllib.request", "line_number": 33, "usage_type": "attribute" }, { "api_name": "json.loads", "line_number": 36, "usage_type": "call" }, { "api_name": "pandas.DataFram...
15868980621
from collections import deque import sys dx = [1,-1,0,0] dy = [0,0,-1,1] def iswall(x,y): if x<0 or y<0 : return False if x >= n or y >= m : return False if matrix[x][y] == 0 : # 방문한 경우 return False return True # 그 외의 경우 def bfs(x,y): queue = deque() print(queue) q...
HYEONAH-SONG/Algorithms
파이썬 알고리즘 인터뷰/미로탈출.py
미로탈출.py
py
815
python
en
code
0
github-code
36
[ { "api_name": "collections.deque", "line_number": 17, "usage_type": "call" } ]
74491447145
import time import json import datetime invalid = "\n--Invalid response, please try again.--" scheduleFile = "schedule.json" assignmentFile = "assignment.json" def load(): for i in range(0, 40): time.sleep(0.00000000000001) print("-", end='', flush=True) print() def unload(): for i in ran...
BenVN123/PythonScheduler
scheduler.py
scheduler.py
py
8,943
python
en
code
1
github-code
36
[ { "api_name": "time.sleep", "line_number": 11, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 17, "usage_type": "call" }, { "api_name": "json.load", "line_number": 36, "usage_type": "call" }, { "api_name": "json.dump", "line_number": 61, ...
32766043528
#!/urs/bin/python #-*- coding:utf8 -*- from bs4 import BeautifulSoup as bs import urllib import re import json import os def get_musicid(url): #url='http://music.baidu.com/top/dayhot' html = urllib.urlopen(url).read() soup = bs(html,'lxml',from_encoding='utf8') urls = soup.findAll('a',href=re.compile(r'/so...
carloszo/Carlos_python
Crawler/BaiduMusicCrawler.py
BaiduMusicCrawler.py
py
1,916
python
en
code
0
github-code
36
[ { "api_name": "urllib.urlopen", "line_number": 11, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 12, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 13, "usage_type": "call" }, { "api_name": "urllib.urlopen", "lin...
27037909109
import torch from torch import nn from fuxictr.pytorch.models import MultiTaskModel from fuxictr.pytorch.layers import FeatureEmbedding, MLP_Block class SharedBottom(MultiTaskModel): def __init__(self, feature_map, model_id="SharedBottom", gpu=-1, ...
xue-pai/FuxiCTR
model_zoo/multitask/SharedBottom/src/SharedBottom.py
SharedBottom.py
py
3,155
python
en
code
671
github-code
36
[ { "api_name": "fuxictr.pytorch.models.MultiTaskModel", "line_number": 7, "usage_type": "name" }, { "api_name": "fuxictr.pytorch.layers.FeatureEmbedding", "line_number": 34, "usage_type": "call" }, { "api_name": "fuxictr.pytorch.layers.MLP_Block", "line_number": 35, "usage...
473540501
#!/usr/bin/env python import musescore_parser as mp import sys from fractions import Fraction from dataclasses import dataclass, field from typing import Optional import re #https://github.com/OpenLilyPondFonts/lilyjazz/blob/master/JazzSampler.pdf @dataclass class Base: def __post_init__(self): print("%...
duhovniprojekt/duhovne_pjesme_novi_sad_1966
scripts/new/lilypond_generator.py
lilypond_generator.py
py
27,495
python
en
code
0
github-code
36
[ { "api_name": "dataclasses.dataclass", "line_number": 13, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 21, "usage_type": "name" }, { "api_name": "fractions.Fraction", "line_number": 21, "usage_type": "name" }, { "api_name": "typing.Optio...
25209486610
#!/usr/local/bin/python3 import socket import struct import crcmod #from dataservice.datawave_produce.waveproduce import sin_wave,triangle_wave import random def crccreate(b,length): crc16_func = crcmod.mkCrcFun(0x18005, initCrc=0xFFFF, rev=True, xorOut=0x0000) return crc16_func(b[0:length]) def crccheckhole(...
Scottars/nis_website
dataservice/epicsrelated/simulate2.py
simulate2.py
py
2,560
python
en
code
0
github-code
36
[ { "api_name": "crcmod.mkCrcFun", "line_number": 9, "usage_type": "call" }, { "api_name": "crcmod.mkCrcFun", "line_number": 12, "usage_type": "call" }, { "api_name": "crcmod.mkCrcFun", "line_number": 17, "usage_type": "call" }, { "api_name": "struct.pack", "lin...
1925887546
#!/bin/python import collections import os import re import subprocess import time GHOSTLY_PATH = '/usr/bin/ghostly' ALLIE_DBG = '../target/debug/allie' # Old versions ALLIE_1_1 = './bin/allie_v1.1' ALLIE_1_0 = './bin/allie_v1.0' ALLIE_0_9 = './bin/allie_v0.9' ALLIE_0_8 = './bin/allie_v0.8' ALLIE_0_7 = './bin/allie...
Kwarf/Allie-2017
benchmarker/bench.py
bench.py
py
2,332
python
en
code
0
github-code
36
[ { "api_name": "re.compile", "line_number": 26, "usage_type": "call" }, { "api_name": "collections.namedtuple", "line_number": 30, "usage_type": "call" }, { "api_name": "subprocess.Popen", "line_number": 44, "usage_type": "call" }, { "api_name": "subprocess.PIPE", ...
40978312177
# pylint: disable=E0401,E0611 import os import json script_dir = os.path.dirname(__file__) from helpers.DataService import DataService from models.InputData import InputData from models.OutputData import OutputData from models.DataResult import DataResult from models.Encoder import Encoder from models.Decoder import ...
AtLeastITry/seq2seq-keras-chatBot
train.py
train.py
py
2,470
python
en
code
2
github-code
36
[ { "api_name": "os.path.dirname", "line_number": 5, "usage_type": "call" }, { "api_name": "os.path", "line_number": 5, "usage_type": "attribute" }, { "api_name": "tensorflow.GPUOptions", "line_number": 24, "usage_type": "call" }, { "api_name": "tensorflow.Session",...
38449435175
#!/usr/bin/env python import rospy from std_msgs.msg import String from move_base_msgs.msg import MoveBaseGoal from move_base_msgs.msg import MoveBaseAction import re from Command import Command from Queue import Queue import actionlib from tf import transformations from geometry_msgs.msg import Quaternion from sound_p...
elmdecoste/ros_advanced_voice
scripts/speech_queue.py
speech_queue.py
py
2,950
python
en
code
0
github-code
36
[ { "api_name": "rospy.init_node", "line_number": 22, "usage_type": "call" }, { "api_name": "rospy.Rate", "line_number": 24, "usage_type": "call" }, { "api_name": "rospy.Subscriber", "line_number": 26, "usage_type": "call" }, { "api_name": "std_msgs.msg.String", ...
15871926331
import tensorflow as tf import numpy as np import matplotlib.pyplot as plt import matplotlib.image as mpimg import os def read_image(image): return mpimg.imread(image) def format_image(image): return tf.image.resize(image[tf.newaxis, ...], [224, 224]) / 255.0 def get_category(img): """Write a Function...
FourthBrain/Intro-to-Flask
inference.py
inference.py
py
1,815
python
en
code
1
github-code
36
[ { "api_name": "matplotlib.image.imread", "line_number": 9, "usage_type": "call" }, { "api_name": "matplotlib.image", "line_number": 9, "usage_type": "name" }, { "api_name": "tensorflow.image.resize", "line_number": 13, "usage_type": "call" }, { "api_name": "tensor...
35623428711
from django.urls import path from .views import * app_name = "Mentor" urlpatterns = [ path("", view=MentorListView.as_view(), name="listar y crear mentores"), path("user/", view=MentorByUserRUD.as_view(), name="traer mentor por id de usuario"), path("<int:pk>/", view=MentorRUDView.as_view(), name="Obtener,...
DiegoStevenVera/MentorTic
apps/mentor/urls.py
urls.py
py
554
python
es
code
0
github-code
36
[ { "api_name": "django.urls.path", "line_number": 6, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 8, "usage_type": "call" }, { "api_name": "django.urls.path", ...
36887287548
from flask import Flask, request from . import db app = Flask(__name__) @app.route("/api/message", methods=["GET"]) def get_random_message(): """Return a random message to play the part of 'message in a bottle'.""" return { "content": db.get_random_message() } @app.route("/api/message", methods=["POST"]) d...
mshenfield/swellnote
swellnote/__init__.py
__init__.py
py
584
python
en
code
1
github-code
36
[ { "api_name": "flask.Flask", "line_number": 5, "usage_type": "call" }, { "api_name": "flask.request.get_json", "line_number": 15, "usage_type": "call" }, { "api_name": "flask.request", "line_number": 15, "usage_type": "name" } ]
29772321096
import unittest import HtmlTestRunner from selenium import webdriver import time from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.common.by import By from selenium.webdriver.common.keys import Keys class Lo...
degea78/Bitdefender
test-bitdef/testCases/testBitdef.py
testBitdef.py
py
2,917
python
en
code
0
github-code
36
[ { "api_name": "unittest.TestCase", "line_number": 14, "usage_type": "attribute" }, { "api_name": "selenium.webdriver.Chrome", "line_number": 16, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 16, "usage_type": "name" }, { "api_name": "s...
18405451718
#!/usr/bin/env python3 import boto3 import argparse import os import base64 from common_functions import getAllInstances, getDynamoDBItems from common_jenkins import triggerJob from common_kms import get_plaintext_key parser = argparse.ArgumentParser() parser.add_argument("-e", "--env", help="Staging or Production", ...
trtruong/utilities
scripts/python/checkOrphanedInstances.py
checkOrphanedInstances.py
py
4,165
python
en
code
0
github-code
36
[ { "api_name": "argparse.ArgumentParser", "line_number": 11, "usage_type": "call" }, { "api_name": "os.system", "line_number": 19, "usage_type": "call" }, { "api_name": "boto3.Session", "line_number": 21, "usage_type": "call" }, { "api_name": "base64.b64decode", ...
35855718282
from __future__ import print_function import scrapy from scrapy.http.cookies import CookieJar from scrapy.spiders import CrawlSpider, Rule from scrapy.selector import Selector from scrapy.http import Request,FormRequest from mytest.items import myItem class mySpider(scrapy.Spider): name = "myspider" allowed_...
zhengwuyang/notes
Testcode/Scrapytest/mytest/spiders/my_spider.py
my_spider.py
py
2,289
python
en
code
0
github-code
36
[ { "api_name": "scrapy.Spider", "line_number": 10, "usage_type": "attribute" }, { "api_name": "mytest.items.myItem", "line_number": 38, "usage_type": "call" }, { "api_name": "scrapy.selector.Selector", "line_number": 39, "usage_type": "call" }, { "api_name": "mytes...