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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
11877257013 | import json
import csv
import tldextract
def extract_to_file(tweetsfilename, featuresfilename):
fieldnames = [
'id', # Tweet ID
'timestamp_ms', # Timestamp in ms, GMT
'user_id', # Twitter User ID
'action', # mention, tweet, retweet
'entity_type', # user_id, hashtag, url, tld... | a24be3b59803260d/twitter_stream_ingest | feature_extractor.py | feature_extractor.py | py | 3,691 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "csv.DictWriter",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "tldextract.extract",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "tldextract.extract",
... |
72907038454 | import random
import sys
import pygame
from pygame.locals import *
if 1 == 1:
SCR_RECT = Rect(0, 0, 900, 600)
CELL_SIZE = 10
HEIGHT = SCR_RECT.height // CELL_SIZE
WIDTH = SCR_RECT.width // CELL_SIZE
COL_0 = 14
ROW_0 = 1
DEAD, ALIVE, MARKED, NON_MARKED, NEW_ALIVE, DIED_OUT = 0, 1... | cxy-251/the-first-repo | lifeGame/MyLife.py | MyLife.py | py | 11,027 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pygame.init",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 48,
"usage_type": "attribute"
},
{
"api_name": "pygame.displa... |
18294093302 | import re
import datetime
import pyspark.sql.functions as funct
from pyspark.sql.types import TimestampType
from dateutil import parser
from lib.logs import logger
from pyspark.sql.functions import isnan, when, count, col, from_unixtime
from pyspark.sql.types import DoubleType, TimestampType
class correct_variable_ty... | ms8909/dptron | lib/v1/correct_variable_types.py | correct_variable_types.py | py | 2,372 | python | en | code | 4 | github-code | 21 | [
{
"api_name": "lib.logs.logger.error",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "lib.logs.logger",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "pyspark.sql.functions.col",
"line_number": 66,
"usage_type": "call"
},
{
"api_name": "pyspa... |
5142696580 | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sb
import re
train_df = pd.read_csv('train.csv')
test_df = pd.read_csv('test.csv')
train_df.describe()
train_df.isna().sum()
sb.kdeplot(train_df['battery_power'],legend=False,color="blue",shade=True)
sb.kdeplot(train_df['clock_sp... | Lal47/Mobile_Price_Classification | MPC.py | MPC.py | py | 2,259 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pandas.read_csv",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "seaborn.kdeplot",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "seaborn.kdeplot",
"... |
74991416371 | # 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.
from tests import TestCase, get_data_path
import os
from io import Byt... | quodlibet/quodlibet | tests/test_formats__id3.py | test_formats__id3.py | py | 25,351 | python | en | code | 1,306 | github-code | 21 | [
{
"api_name": "tests.TestCase",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "helper.get_temp_copy",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "os.remove",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "mutagen.File",
"lin... |
43028056797 | from django import forms
from .models import Coach
from django.contrib.auth.models import User #User de django pas notre user de .models
from django.contrib.auth.forms import UserCreationForm
class CoachForm(forms.Form):
first_name=forms.CharField(
label='Prenom',
max_length=50
)
last_name... | FirasKhadraoui/InnovationHub | Hub/forms.py | forms.py | py | 790 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django.forms.Form",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "django.forms.CharField",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.forms"... |
826034834 | import sqlite3
import numpy as np
import pandas as pd
import time
from scipy import stats
connection = sqlite3.connect('data_db.db')
c = connection.cursor()
#c.close()
c.execute("DROP TABLE IF EXISTS two_values")
c.execute('''CREATE TABLE two_values
(ID int,
value1 int,
value2 int,
... | artur-avagyan/Data_visualization | Homework_4(Animation_Central_Limit_Theorem)/data_gen.py | data_gen.py | py | 1,052 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "sqlite3.connect",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.random.randint",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "numpy.append",
... |
6773675859 | import sys
import itertools
from collections import OrderedDict
import matplotlib.pyplot as plt
from PIL import Image
from tqdm.auto import tqdm
import torch
from torch import nn, optim
from torch.nn.functional import mse_loss
from torchvision import transforms
from torchvision.models import vgg19, VGG19_Weights
from... | Komorebi660/PythonCode | NeuralStyleTransfer/NeuralStyleTransfer.py | NeuralStyleTransfer.py | py | 9,742 | python | en | code | 21 | github-code | 21 | [
{
"api_name": "sys.argv",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "torch.backends.mps.is_available",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "torch.backends",
"line_number": 44,
"usage_type": "attribute"
},
{
"api_name": "tor... |
15935842761 |
from os import path
import shutil
import tempfile
from absl.testing import parameterized
from tensorflow.python.data.kernel_tests import test_base
from tensorflow.python.data.ops import dataset_ops
from tensorflow.python.framework import combinations
from tensorflow.python.framework import errors
from tensorflow.pytho... | Mockingbird01001/NLG-code-generator-LSTM | work/data/data_model/batch_2/list_files_test.py.transformed.py | list_files_test.py.transformed.py | py | 6,831 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "tensorflow.python.data.kernel_tests.test_base.DatasetTestBase",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.python.data.kernel_tests.test_base",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "absl.testing.parameterized.TestC... |
21392919416 | from flask import Flask, request
import sys
sys.path.append('./')
from mmx.feat_extract import feat_extractor
from mmx.const import *
app = Flask(__name__)
# app.debug=True
fe = feat_extractor()
fe.load_model(FEAT_EXTRACT_MODEL)
@app.route("/features",methods=["POST"])
def calc_img_features():
# get image
f... | grelade/mmx | dockers/feat_extract/server.py | server.py | py | 505 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "sys.path.append",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "flask.Flask",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "mmx.feat_extract.feat_extracto... |
26789589262 | """ CRUD operations. """
from models import db, User, Meeting, Book, List
from datetime import datetime
import pytz
from apis import *
from sqlalchemy import not_
# Meetings
def get_all_meetings():
""" Returns list of all meetings. """
return Meeting.query.all()
def get_all_active_meetings():
""" Returns... | innasoboleva/Read-Meet | crud.py | crud.py | py | 5,724 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "models.Meeting.query.all",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "models.Meeting.query",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "models.Meeting",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "mod... |
4870557527 | # flake8: noqa: F841
from typing import Any, Callable, List, Tuple, TypedDict
import numpy as np
import pytest
import gt4py.storage
from gt4py import gtscript as gs
from gt4py.backend import from_name
from gt4py.gtscript import PARALLEL, computation, interval, stencil
from gt4py.stencil_builder import StencilBuilder
... | tehrengruber/gt4py | tests/test_unittest/test_gtc/test_passes/test_min_k_interval.py | test_min_k_interval.py | py | 7,976 | python | en | code | null | github-code | 21 | [
{
"api_name": "typing.TypedDict",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "typing.Tuple",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "typing.Tuple",
"line_nu... |
24953809697 | from numpy import *
from time import time
from operator import itemgetter
from converter import Converter
from estimation import TransitionHandler, EmissionHandler
from model import Model
from collections import Counter, deque
from textutils import ConllParser
CHUNK = 0
POS = 1
class HMM:
"""Mostly superfluous cla... | presic/chunker | hmm.py | hmm.py | py | 6,836 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "model.converter.convert_tokens",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "model.converter",
"line_number": 36,
"usage_type": "attribute"
},
{
"api_name": "model.get_state_N",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": ... |
42924868397 | import unittest
import log_analyzer
import datetime
from decimal import Decimal
class Log_Analyzer_Test(unittest.TestCase):
def setUp(self):
self.config = {
"REPORT_SIZE": 10,
"REPORT_DIR": "./reports",
"LOG_DIR": "./log",
... | gdancerx/op_11 | tests/test_log_analyzer.py | test_log_analyzer.py | py | 15,981 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "unittest.TestCase",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "log_analyzer.read_config_file",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "log_analyzer.find_last_log",
"line_number": 25,
"usage_type": "call"
},
{
"ap... |
33168784556 | # License: BSD
# Author: Sasank Chilamkurthy
from __future__ import print_function, division
import torch
import torch.nn as nn
import torch.optim as optim
from torch.optim import lr_scheduler
import numpy as np
import torchvision
import torchvision.datasets as datasets
from torchvision import models, transforms
impo... | hhaahaha/AI_recognition_plate | svhn_train.py | svhn_train.py | py | 7,651 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "matplotlib.pyplot.ion",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "torchvision.transforms.Compose",
"line_number": 34,
"usage_type": "call"
},
{
"api_name":... |
43095753249 | import sqlite3
import sys
import os
import os.path
import json
import logging
import datetime
import io
import itertools
logging.basicConfig(filename='sorteioquina.log', level=logging.DEBUG,
format=' %(asctime)s - %(levelname)s - %(message)s')
logging.info('Inicio')
def SalvaTodasQuadras01(List... | msilva1610/ApostasMegaSena01 | SorteiosQuina.py | SorteiosQuina.py | py | 4,257 | python | pt | code | 1 | github-code | 21 | [
{
"api_name": "logging.basicConfig",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "logging.info",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "logging.info",
... |
12643823536 | """
date: 2017/12/10
author: lslcode [jasonli8848@qq.com]
"""
import os
import gc
import xml.etree.ElementTree as etxml
import random
import skimage.io
import skimage.transform
import numpy as np
import tensorflow as tf
import ssdbo
import time
'''
SSDBO检测
'''
def testing():
gpu_options = tf.GPUOptions(per_proces... | lslcode/SSDBO_for_Tensorflow | main.py | main.py | py | 7,460 | python | en | code | 12 | github-code | 21 | [
{
"api_name": "tensorflow.GPUOptions",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "tensorflow.Session",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "tensorflow.ConfigProto",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "ssdbo... |
18419342392 | from django.shortcuts import render,redirect
from django.http import HttpResponse,JsonResponse
from .models import Cake,Pastrie
from .forms import NewUserForm
from django.contrib.auth.forms import UserCreationForm
from django.views.decorators.csrf import csrf_exempt
from django.contrib.auth.forms import UserCreationFor... | knshkp/cakes_world | home/views.py | views.py | py | 2,811 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django.shortcuts.render",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "models.Cake.objects.all",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "models.Cake.objects",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name... |
20045377364 | #!/usr/bin/env python
from setuptools import setup, find_packages
console_scripts = [
'zeroxkim = zeroxkim.check_date:main',
]
setup(
name='zeroxkim',
version='0.0.2',
description='example package',
author='ZeroXKim',
author_email='zeroxkim@netmarble.com',
url='https://zerox... | JohnHaan/cloudtechpython | 20170605/zeroxkim/setup.py | setup.py | py | 454 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "setuptools.setup",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "setuptools.find_packages",
"line_number": 16,
"usage_type": "call"
}
] |
12977192636 | import pytest
import warnings
import numpy as np
import os
# import sys
# sys.path.append('../')
from polyssifier import polyr
from sklearn.datasets import load_diabetes
warnings.filterwarnings("ignore")
diabetes_data = load_diabetes().data
diabetes_target = load_diabetes().target
@pytest.mark.medium
def test_featur... | alvarouc/polyssifier | tests/test_regression.py | test_regression.py | py | 3,304 | python | en | code | 65 | github-code | 21 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sklearn.datasets.load_diabetes",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sklearn.datasets.load_diabetes",
"line_number": 12,
"usage_type": "call"
},
{
... |
1878481107 | #! /usr/bin/python3
# -*- coding: utf-8 -*-
import pypinyin
import time
from service.micro.utils.customerized_data_type import enum
ES_INDEX = (
"weibo_", # 微博
"wechat_", # 微信
"tieba_", # 贴吧
"baijiahao_", # 百家号
"zhihu_", # 知乎
"website_", # 新闻网站
"app_", # app
"douyin_", # 抖音
)
O... | gaoyuan3593/lyricalSpider_docker | service/micro/keyword/__init__.py | __init__.py | py | 1,394 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "service.micro.utils.customerized_data_type.enum",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "pypinyin.pinyin",
"line_number": 35,
"usage_type": "call"
},
{
"api_nam... |
21115456760 | """Incomplete easy-to-use math solver and PDF generator."""
from __future__ import division
from traceback import format_tb
from func import MathDocument
from gui import QtWidgets, Ui_MainWindow
from loguru import logger
from PyQt5.QtCore import pyqtSlot
from PyQt5.QtWidgets import QMainWindow
class MainWindow(QMai... | salastro/math-expert | src/mathexpert/main.py | main.py | py | 2,505 | python | en | code | 21 | github-code | 21 | [
{
"api_name": "PyQt5.QtWidgets.QMainWindow",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "gui.Ui_MainWindow",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "func.MathDocument",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "func.... |
6849186938 | #!/usr/bin/env python
# importing data from a file
import tensorflow as tf
import numpy as np
np.set_printoptions(threshold=np.inf)
from tqdm import tqdm
import pandas as pd
from random import sample
from random import seed
seed(30)
import copy
from time import time
from actor import Actor
from config import get_con... | mhaqir/Tumor-Phylo-RL | Tumor-Phylo-RL_v1/main.py | main.py | py | 13,790 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "numpy.set_printoptions",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.inf",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "random.seed",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "config.get_config",
... |
41360662903 | # Main python file for price tracking automation
# importing required libraries
import pandas as pd
import requests
from win10toast import ToastNotifier
toaster = ToastNotifier()
url_mapping = 'https://prices.runescape.wiki/api/v1/osrs/mapping' # used to get names for each item_id and current price
url_latest = 'htt... | coryjerni/ha_assist | price_check.py | price_check.py | py | 1,438 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "win10toast.ToastNotifier",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame.fr... |
42907797653 | import hashlib
import json
import os
import re
import traceback
import yaml
import copy
from sqlitedict import SqliteDict
import fwglobals
import fwrouter_api
import fwutils
class FwRouterCfg:
"""This is requests DB class representation.
:param db_file: SQLite DB file name.
"""
def __init__(self, d... | maxleaf/flexiagent | fwrouter_cfg.py | fwrouter_cfg.py | py | 23,914 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "sqlitedict.SqliteDict",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "fwglobals.log.debug",
"line_number": 63,
"usage_type": "call"
},
{
"api_name": "fwglobals.log",
"line_number": 63,
"usage_type": "attribute"
},
{
"api_name": "fwglobal... |
41552928043 | import logging
from spaceone.core import utils
from datetime import datetime
from spaceone.core.manager import BaseManager
from spaceone.monitoring.model.event_response_model import EventModel
from spaceone.monitoring.error.event import *
_LOGGER = logging.getLogger(__name__)
class EventManager(BaseManager):
def ... | cloudforet-io/plugin-prometheus-mon-webhook | src/spaceone/monitoring/manager/event_manager.py | event_manager.py | py | 5,225 | python | en | code | 4 | github-code | 21 | [
{
"api_name": "logging.getLogger",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "spaceone.core.manager.BaseManager",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.now",
"line_number": 28,
"usage_type": "call"
},
{
"api_name... |
41067079162 | import scipy.io as sio
import random
import numpy as np
def read(batch, data, is_training=True):
if is_training:
np.random.shuffle(data)
for i in range(len(data)):
batch_data = data[i*batch:(i+1)*batch]
img = batch_data[:, 1:].reshape(batch, -1, 1)
label = batch_data[:, 0]
... | ivileey/python | data_gen.py | data_gen.py | py | 670 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "numpy.random.shuffle",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "numpy.int64",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "scipy.io.loadma... |
21296485603 | from nextcord.ext.commands import Cog
from nextcord import slash_command, Embed, Color, utils, ui, ButtonStyle, Role, VoiceChannel, Guild
from nextcord.ext.application_checks import has_permissions, ApplicationMissingPermissions
from nextcord.ext import tasks
from bot import BotMarket
from typing import Optional
from ... | xXenvy/BotMarket | cogs/stats.py | stats.py | py | 1,562 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "nextcord.ext.commands.Cog",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "bot.BotMarket",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "bot.BotMarket",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "nextcord.Guild"... |
39134343578 | import pandas as pd
import numpy as np
from numpy import asarray, linspace
from sklearn.metrics import confusion_matrix
def Matrix_Calculation(model_1=None, model_2=None, data:pd.DataFrame=None, feature_names:list=None,
labels:str=None, threshold:float=None, alpha:float=None, well_name:list=Non... | sonnt-dna/API_Fracture | src/app/service/library/Devtools/Classification/matrix_calculation.py | matrix_calculation.py | py | 1,785 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pandas.DataFrame",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "numpy.asarray",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "sklearn.metrics.confusion_matrix",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "s... |
1191484701 | #!/usr/bin/python3
# -*- coding: utf-8 -*-
"""
ZetCode PyQt5 tutorial
In this program, we can press on a button with
a left mouse click or drag and drop the button
with the right mouse click.
author: Jan Bodnar
website: zetcode.com
last edited: January 2015
"""
from PyQt5.QtCore import QMimeData
from PyQt5.QtGui im... | cangfengzhe/indigo-GUI | test.py | test.py | py | 3,497 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "PyQt5.QtCore.QMimeData",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 123,
"usage_type": "attribute"
}
] |
7891938621 | import itertools
with open('input.txt') as f:
data = f.readlines()
data = list(map(int, data))
for n in enumerate(data[25:], 25):
if n[1] not in (a + b for a, b in itertools.combinations(data[n[0]-25:n[0]], 2)):
invalid = n[1]
break
print(invalid)
# I might have gotten my indices wrong
for... | nfitzen/advent-of-code-2020 | 9/star2.py | star2.py | py | 480 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "itertools.combinations",
"line_number": 9,
"usage_type": "call"
}
] |
33936943556 | import io
import disnake
from disnake.ext import commands
import logging
import qrcode as qrc
from typing import Tuple
from helper.qr import full as emebedHelp
from qrcode.image.styles.moduledrawers import *
from qrcode.image.styles.colormasks import *
from qrcode.image.styledpil import *
from qrcode.constants import... | Stinky-c/DisBot | cogs/qr.py | qr.py | py | 7,374 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "disnake.ext.commands.Cog",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "disnake.ext.commands",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "typing.Tuple",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "disna... |
73998173812 | import sqlite3
from .jsonr import p
dat = sqlite3.connect('data/dat1.db')
d = dat.cursor()
def checklink(lnk):
'''Check if the link is valid, set your specific link if needed (data/lang.json)'''
if p["values"]["link"] in lnk:
return True
else:
return False
def check2(userlist, usr):
... | Mamiglia/Requester-Bot | obj/checks.py | checks.py | py | 946 | python | en | code | 5 | github-code | 21 | [
{
"api_name": "sqlite3.connect",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "jsonr.p",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "jsonr.p",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "jsonr.p",
"line_number": 30,
"u... |
13517462902 | from functools import partial
from typing import Any, Dict, List, Optional, Tuple, Type, Union
import gym
import numpy as np
import torch as th
from stable_baselines3.common.distributions import (
BernoulliDistribution,
CategoricalDistribution,
DiagGaussianDistribution,
Distribution,
MultiCategoric... | robot-learning-freiburg/Multi-Object-Search | src/SB3/policy.py | policy.py | py | 12,412 | python | en | code | 8 | github-code | 21 | [
{
"api_name": "stable_baselines3.common.policies.ActorCriticPolicy",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "gym.spaces",
"line_number": 63,
"usage_type": "attribute"
},
{
"api_name": "gym.spaces",
"line_number": 64,
"usage_type": "attribute"
},
{
... |
74395324533 | # -*- coding: utf-8 -*-
"""
Created on Thu Jul 9 15:45:53 2020
@author: Antony
"""
import matplotlib.pyplot as plt
import time
from skimage.draw import random_shapes
import numpy as np
import astra
def cirmask(im, npx=0):
"""
Apply a circular mask to the image
"""
... | keeeto/super_tomo_py | data/reconstruction/LibShapes.py | LibShapes.py | py | 5,886 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "numpy.floor",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "numpy.tile",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "numpy.swapaxes",
"line_number... |
28455710873 |
import json
from django.shortcuts import get_object_or_404
from django.db import models
from asgiref.sync import sync_to_async, async_to_sync
from channels.generic.websocket import AsyncWebsocketConsumer, WebsocketConsumer
from channels.layers import get_channel_layer
from chat.models import Message, UserStatus, Con... | jp803333/ChatApp | chatappbackend/chat/websockets/consumers.py | consumers.py | py | 8,788 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "channels.layers.get_channel_layer",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "asgiref.sync.async_to_sync",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "channels.layers.get_channel_layer",
"line_number": 26,
"usage_type": "call"
... |
4227706613 | import flask
from flask_cors import CORS, cross_origin
import logging
from flask import request
import webscrapper
app = flask.Flask(__name__)
CORS(app)
@app.route('/', methods = ['GET', 'POST'])
@cross_origin(origin='*')
def scrapper():
#header=request.headers.get('Authorization')
#header =request.headers['... | HassanAthmani/jiji_webscrapper | scrapper_server.py | scrapper_server.py | py | 1,636 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "flask.Flask",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "flask_cors.CORS",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "flask.request.get_json",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "flask.request",
... |
74121461491 | from smi2smi.data_reader import MolecularTokenizer
from smi2smi.recurrent import build_model
from smi2smi.train import fit_and_save
import os
import json
import pickle
model_config = {
'vocab_size':3100,
'embedding_dim':512,
'embedding_share':True,
'source_reverse':False,
'cnn_config':{
'de... | XuanVuNguyen/smi2smi | rnn_train_script.py | rnn_train_script.py | py | 4,777 | python | en | code | 3 | github-code | 21 | [
{
"api_name": "os.mkdir",
"line_number": 97,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 98,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 98,
"usage_type": "attribute"
},
{
"api_name": "json.dump",
"line_number": 99,... |
846688566 | from datetime import datetime
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
from matplotlib import lines
from E3nn_Operations import *
from GElib_Operations import *
import gc
import os
# plt params
plt.rcParams.update({'font.size': 16})
# folder
folder = "Time_CG_May11"
... | wongrp/gelib_benchmark- | Time_CG.py | Time_CG.py | py | 6,306 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "matplotlib.pyplot.rcParams.update",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.rcParams",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 13,
"usage_type": "name"
},
{
... |
5768385374 | import pygame as pg
import math
from bullet import Bullet
from particle import Particle
from settings import *
class Barrel:
def __init__(self, owner):
self.owner = owner
self.angle = math.pi
self.img = self.base_img = pg.image.load(f'{TANKS_DIR}/barrel{owner.color}_outline.png').conve... | ROUVELL/Tanks | barrel.py | barrel.py | py | 1,821 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "math.pi",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "pygame.image.load",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pygame.image",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "pygame.Vector2",
... |
70925675893 | from nltk.corpus import stopwords
from nltk.stem.snowball import SnowballStemmer
from nltk.tokenize import word_tokenize
import re
import datetime
use_stemmer = False
stemmer = SnowballStemmer("spanish")
stopset = set(stopwords.words('english') + stopwords.words('spanish'))
def tokenize(text):
text = re.sub(r"(?:\... | johnnytorres/cwdiscussions | wdds_tokenizer.py | wdds_tokenizer.py | py | 597 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "nltk.stem.snowball.SnowballStemmer",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "nltk.corpus.stopwords.words",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "nltk.corpus.stopwords",
"line_number": 8,
"usage_type": "name"
},
{
... |
28333159680 | #!/usr/bin/env python3
import serial
from time import time, sleep
import tkinter as tk
import os
from PIL import Image, ImageTk
class Detector:
def __init__(self):
self.current_report = 1
self.window = tk.Tk()
self.window.attributes("-fullscreen", True)
self.window.configure(backgro... | griswaldbrooks/theranos-edison | detector.py | detector.py | py | 3,727 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "tkinter.Tk",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "tkinter.Label",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "tkinter.Label",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "PIL.ImageTk.PhotoImage",
"... |
8646058433 | """
Module with unit tests of the healthcheck route.
"""
from unittest import mock
import flask
import pytest
from flask.testing import FlaskClient
from app import app
@pytest.fixture(scope="module")
def client() -> FlaskClient:
"""
Starts flask testing client.
"""
app.config["TESTING"] = True
r... | scaffork/scaffork-flask | tests/unit/routes/v1/test_healthcheck.py | test_healthcheck.py | py | 888 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "app.app.config",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "app.app",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "app.app.test_client",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "app.app",
"line_n... |
9643346338 | import torch
from torch import nn
from torchvision import models
import functools
### Functions
class Identity(nn.Module):
def forward(self, x):
return x
def get_network(type,name):
if type == 'generator':
if name == 'vgg19':
return VGG19Generator()
elif name == 'unet':
return Unet... | abeytheo/gan-inpainting | lib/models/networks.py | networks.py | py | 15,780 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "torch.nn.Module",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "functools.partial",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "torch.nn.BatchNorm2d",
... |
70469846774 | import json
def create_person():
bob = {"First Name": "Robert", "Last Name": "Smith"}
return bob
def output_json(my_dict):
filename = "patient.json"
output_file = open(filename, 'w')
json.dump(my_dict, output_file)
output_file.close()
def alt_approach(my_dict):
filename = "patient.json... | cduncan9/Travis | json_work.py | json_work.py | py | 473 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "json.dump",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": 19,
"usage_type": "call"
}
] |
3027124735 | import threading
from typing import Optional
from pydantic import BaseModel
from prowler.lib.logger import logger
from prowler.lib.scan_filters.scan_filters import is_resource_filtered
from prowler.providers.aws.aws_provider import generate_regional_clients
################## RDS
class RDS:
def __init__(self, a... | gopikrishna72/prowl | prowler/providers/aws/services/rds/rds_service.py | rds_service.py | py | 10,264 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "prowler.providers.aws.aws_provider.generate_regional_clients",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "threading.Thread",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "prowler.lib.logger.logger.info",
"line_number": 42,
"usage_... |
37224486618 | #CH05_07. 딥러닝 모델 구성 및 결과 검증
import tensorflow as tf
import matplotlib.pyplot as plt
import numpy as np
mnist = tf.keras.datasets.mnist
(x_train, y_train), (x_test, y_test) = mnist.load_data()
print(len(x_train), len(y_train))
print(len(x_test), len(y_test))
x_train[0]
x_train[0].shape #x_train의 형태 출력
#정규화
x_train,... | badjiyoon/da_study | Sewon/part2/ch5/python_ch5_07.py | python_ch5_07.py | py | 1,811 | python | ko | code | 0 | github-code | 21 | [
{
"api_name": "tensorflow.keras",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot.imshow",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "matpl... |
28607391730 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Jul 9 10:23:54 2019
@author: sammirc
"""
import numpy as np
import scipy as sp
import pandas as pd
import mne
from copy import deepcopy
import os
import os.path as op
import sys
from matplotlib import pyplot as plt
#sys.path.insert(0, '/Users/sammi/De... | schekroud/wmconfidence_eeg | analysis_scripts/pyscripts/03_WMC_FbLock_CombineSessions.py | 03_WMC_FbLock_CombineSessions.py | py | 11,526 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "sys.path.insert",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "os.chdir",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number... |
39126228023 | """
canonical imports here
"""
# from market_sentiment.gcp import get_data_from_gcp
from gcp import get_data_from_gcp
from numpy.lib.ufunclike import fix
# from market_sentiment import auth1
import auth1
import pandas as pd
import matplotlib.pyplot as plt
from scipy import stats
# import seaborn as sns
import tensorfl... | ianndelap/market_sentiment | market_sentiment/app.py | app.py | py | 17,219 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "os.environ",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "gcp.get_data_from_gcp",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "pandas.to_datetime",
"line_number": 202,
"usage_type": "call"
},
{
"api_name": "re.sub",
... |
24862728897 | #!/usr/bin/env python
__author__ = 'Michael Meisinger, Stephen Henrie'
from unittest import SkipTest
from mock import Mock
from unittest import SkipTest
from nose.plugins.attrib import attr
from pyon.ion.resource import lcs_workflows, CommonResourceLifeCycleSM, LCS, LCE, ExtendedResourceContainer, OT, RT,PRED
from ... | seman/pyon | pyon/ion/test/test_resource.py | test_resource.py | py | 9,694 | python | en | code | null | github-code | 21 | [
{
"api_name": "pyon.util.unit_test.IonUnitTestCase",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "pyon.ion.resource.lcs_workflows",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "pyon.ion.resource.CommonResourceLifeCycleSM.BASE_STATES",
"line_number": ... |
17078692124 | global version
version = "v2.11.10.1"
global DEFAULT_SETTINGS
DEFAULT_SETTINGS = {
"screen_width": 1920,
"screen_height": 1080,
"display_mode": "windowed",
"window_width": 1280,
"window_height": 720,
"fps_limit": 60,
"font": "nirmalauisemilight",
"title_font": "verdana",
... | AlexJones0/Valor | config.py | config.py | py | 2,943 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "json.dumps",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "debug.Log",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "debug.Log",
"line_number": 56,
... |
32396813736 | from datetime import datetime, timedelta
import json, logging
import csv
import pandas as pd
import numpy as np
from sklearn.cluster import KMeans
from scipy.spatial.distance import cdist
from airflow.hooks import MySqlHook
from airflow.operators import PythonOperator, BranchPythonOperator
from airflow.models import D... | frankcash/airflow-learning | airflow_home/dags/sample_mysql.py | sample_mysql.py | py | 2,428 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "logging.getLogger",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "airflow.hooks.MySqlHook",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "csv.writer",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv"... |
11498122941 | # encoding=utf8
from action import Action
from io import open
import re
import pickle
from collections import OrderedDict
class ActionPickle(Action):
def run(self):
regex_string = unicode(self._config.params["pickle_report"]["regex_extract_list_word"])
self._regex_extract_list_word = re.compile(re... | tzewangdorje/citconc | concordance_parser/action_pickle.py | action_pickle.py | py | 1,713 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "action.Action",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "re.compile",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "re.UNICODE",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "io.open",
"line_number": ... |
34070375627 | # -*- coding: utf-8 -*-
"""
The :mod:`wsr.process.parse` provides methods to parse English language
sentences into structural representations, e.g., sentence diagrams.
Author: Michael J Bommarito II <michael@bommaritollc.com>
Date: 2014-05-25
"""
# Standard imports
import os
# WSR imports
from wsr.config import BASE... | mjbommar/wellsettled-research | src/wsr/process/parse.py | parse.py | py | 1,017 | python | en | code | 4 | github-code | 21 | [
{
"api_name": "os.environ",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "wsr.config.BASE_PATH",
"line_number": 20,
"usage_type": "argument"
},
{
"api_name": "os.path",
"... |
2920942190 | import asyncio
import threading
from container_interation.edit_order_db import mark_order_video_gfx
from container_interation.gather_orders import get_ready_to_video_gfx_order
from container_interation.post_result_to_storage_unit import store_result
from utils.cleanup_assets import cleanup_order
from video_gfx.process... | chemradio/cta-gfx-helper | video_gfx/video_gfx/order_processor.py | order_processor.py | py | 1,311 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "container_interation.gather_orders.get_ready_to_video_gfx_order",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "video_gfx.process_one_order.create_video_gfx",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "container_interation.post_result_to_... |
29492945286 | # MyProject App URLs
from django.conf.urls import url
from django.urls import path
from .views import *
urlpatterns = [
url(r'^users/createUser/', createUser),
url(r'^project/createProject/', createProject),
url(r'^users/assignProject/', assignProject),
path('project/assignMentor/', assignMentor),
... | shivangchopra11-CN/cn_django_assignment | teachdjango/firstapp/urls.py | urls.py | py | 498 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django.conf.urls.url",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.u... |
25236835177 | import numpy
from setuptools import Extension, setup
import sys
carmcmc = Extension(
name="carmcmc._carmcmc",
sources=["boost_python_wrapper.cpp", "carmcmc.cpp", "carpack.cpp", "kfilter.cpp",
"proposals.cpp", "samplers.cpp", "random.cpp", "steps.cpp"],
extra_compile_args=["-O3", "-fpermissive"... | brandonckelly/carma_pack | src/setup.py | setup.py | py | 747 | python | en | code | 36 | github-code | 21 | [
{
"api_name": "setuptools.Extension",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "numpy.get_include",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sys.version_info",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "setuptool... |
5759465246 | from injector import singleton, inject
from src.main.common.logging.AppLogger import AppLogger
from src.main.common.random.RandomIdGenerator import RandomIdGenerator
from src.main.resource.business.readenv.ResourceReadEnvCreateAbstractBusinessLogic import \
ResourceReadEnvCreateAbstractBusinessLogic
from src.main.... | VerebG/docker-init-python | src/main/resource/business/readenv/ResourceReadEnvCreateAbstractBusinessLogicImpl.py | ResourceReadEnvCreateAbstractBusinessLogicImpl.py | py | 2,279 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "src.main.resource.business.readenv.ResourceReadEnvCreateAbstractBusinessLogic.ResourceReadEnvCreateAbstractBusinessLogic",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "src.main.common.logging.AppLogger.AppLogger",
"line_number": 13,
"usage_type": "name"
},
... |
33741071122 | """Adds the meal.num_reviews and meal.avg_rating columns
Revision ID: 67ac17b315dc
Revises: e63d9d5e76a9
Create Date: 2017-09-06 07:18:22.318531
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '67ac17b315dc'
down_revision = 'e63d9d5e76a9'
branch_labels = None
d... | Rdbaker/Mealbound | migrations/versions/67ac17b315dc_.py | 67ac17b315dc_.py | py | 817 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "alembic.op.add_column",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Float",... |
73034972213 | """Functions to plot M/EEG data on topo (one axes per channel)."""
from __future__ import print_function
# Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Denis Engemann <denis.engemann@gmail.com>
# Martin Luessi <mluessi@nmr.mgh.harvard.edu>
# Eric Larson <larson.eri... | LiuFang816/SALSTM_py_data | python/mne-tools_mne-python/mne-python-master/mne/viz/topo.py | topo.py | py | 30,736 | python | en | code | 9 | github-code | 21 | [
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 91,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 91,
"usage_type": "name"
},
{
"api_name": "channels.layout.find_layout",
"line_number": 95,
"usage_type": "call"
},
{
"api_name":... |
43806852235 | import os
import time
import numpy as np
import random
import torch
def logging_file(file):
def write_log(s):
print(s, flush=True)
with open(file, 'a') as f:
f.write(s+'\n')
return write_log
def set_up_logging(config):
if not os.path.exists(config['log_path']):
os.mkd... | htfhxx/FinetuneZoo | utils/util.py | util.py | py | 1,505 | python | en | code | 6 | github-code | 21 | [
{
"api_name": "os.path.exists",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "os.mkdir",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "time.strftime",
"line_number... |
14450438212 | import os
from gensim import utils
from gensim.parsing.preprocessing import preprocess_string, strip_tags, \
strip_punctuation, strip_multiple_whitespaces, strip_numeric, \
remove_stopwords, strip_short
from nltk.stem import WordNetLemmatizer
class FileManager:
def __init__(self, path):
self.path = pa... | amahadi/DeCaf | src/Utils.py | Utils.py | py | 1,346 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "os.path.exists",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "os.mkdir",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_numbe... |
73888363572 | # Definition for a binary tree node.
# class TreeNode:
# def __init__(self, val=0, left=None, right=None):
# self.val = val
# self.left = left
# self.right = right
from collections import deque
class Solution:
def findBottomLeftValue(self, root: Optional[TreeNode]) -> int:
if no... | xiaofanc/leetcode | 0513-find-bottom-left-tree-value.py | 0513-find-bottom-left-tree-value.py | py | 2,160 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "collections.deque",
"line_number": 13,
"usage_type": "call"
}
] |
36051146277 | import os
import re
import sqlite3
from discord.ext import commands
import toml
from spacecat.helpers import constants
def new(guild):
# Check if server doesn't have a config file
if not os.path.exists('servers/' + str(guild.id) + '.toml'):
# Get default perms from global config
config = to... | mizarc/spacecat-discord-bot | spacecat/helpers/perms.py | perms.py | py | 5,629 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "os.path.exists",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "toml.load",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "spacecat.helpers.constants.DATA... |
32686002011 | #Task 3 - Histograms
#Transformatino Notes
#Code written by Laura Whelan on 05/10/2020
#==========================================
#This code opens an image which has poor contrast,
#and demonstrates this by displaying its histogram side by side.
#Histogram equalisation is used to improve the contrast of the im... | LauraWh/Task3_Histograms | TaskHistograms.py | TaskHistograms.py | py | 1,515 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "cv2.imread",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2GRAY",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot.sub... |
23128050030 | from twisted.internet.task import LoopingCall
from labrad.server import LabradServer, setting
__all__ = ["PollingServer"]
"""
Polling Server
"""
class PollingServer(LabradServer):
"""
Holds all the functionality needed to run polling loops on the server.
Also contains functionality for Signals.
"""
... | UCLALabRAD/LaSER-Project | UCLA_CS_labrad/servers/server_classes.py | server_classes.py | py | 3,644 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "labrad.server.LabradServer",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "twisted.internet.task.LoopingCall",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "labrad.server.setting",
"line_number": 75,
"usage_type": "call"
}
] |
7934322179 | import json
import time
import typing as t
import uuid
import requests
from flask import Blueprint
from flask import current_app as app
from flask import g, jsonify, request
from funcx_common.redis import FuncxRedisPubSub, default_redis_connection_factory
from funcx_common.response_errors import (
ContainerNotFoun... | funcx-faas/funcx-web-service | funcx_web_service/routes/funcx.py | funcx.py | py | 30,591 | python | en | code | 14 | github-code | 21 | [
{
"api_name": "flask.Blueprint",
"line_number": 59,
"usage_type": "call"
},
{
"api_name": "flask.g",
"line_number": 63,
"usage_type": "name"
},
{
"api_name": "flask.g.db_logger",
"line_number": 64,
"usage_type": "attribute"
},
{
"api_name": "flask.g",
"line_nu... |
35341336155 | import numpy as np
import matplotlib.pyplot as plt
eq1=np.loadtxt('convergencia.txt');
plt.figure(figsize=(15,10))
plt.plot(eq1[:,0], eq1[:,1], 'o-', label='Menor rms por iteração')
plt.xlabel('iterações', fontsize=16)
plt.ylabel('rms', fontsize=16)
plt.legend(loc='best', numpoints=1, fontsize=16)
plt.show()
| gean-lucas/ControledRandomSearch_Problema_Do_Dipolo | grafico_conv.py | grafico_conv.py | py | 319 | python | pt | code | 0 | github-code | 21 | [
{
"api_name": "numpy.loadtxt",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "matplotlib.pypl... |
18280247787 | # Importing all necessary libraries
import cv2
import os
# Read the video from specified path
vidcap = cv2.VideoCapture(r"C:\Users\Lenovo\Desktop\xxqg.mp4")
def getFrame(sec):
vidcap.set(cv2.CAP_PROP_POS_MSEC, sec * 1000)
hasFrames, image = vidcap.read()
if hasFrames:
cv2.imwrite("D:\\AI Projects... | Zheng-Lu/Computer-Vision-Project | VideoToImages.py | VideoToImages.py | py | 750 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "cv2.CAP_PROP_POS_MSEC",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "cv2.imwrite",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "cv2.destroyAll... |
26428900605 | # bfs문제
from collections import deque
import sys
input = sys.stdin.readline
def bfs():
q = deque([R])
visited[R] = 0
cnt = 0
sumV = 0
while q:
r = q.popleft()
cnt += 1
sumV += cnt * visited[r]
for i in G[r]:
if visited[i] == -1:
q.appen... | seho27060/aug-algo-study | 0825/24447_yong.py | 24447_yong.py | py | 614 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "sys.stdin",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "collections.deque",
"line_number": 8,
"usage_type": "call"
}
] |
29163699872 | import cv2
from tensorflow.keras.models import load_model
import numpy as np
from PIL import Image
# Load the cascade
face_cascade = cv2.CascadeClassifier('haarcascade_frontalface_alt2.xml')
model = load_model("test_video.h5")
# To capture video from webcam.
cap = cv2.VideoCapture(0,cv2.CAP_DSHOW)
def conv... | makhloufi200/mask_detetc | detect_mask.py | detect_mask.py | py | 1,664 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "cv2.CascadeClassifier",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "tensorflow.keras.models.load_model",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "cv2.VideoCapture",
"line_number": 10,
"usage_type": "call"
},
{
"api_name"... |
16178391993 | import re
import numpy as np
import torch
import torch.nn.functional as F
from transformers import BertTokenizer, BertForQuestionAnswering,RobertaTokenizer
from torch.utils.data import DataLoader, Dataset
from torch.nn.utils.rnn import pad_sequence
from sklearn.metrics import f1_score
#BERT-MRC模型的起始位置和结束位置的输入输出形式
#例如... | ZouWang-spider/Triple-MRC | Triplet/TaskAE/AspectExtraction.py | AspectExtraction.py | py | 13,268 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "torch.tensor",
"line_number": 179,
"usage_type": "call"
},
{
"api_name": "torch.long",
"line_number": 179,
"usage_type": "attribute"
},
{
"api_name": "torch.tensor",
"line_number": 180,
"usage_type": "call"
},
{
"api_name": "torch.long",
"line_n... |
31576807407 | import logging
import os
from pathlib import Path
import pytest
from snek5000.config import ensure_config_file
from snek5000.output.base import Output, missing_config_filter
xdg_config = Path(os.path.expandvars(os.getenv("XDG_CONFIG_HOME", "$HOME/.config")))
configfile_xdg_config = xdg_config / "snek5000.yml"
def ... | snek5000/snek5000 | tests/test_config.py | test_config.py | py | 2,407 | python | en | code | 20 | github-code | 21 | [
{
"api_name": "pathlib.Path",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path.expandvars",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "os.getenv",
"line_nu... |
25277629032 | # -*- coding: utf-8 -*-
"""
@Time : 2021/9/22 23:00
@Author : Zhi QIN
@File : bisenet_camera.py
@Software: PyCharm
@Brief : bisenet 调用摄像头
"""
import os
import sys
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
sys.path.append(os.path.join(BASE_DIR, '..'))
import argparse
import time
import cv2
import torch
... | JarvisQZ/BiSeNetv1 | bins/bisenet_camera.py | bisenet_camera.py | py | 2,363 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "os.path.dirname",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "sys.path.append",
"l... |
8667045809 | import re
import requests
import json
from difflib import SequenceMatcher
from elasticsearch import Elasticsearch, RequestsHttpConnection
from middleware.log import logger
from .config import ELASTIC_USER, ELASTIC_PASSWORD, EXTENSIVE_LOG
host = 'knowledge-elastic-1.newsai.org'
es = Elasticsearch(
hosts=[{'host':... | news-ai/sonet | middleware/esclient.py | esclient.py | py | 2,668 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "elasticsearch.Elasticsearch",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "config.ELASTIC_USER",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "config.ELASTIC_PASSWORD",
"line_number": 14,
"usage_type": "name"
},
{
"api_name"... |
21916086759 | import sqlite3 as sq
con=sq.connect('data.db')
c=con.cursor()
# c.execute(""" INSERT INTO data VALUES('kundan',19,'fgsv')
# """)
# many=[('a',18,'b'),
# ('c',18,'D'),
# ('e',18,'f')
# ]
# c.executemany("INSERT INTO data VALUES(?,?,?)",many)
# c.execute("delete from data where rowid=2")
# con.commit()
print(c.execute("... | kundan1911/Music-system | music system/filemanage.py | filemanage.py | py | 441 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "sqlite3.connect",
"line_number": 2,
"usage_type": "call"
}
] |
39715615006 | from typing import List
class Solution:
def plusOne(self, digits: List[int]) -> List[int]:
idx = len(digits) - 1
temp = 1
while idx >= 0:
updated_digit = (digits[idx] + temp) % 10
temp = (digits[idx] + temp) // 10
digits[idx] = updated_digit
... | dyaroshevych/leetcode | python/0066. Plus One.py | 0066. Plus One.py | py | 412 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "typing.List",
"line_number": 5,
"usage_type": "name"
}
] |
22568223546 | import matsim.Plans as Plans
from furbain import config
from furbain import tools
from furbain import databaseTools
import pandas as pd
from geoalchemy2 import Geometry
def importActivities():
plansDataframes = Plans.plan_reader_dataframe(experienced_plans_filepath=config.getExperiencedPlansPath(), plans_filepath... | gabRpt/matsim-output-postgreSQL-converter | src/converter/activities.py | activities.py | py | 3,305 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "matsim.Plans.plan_reader_dataframe",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "matsim.Plans",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "furbain.config.getExperiencedPlansPath",
"line_number": 10,
"usage_type": "call"
},
{... |
5096041221 | import argparse
import os
import mlflow
import mltable
import pandas as pd
from sklearn.model_selection import train_test_split
RANDOM_STATE = 0
def create_mltable(path: str, file_name: str) -> None:
"""Creates an MLTable definition at the provided file path.
path (str): The path where the MLTable file wil... | marvinbuss/enterprise-ml | code/ml/preprocess/main.py | main.py | py | 4,232 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "os.path.join",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "argparse.Namespace",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "mltable.load",
... |
74600130291 | # my second code for the number guessing game project
# I used two functions and one global variable
import random
from art import logo
def select_level():
"""Function to check level"""
level_confirm = True
while level_confirm:
level = input(f"Choose a difficulty level. 'easy' or 'hard': ")
... | lanrelawal2002/ANGELAYU-100DAYSPYTHON | day12/12-1-Num-guess-game2.py | 12-1-Num-guess-game2.py | py | 1,974 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "art.logo",
"line_number": 56,
"usage_type": "argument"
},
{
"api_name": "random.randint",
"line_number": 60,
"usage_type": "call"
}
] |
42748743247 | import pyaudio
import wave
import os
class RecordingFile(object):
"""
Write voice using PyAudio
"""
def __init__(self, fname, mode, channels, rate, frames_per_buffer):
self.fname = fname
self.mode = mode
self.channels = channels
self.rate = rate
self.frames_per... | hndr91/VoiceIdentification | VoiceRecorder.py | VoiceRecorder.py | py | 2,464 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pyaudio.PyAudio",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "wave.open",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "pyaudio.paInt16",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "pyaudio.paInt16",
... |
18932403315 | from django.shortcuts import render,redirect,HttpResponse
from django.views import View
from app01.models import UserGroup,UserInfo
from django.core.paginator import Paginator,Page,PageNotAnInteger,EmptyPage
def paging(request):
#django自带的分页
current_page = request.GET.get('page')
user_list=UserInfo.obje... | yhtfly/mysite | app01/paging.py | paging.py | py | 1,066 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "app01.models.UserInfo.objects.all",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "app01.models.UserInfo.objects",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "app01.models.UserInfo",
"line_number": 11,
"usage_type": "name"
},... |
6916272762 | import gdown
import pandas
from pulp import LpVariable, LpProblem, LpMinimize, lpSum, LpStatus
# url = "https://drive.google.com/uc?id=15BPH7-3GGWBfXPJQ3stkT6SHQECbT-pt"
# output = "shifts.csv"
# gdown.download(url, output, quiet=False)
#matrix to show which shift each time window is associated with.
data = pandas.re... | varniethan/TimeTracker | python_scripts/Optmisation/staff_sheduling.py | staff_sheduling.py | py | 2,043 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pandas.read_csv",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pulp.LpVariable.dicts",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "pulp.LpVariable",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "pulp.LpProblem"... |
4711573056 | import time
import os
import glob
import shutil
#import cProfile
#import pstats
import json
import math
import itertools
import colorsys
import random as rd
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.animation import FuncAnimation
from matplotlib.animation import PillowWriter
import sea... | jcanedo279/PenroseAutomata | src/DijkstraMultigrid.py | DijkstraMultigrid.py | py | 14,052 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "time.time",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "os.makedirs",
"line_number": 79,
"usage_type": "call"
},
{
"api_name": "math.factorial",
"line_number": 88,
"usage_type": "call"
},
{
"api_name": "Multigrid.Multigrid",
"line_... |
1650242769 | from fastapi import (
APIRouter,
Depends,
HTTPException,
status,
)
from sqlalchemy.orm import Session
from databases import database as database_dependencies
from structures import couriers as courier_structure
from schemas import couriers as courier_schema
router = APIRouter(
prefix="/couriers",... | Mkamal88/Couriers_framework | routers/couriers.py | couriers.py | py | 1,221 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "fastapi.APIRouter",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "schemas.couriers.CourierModelCreate",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "schemas.couriers",
"line_number": 26,
"usage_type": "name"
},
{
"api_n... |
42785910981 | from django.conf import settings
from common.utils import traverse_and_compare
class DeeplinkException(Exception):
pass
class DeeplinkMiddleware(object):
def __init__(self, get_response):
"""Configuration and initialization at server start."""
self.get_response = get_response
self._l... | integral0909/feedme_django_backend | common/middleware/deeplink.py | deeplink.py | py | 1,849 | python | en | code | 6 | github-code | 21 | [
{
"api_name": "django.conf.settings.DEEPLINKER",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "django.conf.settings",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "common.utils.traverse_and_compare",
"line_number": 43,
"usage_type": "call"
}... |
2502851802 | from django.shortcuts import render, redirect
from django.contrib.auth.models import User
from django.db.models import Sum, Count
from .models import *
from .db_manager import *
from product.models import ProductManager
from message.models import Comment
from .scripts import table_connection
from .forms import JoinTab... | sylrie/P13_eorders | command/views.py | views.py | py | 17,376 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django.shortcuts.render",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "message.models",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "message.models",
"line_number": 34,
"usage_type": "name"
},
{
"api_name": "django.shortcut... |
38319784683 |
import time
import multiprocessing as mp
import threading as td
# 多线程的劣势,一个时间片只能处理一个线程任务
# multiprocessing,多进程,利用cpu的多核去处理数据
# 将每个任务平均分配给相应的核去处理,
# 每个核有单独的运算空间,和运算能力
# 从而避免多线程的劣势
# Process不能返回结果,需用队列保持,多进程有自己queue
# Pool可以返回值,默认使用所有的核数,也可指定核数
# 如何看核被使用情况
# 共享内存,用作不同cpu/核之前的交流媒介
# lock,锁,协调不同进程对共享内存的有序使用,避免无序抢夺共享内... | xiaobingscuer/lxber-code | code/python/multiprocess_of_python/multiprocess-lock.py | multiprocess-lock.py | py | 1,146 | python | zh | code | 0 | github-code | 21 | [
{
"api_name": "time.sleep",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "multiprocessing.Lock",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "multiprocessing.Value",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "multiprocessing... |
4638297457 | import scrapy
import scrapy.crawler as crawler
from scrapy.utils.log import configure_logging
from multiprocessing import Process, Queue
from twisted.internet import reactor
class NewsSpider3Spider(scrapy.Spider):
name = 'news_spider3'
allowed_domains = ['theblock.co']
start_urls = ['https://www.theblock.c... | NiravJoshi33/news_crunch | news_scrapper/spiders/news_spider3.py | news_spider3.py | py | 2,105 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "scrapy.Spider",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "scrapy.crawler.CrawlerRunner",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "scrapy.crawler",
"line_number": 41,
"usage_type": "name"
},
{
"api_name": "twisted... |
15870438101 | from typing import List
metro_lines = {
"1": ("Сокольническая линия", "Красная"),
"2": ("Замоскворецкая линия", "Тёмно-зелёная"),
"3": ("Арбатско-Покровская линия", "Синяя"),
"4": ("Филёвская линия", "Голубая"),
"4A": ("Филёвская линия(м)", "Голубая"),
"5": ("Кольцевая линия", "Коричневая"),
... | ArtemTin/ConnectionsBot | main.py | main.py | py | 31,085 | python | ru | code | 0 | github-code | 21 | [
{
"api_name": "logging.basicConfig",
"line_number": 120,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 121,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 124,
"usage_type": "call"
},
{
"api_name": "telegram.R... |
22772752143 | from django.db import models
class ResourceTextAttribute(models.Model):
value = models.CharField(max_length=500, default='')
resource = models.ForeignKey('Resource',
on_delete=models.CASCADE,
related_name='text_attributes',
... | EliasBoulharts/squest | resource_tracker/models/resource_text_attribute.py | resource_text_attribute.py | py | 893 | python | en | code | null | github-code | 21 | [
{
"api_name": "django.db.models.Model",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "django.db.models.CharField",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "... |
25456931067 | from collections import deque
import sys
upDown = [-1, 1, 0, 0, 0]
leftRight = [0, 0, -1, 1, 0]
height, width = map(int, (sys.stdin.readline()).split())
board = [list(map(int, (sys.stdin.readline()).split())) for i in range(height)]
visitList = set()
result = 0
numBoard = [1]
numIdx = 1
for i in range(height):
... | jy940408/algorithm_python | PYTHONBreadthFirstSearch/모양만들기.py | 모양만들기.py | py | 1,948 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "sys.stdin.readline",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sys.stdin",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "sys.stdin.readline",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sys.stdin",
"li... |
27025817164 | from datetime import datetime
from datetime import date
from subgrounds.subgraph import SyntheticField, FieldPath
from subgrounds.subgrounds import Subgrounds
import math
import pandas as pd
import os as os
import duckdb as db
import seaborn as sns
import matplotlib.pyplot as plt
import streamlit as st
st.set_page_co... | EdgeCaser/Snapshotsurfer | Aletheia.py | Aletheia.py | py | 2,014 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "streamlit.set_page_config",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "streamlit.button",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "subgrounds.subgrounds.Subgrounds",
"line_number": 16,
"usage_type": "call"
},
{
"api_n... |
30614782887 | #!/usr/bin/env python3
import os
import argparse
import tensorflow as tf
import numpy as np
from tensorflow.contrib.learn.python.learn.datasets.mnist import read_data_sets
import model
argparser = argparse.ArgumentParser(description='MNIST Autocoder')
argparser.add_argument('--restore', metavar='<model name>',
... | IvySU/mnist-autocoder | train.py | train.py | py | 1,904 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
... |
71954812212 | import torch
import torch.nn as nn
import numpy as np
from mcs.nets.upper.am import AttentionModel as AMU
from mcs.nets.lower.am import AttentionModel as AML
from mcs.nets.lower.am import get_courier_mask
from mcs.nets.encoder import GraphAttentionEncoder
from config import arg_parser
MAX_NUM = 99999
class Courier... | SongTunes/SMORE | mcs/nets/DRL.py | DRL.py | py | 24,584 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "config.arg_parser",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "torch.device",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "torch.cuda.is_available",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
... |
72937537972 | import json
from inspect import signature
class Runtime:
def __init__(self, code_list):
if isinstance(code_list, str):
code_list = json.loads(code_list)
self.env = Environment(code_list)
self.breakpoints = set()
self.parser = Parser()
self._calls = []
se... | 0xCAF2/calcium-editor | script/calciumlang.py | calciumlang.py | py | 32,193 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "json.loads",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "inspect.signature",
"line_number": 464,
"usage_type": "call"
}
] |
39842927322 | import bpy
import math
import mathutils
import random
from .consts import fur_gen_operator_id
from .properties import PROPS1
class GenFurOperator(bpy.types.Operator):
bl_idname = fur_gen_operator_id
bl_label = 'Generate'
selectedObject:bpy.types.Object = None
PUFF: float = 0.1
LEN:float = 2.8
... | deep-ar/blender_fur_tools | gen_fur2_operator.py | gen_fur2_operator.py | py | 18,091 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "bpy.types",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "consts.fur_gen_operator_id",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "bpy.types",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "bpy.types",
... |
32707333880 | #!/usr/bin/env python3
from collections import defaultdict
import utils
def paths(
edges,
visit_small_twice_target,
current_node="start",
current_path=tuple(),
visited={"start": 2},
):
current_path += (current_node,)
if current_node == "end":
yield current_path
return
... | technocoreai/aoc2021 | aoc12.py | aoc12.py | py | 1,457 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "collections.defaultdict",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "utils.input",
"line_number": 51,
"usage_type": "call"
}
] |
19965479073 | ####################################################
# CS 31, Prof. Muldrow
# Name: Diego O Garcia
# Assignment: Chapter 7 HW
# Due Date: 5/2/2021
# ####################################################
# 11 Lo Shu Magic Square
# contains the numbers 1 - 9 exactly, the sum of each row, each column, and each diagonal ad... | diegogarciacs/python-basics | Ch7HW/Ch7HW.py | Ch7HW.py | py | 3,022 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "random.randint",
"line_number": 67,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 88,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 88,
"usage_type": "name"
},
{
"api_name": "matplotlib.... |
42101166102 | '''
Created on 2018年3月13日
@author: roykt_tsai
'''
import os
import word2vec
import word2vec.training.demo_domain as demo_domain
import math
from botocore.vendored.requests.compat import str
from django.template.defaultfilters import lower
def compute_accuracy(training_sentences, is_show):
total = 0
match_con... | roytsai/DomainDecision | word2vec/training/offset/training.py | training.py | py | 7,156 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "word2vec.training.demo_domain.domain_decision",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "word2vec.training.demo_domain",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "word2vec.training.demo_domain.topic_list_en",
"line_number": 25,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.