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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
469422111 | from argparse import ArgumentParser
from threading import Thread, current_thread
import logging
import time
from sloq import SlowQueue
def main(args=None):
prog = ArgumentParser()
prog.add_argument("-n", type=int, default=10, metavar="TASK_COUNT",
help="The number of tasks")
prog.ad... | duedil-ltd/python-sloq | demo_sloq.py | demo_sloq.py | py | 2,091 | python | en | code | 3 | github-code | 36 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "logging.S... |
5459057284 | import configparser
from constants.Constants import Constants as const
from .OptimizerParamsFactory import OptimizerParamsFactory
from model.OptimizerFactory import OptimizerFactory
class ConfigParams(object):
def __init__(self, file):
config = configparser.ConfigParser()
config.read_file(open(... | SlipknotTN/kaggle_dog_breed | keras/lib/config/ConfigParams.py | ConfigParams.py | py | 1,442 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "configparser.ConfigParser",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "constants.Constants.Constants.ConfigSection",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "constants.Constants.Constants",
"line_number": 16,
"usage_type... |
6724801910 | from RestrictedPython import compile_restricted_function, safe_builtins, limited_builtins, utility_builtins
someglobalvar = 123
myscript = """
import math
import tempfile
import io
#folgende befehle fuehren zu fehlern
#f = open("app.py", "rb")
#f = NamedTemporaryFile(delete=False)
def g(x):
#return x + 1 + someglo... | aleksProsk/HydroOpt2.0 | minimal-code-examples/minimal-embedded-script2.py | minimal-embedded-script2.py | py | 2,656 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "RestrictedPython.safe_builtins",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "RestrictedPython.compile_restricted_function",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "RestrictedPython.compile_restricted_function",
"line_number": 36,... |
33362276648 | import cv2
import base64
import json
import time
import os
import numpy
class Recognition:
"""
This class contain everything required to detect, learn or recognize a face
"""
db_path = "database/"
name_list_path = "database/"
def __init__(self, haar_cascade_file_path):
self.haar_casca... | farshid616/clinet-server_FaceRecognition | recognition.py | recognition.py | py | 5,116 | python | en | code | 3 | github-code | 36 | [
{
"api_name": "cv2.CascadeClassifier",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "cv2.VideoCapture",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
... |
5812334986 | import babel
import babel.numbers
import babel.plural
from typing import Any, Callable, Dict, List, TYPE_CHECKING, Tuple, Union, cast
from typing_extensions import Literal
from fluent.syntax import ast as FTL
from .builtins import BUILTINS
from .prepare import Compiler
from .resolver import CurrentEnvironment, Messag... | projectfluent/python-fluent | fluent.runtime/fluent/runtime/bundle.py | bundle.py | py | 4,408 | python | en | code | 185 | github-code | 36 | [
{
"api_name": "typing.TYPE_CHECKING",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "typing_extensions.Literal",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 36,
"usage_type": "name"
},
{
"api_name": "typing.Uni... |
10121862874 | class Standalone(object):
"""Common class for all standalone applications"""
def __init__(self, args, user_options):
# stores the arguments
self.args = args
self.user_options = user_options
if len(args) == 1:
# shows the help message if no arguments provided
... | cellnopt/cellnopt | cno/core/standalone.py | standalone.py | py | 1,405 | python | en | code | 10 | github-code | 36 | [
{
"api_name": "easydev.console.red",
"line_number": 34,
"usage_type": "call"
}
] |
4419557828 | import sys
import pygame
import random
pygame.init()
pygame.display.set_caption("who is the caption")
window = pygame.display.set_mode((500,500))
font = pygame.font.Font("思源黑体.otf",35)
wheel_pics = []
for i in range(25):
filename = './pics/' + str(i) + '.png'
pic = pygame.image.load(filename)
... | Julia1976/python-project | Game Handling/Chosing the name/新的作品-55-1.py | 新的作品-55-1.py | py | 1,389 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pygame.init",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_caption",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "pygame.displa... |
13735356077 |
import os
import sys
import numpy as np
import PIL
import torch
import torch.utils.data
import torchvision
import matplotlib.pyplot as plt
import pickle
class AkMinitImagenetDataset(torch.utils.data.Dataset):
def __init__(self, rootdir_dataset, str_trainortestorinducing):
#grab args ===
self.... | blindreviewgtdxjnsd/gpex_blindreview | PaperResults/MiniImagenet/loadminiimagenet.py | loadminiimagenet.py | py | 2,624 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "torch.utils",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "pickle.load",
"line_nu... |
4354535219 | from collections import OrderedDict
from datetime import date, datetime
from decimal import Decimal, ROUND_DOWN
from models import models
from peewee import fn
from playhouse.shortcuts import model_to_dict
from pytz import timezone
from time import time
import app_config
import copytext
import simplejson as json
impor... | nprapps/elections16 | app/utils.py | utils.py | py | 11,492 | python | en | code | 15 | github-code | 36 | [
{
"api_name": "decimal.Decimal",
"line_number": 112,
"usage_type": "call"
},
{
"api_name": "decimal.Decimal",
"line_number": 120,
"usage_type": "call"
},
{
"api_name": "decimal.ROUND_DOWN",
"line_number": 120,
"usage_type": "name"
},
{
"api_name": "datetime.dateti... |
32921124712 | # -*- coding: utf-8 -*-
# Define here the models for your scraped items
#
# See documentation in:
# http://doc.scrapy.org/en/latest/topics/items.html
import datetime
import re
import redis
import scrapy
from scrapy.loader import ItemLoader
from scrapy.loader.processors import TakeFirst, MapCompose, Join, Identity
f... | Umi101108/Spider | www.jobbole.com/ArticleSpider/ArticleSpider/items.py | items.py | py | 4,739 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "elasticsearch_dsl.connections.connections.create_connection",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "elasticsearch_dsl.connections.connections",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "models.es_type.ArticleType._doc_type",
... |
70562613224 | from collections import deque
from heapq import heappush, heappop
def solution(priorities, location):
priority_heap = []
queue = deque()
count = 0
for idx, priority in enumerate(priorities):
queue.append((priority, idx))
heappush(priority_heap,(-priority, priority))
while queue:
... | zsmalla/algorithm-jistudy-season1 | src/Programmers_HighScore_Kit/스택&큐/임지수/프린터_python_임지수.py | 프린터_python_임지수.py | py | 576 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "collections.deque",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "heapq.heappush",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "heapq.heappop",
"line_number": 15,
"usage_type": "call"
}
] |
20145792954 | import argparse
import inspect
def parse_funct_arguments(fn, args=None, free_arguments=None):
if free_arguments is None:
free_arguments = []
fn_parser = argparse.ArgumentParser()
sign = inspect.signature(fn)
for pname, pval in sign.parameters.items():
if pname not in free_arguments:
... | antonior92/narx-double-descent | util.py | util.py | py | 588 | python | en | code | 6 | github-code | 36 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "inspect.signature",
"line_number": 9,
"usage_type": "call"
}
] |
34046878888 | from pyspark.sql import SparkSession
from pyspark.sql.types import StringType,StructField,StructType,IntegerType
spark = SparkSession.builder.master("local[*]").appName("romeoJulietWordCount").getOrCreate()
sc = spark.sparkContext
inprdd = sc.textFile("D:/Spark_Scala/data/wordcount/romeojuliet.txt")
#convert to lower... | ZosBHAI/pysparkexamples | wordcount01.py | wordcount01.py | py | 940 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pyspark.sql.SparkSession.builder.master",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pyspark.sql.SparkSession.builder",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "pyspark.sql.SparkSession",
"line_number": 5,
"usage_type": "n... |
29861997533 | from dataclasses import dataclass
import aiohttp
import time
from datetime import datetime
import orjson
import aiofiles
import asyncio
import logging
_LOGGER = logging.getLogger(__name__)
from .const import JSON_CACHE_FILE
@dataclass
class InverterData:
serial_number: str
firmware_version: str|None
mod... | tmulkern/SolisWifiDataLogger | custom_components/solis_wifi_data_logger/solis_wifi_api.py | solis_wifi_api.py | py | 7,146 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "logging.getLogger",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "dataclasses.dataclass",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "datetime.datetime",
"line_number": 40,
"usage_type": "name"
},
{
"api_name": "dataclasses... |
34325207808 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
#Author: Read AUTHORS file.
#License: Read COPYING file.
import xml.etree.cElementTree as etree
from os import path
from pkg import pkg
from constants import const
from ..lib import eventHandler, listdir, getfile, ratioCalc
class pkgdir(object):
def __init__(... | pardus-anka/paso | src/engine/packages/packages.py | packages.py | py | 2,158 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "lib.eventHandler",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "lib.eventHandler",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "os.path.normpath",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "os.path",
"lin... |
33102651292 | from datetime import timedelta, datetime
import os
from airflow import DAG
from google.cloud import storage
from airflow.utils.dates import days_ago
from airflow.operators.dummy_operator import DummyOperator
from airflow.operators.bash import BashOperator
from airflow.decorators import task, dag
from airflow.operators... | Rohitjoshi07/FHVDataAnalysis | airflow/dags/spark-dataproc.py | spark-dataproc.py | py | 4,553 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "os.environ.get",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "airflow.providers.google.cloud.operators.dataproc.ClusterGenerator",
"line_number": 52,
"usage_type": "cal... |
33508499662 | import cv2 as cv
import numpy as np
# Load and Read input
cap = cv.VideoCapture('Test.mp4')
#Array to store orientation of each frame
orient_ation = []
count = 0
orient_ation.append(count)
while True:
#Read input for current frame
ret1,current_frame = cap.read()
#Print error message if the... | mightykim91/navigation_system | source_code/version_2AB.py | version_2AB.py | py | 3,430 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2GRAY",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "cv2.medianBlur",... |
38746128821 | from sqlalchemy import create_engine
from config import MYSQL_ROSPARK_DB
from db.rospark_db import Base, make_engine
try:
engine = make_engine(MYSQL_ROSPARK_DB)
Base.metadata.drop_all(bind=engine)
Base.metadata.create_all(bind=engine,
tables=[Base.metadata.tables["parkings"]])... | andxeg/LeadersOfDigital_2020_parking_system | src/recreate_db.py | recreate_db.py | py | 374 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "db.rospark_db.make_engine",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "config.MYSQL_ROSPARK_DB",
"line_number": 7,
"usage_type": "argument"
},
{
"api_name": "db.rospark_db.Base.metadata.drop_all",
"line_number": 8,
"usage_type": "call"
},
... |
2014711280 | # -*- coding:utf-8 -*-
import requests
import json
import os
import time
start = time.time()
respond = requests.get('http://pvp.qq.com/web201605/js/herolist.json')
respond = respond.read()
respond = respond.encode('utf-8')[3:].decode('utf-8')
json_hero = json.loads(respond)
x = 0
hero_dir = 'D:\img\\'
if not os.pat... | rinuandengfeng/python_study | 所有/爬虫.py | 爬虫.py | py | 1,158 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "time.time",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 1... |
37661910708 | import numpy as np
from math import pi
import time
from scipy.sparse.linalg import eigs, eigsh, spsolve, lobpcg
class Solution:
def __init__(self, stiffness_matrix, mass_matrix, **kwargs):
self.stiffness_matrix = stiffness_matrix.tocsc()
self.mass_matrix = mass_matrix.tocsc()
self.Kr = kw... | atbrandao/OpenPulse_f | pulse/engine/solution.py | solution.py | py | 8,010 | python | en | code | null | github-code | 36 | [
{
"api_name": "time.time",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "scipy.sparse.linalg.eigs",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "numpy.sqrt",
"line_n... |
27033338799 |
from __future__ import print_function
import argparse
from ast import literal_eval
import logging
from utils import metrics_manager
from utils import data_manager
try:
import ConfigParser
config = ConfigParser.ConfigParser()
except ImportError:
import configparser
config = configparser.ConfigParser()... | awslabs/deeplearning-benchmark | benchmark_runner.py | benchmark_runner.py | py | 2,670 | python | en | code | 119 | github-code | 36 | [
{
"api_name": "ConfigParser.ConfigParser",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "configparser.ConfigParser",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "utils.data_manager.getImagenetData",
"line_number": 27,
"usage_type": "call"
},
{... |
74483870822 | """
Implement the functions used when the user
chooses either platform (Chess.com or Lichess)
"""
from collections import OrderedDict
def calculate_percentages(moves_dict):
"""
Calculate the winning, losing and drawing percentages
of each position in moves_dict
"""
for move in moves_... | felaube/chess-games-explorer | helpers.py | helpers.py | py | 4,149 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "collections.OrderedDict",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "collections.OrderedDict",
"line_number": 54,
"usage_type": "call"
}
] |
39326157381 | import requests
import datetime
from datetimerange import DateTimeRange
import json
import math
import pytz
def get_hijri(timezone):
r = requests.get('http://api.aladhan.com/v1/gToH?date='+datetime.datetime.now(pytz.timezone(timezone)).strftime('%d-%m-%Y')).json()
return r['data']['hijri']['day'] +' '+ r['data... | RaihanStark/sakumuslim | engine.py | engine.py | py | 4,264 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "requests.get",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "pytz.timezone"... |
9663828561 | import os
import pickle
from tqdm import tqdm
import multiprocessing as mp
import itertools
import numpy as np
import functools
from termcolor import colored
import time
from numba import jit
SAVE_DIR = 'iterator_saves'
EXPENDABLE_MEMORY = 5 # in Gig
class Iterator:
def __init__(self, width, height, _print=Fals... | m1a9l9t7e/RoadGenerator | ip/iterative_construction.py | iterative_construction.py | py | 12,413 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "numpy.zeros",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "numpy.byte",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "tqdm.tqdm",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "multiprocessing.Pool",
"lin... |
24486995491 | """archive hails
Revision ID: da94441f919f
Revises: 51c630a38d3c
Create Date: 2022-03-16 13:46:13.409774
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = 'da94441f919f'
down_revision = '51c630a38d3c'
branch_labels = None... | openmaraude/APITaxi | APITaxi_models2/migrations/versions/20220316_13:46:13_da94441f919f_archive_hails.py | 20220316_13:46:13_da94441f919f_archive_hails.py | py | 1,462 | python | en | code | 24 | github-code | 36 | [
{
"api_name": "sqlalchemy.dialects.postgresql.ENUM",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.dialects.postgresql",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "alembic.op.create_table",
"line_number": 22,
"usage_type": "call"
},... |
5892047689 | from typing import Tuple
import numpy as np
import yaml
import os
def PIDController(
v_0: float, y_ref: float, y_hat: float, prev_e_y: float, prev_int_y: float, delta_t: float
) -> Tuple[float, float, float, float]:
"""
PID performing lateral control.
Args:
v_0: linear Duckiebot speed ... | bratjay01/bharath_duckiebot | modcon/packages/solution/pid_controller_homework.py | pid_controller_homework.py | py | 2,430 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "typing.Tuple",
"line_number": 9,
"usage_type": "name"
}
] |
32094159630 | from decimal import Decimal
import setoptconf as soc
GOOD_SIMPLE_VALUES = (
(soc.String, None, None),
(soc.String, 'foo', 'foo'),
(soc.String, '1', '1'),
(soc.String, 1, '1'),
(soc.String, 1.23, '1.23'),
(soc.String, Decimal('1.23'), '1.23'),
(soc.Integer, None, None),
(soc.Integer, ... | jayclassless/setoptconf | test/test_datatypes.py | test_datatypes.py | py | 4,436 | python | en | code | 3 | github-code | 36 | [
{
"api_name": "setoptconf.String",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "setoptconf.String",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "setoptconf.String",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "set... |
23083264879 | from django.shortcuts import render
from .forms import RegisterForm, LoginForm
from django.shortcuts import redirect
from django.contrib import messages
from django.contrib.auth import authenticate , login
# Create your views here.
def index(request):
return render(request,'acounts/index.html')
def register(req... | Shivam38391/django-asignment | acounts/views.py | views.py | py | 1,792 | python | en | code | 3 | github-code | 36 | [
{
"api_name": "django.shortcuts.render",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "forms.RegisterForm",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "django.contrib.messages.success",
"line_number": 19,
"usage_type": "call"
},
{
"api_nam... |
7112777830 | import scipy.integrate as integrate
import sympy as sp
x = sp.symbols('x')
n = sp.symbols('n')
f = (1/sp.pi) * x**3 * sp.sin(n*x)
lower = -sp.pi
upper = sp.pi
integral = sp.integrate(f,(x,lower,upper))
simplified_integral = sp.simplify(integral)
print(simplified_integral)
| ClarkieUK/Fourier-Series | testing.py | testing.py | py | 276 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "sympy.symbols",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "sympy.symbols",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sympy.pi",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "sympy.sin",
"line_number":... |
3006495445 | from pandas.io.parsers import read_csv
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import cm
def carga_csv(filename):
valores = read_csv(filename, header=None).to_numpy()
return valores.astype(float)
def h(x, theta):
return theta[0] + theta[... | jorgmo02/AA | P1/practica1.py | practica1.py | py | 5,108 | python | es | code | 0 | github-code | 36 | [
{
"api_name": "pandas.io.parsers.read_csv",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.sum",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "matplotlib... |
73720676264 | # -*- coding: utf-8 -*-
# @date:2022/12/12 9:55
# @Author:crab-pc
# @file: onlinelibrary_detail
import random
from urllib.parse import urljoin
import time
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
import logging
import os
import pandas as pd
from concurrent.futures import Thre... | yjsdl/contribute_link | contributuLink/spiders/onlinelibrary_detail.py | onlinelibrary_detail.py | py | 2,627 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "concurrent.futures.ThreadPoolExecutor",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "logging.basicConfig",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_n... |
34710160257 | import os
import shutil
import time
import unittest
from configparser import ConfigParser
from os import environ
from Bio import SeqIO
from installed_clients.WorkspaceClient import Workspace as workspaceService
from GenomeFileUtil.GenomeFileUtilImpl import GenomeFileUtil
from GenomeFileUtil.GenomeFileUtilServer impor... | kbaseapps/GenomeFileUtil | test/supplemental_genbank_tests/genbank_upload_parameter_test.py | genbank_upload_parameter_test.py | py | 8,715 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "unittest.TestCase",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "os.environ.get",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "GenomeFileUtil.Genom... |
74963734183 | # !/usr/bin/env python
# -*- coding:utf-8 -*-
"""
@FileName: weChatClient
@Author : sky
@Date : 2022/8/1 15:48
@Desc : 客户端
"""
import wx
import socket
import threading
# 客户端继承wx.frame,就拥有了窗口界面
class WeChatClient(wx.Frame):
def __init__(self, c_name):
# 调用父类的构造函数
wx.Frame.__init__(self, Non... | Bxiaoyu/NotesRep | Wechat/weChatClient.py | weChatClient.py | py | 3,819 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "wx.Frame",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "wx.Frame.__init__",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "wx.Frame",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "wx.DefaultPosition",
... |
22056037109 | import os
import re
import sys
import time
from setuptools import setup
HERE = os.path.dirname(__file__)
ROOT_DIR = os.path.abspath(os.path.join(HERE, os.pardir))
TEMP_PATH = "target"
in_src = os.path.isfile(os.path.join(ROOT_DIR, "pom.xml"))
if in_src:
pom_file = os.path.join(ROOT_DIR, 'pom.xml')
with open(... | piotrszul/sparktest | python/setup.py | setup.py | py | 1,848 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "os.path.dirname",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number"... |
21841926557 | # -*- coding: utf-8 -*-
"""
Created on Wed Dec 16 17:17:57 2015
Kepler problem and modified equations.
Apply the Stoermer-Verlet to the plannar Kepler problem
H(q, p) = 1/2p^Tp - 1/||q||, q, p belong to R^2.
Use the BCH formular (L + R 5.40) to compute the second-order correction of
the mod... | Rhys314/Simulating_Hamiltonian_Dynamics | Section5,5_Ex6.py | Section5,5_Ex6.py | py | 1,760 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "numpy.sqrt",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.int",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 24,... |
70677270824 | """
Filename: locate_nci_data.py
Author: Damien Irving, irving.damien@gmail.com
Description: Locate CMIP5 data at NCI
"""
# Import general Python modules
import sys, os, pdb
import argparse
from ARCCSSive import CMIP5
import six
import glob
# Define functions
def main(inargs):
"""Run the program.""... | DamienIrving/ocean-analysis | downloads/locate_nci_data.py | locate_nci_data.py | py | 3,321 | python | en | code | 9 | github-code | 36 | [
{
"api_name": "ARCCSSive.CMIP5.DB.connect",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "ARCCSSive.CMIP5.DB",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "ARCCSSive.CMIP5",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "gl... |
18937659990 | from django.db import models
from wagtail.admin.panels import FieldPanel
from wagtail.snippets.models import register_snippet
class SimpleTaxonomy(models.Model):
"""An abstract model for simple taxonomy terms."""
class Meta:
abstract = True
ordering = ['title']
title = models.CharField(
... | IATI/IATI-Standard-Website | taxonomies/models.py | models.py | py | 1,010 | python | en | code | 5 | github-code | 36 | [
{
"api_name": "django.db.models.Model",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "django.db.models.CharField",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": ... |
13300689829 | from art import logo
import os
bid = list()
def add_new_bidder(name: str, bid_price: int) ->dict[str, int]:
user_data = dict()
user_data["name"] = name
user_data["bid_price"] = bid_price
return user_data
def find_the_highest_bidder(bid: dict[str, int]) ->tuple[str, int]:
highest_bid = 0
... | robmik1974/secret-auction | main.py | main.py | py | 1,215 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "os.system",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "art.logo",
"line_number": 30,
"usage_type": "argument"
},
{
"api_name": "os.system",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "os.system",
"line_number": 41,
... |
14733803314 | # a plugin: CSV whitelist.
# here we create a 'document type' (or 'an instance of Doc') with one input (a csv file)
# NOTE: 'doc' is a magic variable that is used to build a Doc instance `Doc( **module.doc )`
# This eliminates any need for us to 'from doc import Doc', which is good.
from datetime import datet... | JeffKwasha/hachit | plugins/whitelist.py | whitelist.py | py | 1,667 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "utils.date_from_str",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.utcnow",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 36,
"usage_type": "name"
}
] |
29413120017 | import numpy as np
import cv2
cap = cv2.VideoCapture(0)
# Define the codes and create VideoWriter object
fourcc = cv2.VideoWriter_fourcc(*'XVID')
out = cv2.VideoWriter('output.avi', fourcc, 20.0, (640, 480))
while True:
ret, frame = cap.read()
gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
if ret == True:
... | land-pack/opencv-example | basic/simple_cap_save_video.py | simple_cap_save_video.py | py | 553 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "cv2.VideoWriter_fourcc",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "cv2.VideoWriter",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
... |
37977404672 | '''
Python module containing "Master" classes of easy_gui project.
The classes in here are designed to be subclassed in user applications.
'''
import tkinter as tk
from tkinter import ttk
from tkinter import _tkinter
from .styles import BaseStyle
from . import widgets
import os
import sys
import threading
import traceb... | zachbateman/easy_gui | easy_gui/master_classes.py | master_classes.py | py | 26,902 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "typing.List",
"line_number": 39,
"usage_type": "name"
},
{
"api_name": "typing.Dict",
"line_number": 39,
"usage_type": "name"
},
{
"api_name": "tkinter.Tk",
"line_number": 203,
"usage_type": "attribute"
},
{
"api_name": "styles.BaseStyle",
"line... |
9149914830 | #coding = 'utf-8'
'''
这是一个格栅布局的小例子!
文章链接:http://www.xdbcb8.com/archives/209.html
'''
import sys
from PyQt5.QtWidgets import (QWidget, QPushButton, QApplication, QGridLayout, QLCDNumber)
class Example(QWidget):
'''
格栅布局
'''
def __init__(self):
'''
一些初始设置
'''
super().__i... | redmorningcn/PyQT5Example | PyQt5All/PyQt56/QGrild layout.pyw | QGrild layout.pyw | pyw | 2,002 | python | zh | code | 1 | github-code | 36 | [
{
"api_name": "PyQt5.QtWidgets.QWidget",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtWidgets.QGridLayout",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtWidgets.QLCDNumber",
"line_number": 32,
"usage_type": "call"
},
{
"ap... |
33319841830 | import pygame as pg
from input_box import InputBox
pg.init()
screen = pg.display.set_mode((640, 480))
def main():
clock = pg.time.Clock()
input_box1 = InputBox(100, 100, 140, 32)
done = False
while not done:
for event in pg.event.get():
if event.type == pg.QUIT:
... | MrRamka/FlyGame | test_input_form.py | test_input_form.py | py | 575 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pygame.init",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "pygame.time.Cloc... |
495660367 | import os
import types
import pytest
import yaml
from dagster import (
DagsterEventType,
DagsterInvalidConfigError,
RunConfig,
check,
execute_pipeline,
pipeline,
seven,
solid,
)
from dagster.core.instance import DagsterInstance, InstanceRef, InstanceType
from dagster.core.storage.event... | helloworld/continuous-dagster | deploy/dagster_modules/dagster/dagster_tests/core_tests/storage_tests/test_local_instance.py | test_local_instance.py | py | 5,700 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "dagster.solid",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "dagster.pipeline",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "dagster.seven.TemporaryDirectory",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "dagst... |
5099519953 | import telepot
from flask import Flask, request
try:
from Queue import Queue
except ImportError:
from queue import Queue
TOKEN = "525915971:AAHCrRmA_e8BsKDVLFw6pB6XS_BjJsUEnqM"
CHANNEL = "@signorinaggio"
app = Flask(__name__)
update_queue = Queue()
bot = telepot.Bot(TOKEN)
firma = "@formaementisC... | IlPytone/delegator | app.py | app.py | py | 1,156 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "flask.Flask",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "queue.Queue",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "telepot.Bot",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "telepot.glance",
"line_number... |
24788878049 | import sys
from collections import defaultdict, deque
def main():
T = int(sys.stdin.readline().strip())
for _ in range(T):
F = int(sys.stdin.readline().strip())
graph = defaultdict(set)
ret = defaultdict(int)
# def dfs(start):
# visited = defaultdict(bool)
# ... | inhyeokJeon/AALGGO | Python/baekjoon/4195_friend.py | 4195_friend.py | py | 1,644 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "sys.stdin.readline",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sys.stdin",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "sys.stdin.readline",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sys.stdin",
"li... |
32793887647 | import os
import torch
import torch
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
dataset_path = os.path.dirname(__file__) + '/../data/dataset.txt'
teacher_forcing_ratio = 0.5
HIDDEN_SIZE = 512
def change_to_device(model):
if device.type == 'cpu':
model.cpu()
else:
... | junix/gen_poem | conf/__init__.py | __init__.py | py | 333 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "torch.device",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "torch.cuda.is_available",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
... |
7040650853 | import pytest
import math
from vec import Vector2
import numpy.testing as npt
from adr.World import Ambient
from adr.Components import FreeBody
from adr.Components.Auxiliary import LandingGear
@pytest.fixture
def plane():
env = Ambient()
plane = FreeBody(
name='plane',
type='plane',
m... | CeuAzul/ADR | tests/Components/Auxiliary/test_LandingGear.py | test_LandingGear.py | py | 2,830 | python | en | code | 12 | github-code | 36 | [
{
"api_name": "adr.World.Ambient",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "adr.Components.FreeBody",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "vec.Vector2",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pytest.fixture"... |
28147682147 | import os
import cv2 as cv
import numpy as np
import time
import json
import threading
from queue import Queue
import sys
picture_path='C:/Users/Administrator/Desktop/1/'
picture_number=0 #第几个图片
num=0 #成功了多少张图片
#魔方的颜色
greenLower = (46, 133, 46)
greenUpper = (85, 255, 255)
redLower = (150, 100, 6)
redUpper = (1... | xiaomoxiao/magic-cube | MultiThreading/code/getdata.py | getdata.py | py | 14,183 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "json.JSONEncoder",
"line_number": 50,
"usage_type": "attribute"
},
{
"api_name": "numpy.integer",
"line_number": 52,
"usage_type": "attribute"
},
{
"api_name": "numpy.floating",
"line_number": 54,
"usage_type": "attribute"
},
{
"api_name": "numpy.nd... |
13782113749 | from pydantic import BaseModel, validator
import datetime
class Room(BaseModel):
final_date: datetime.datetime = None
initial_date: datetime.datetime = None
size_m2: float = None
location: str = None
mensal_rent: float = None
weekly_rent: float = None
room_id: int = None
deposit_area: f... | JulioHey/Banco-de-Dados---EP | server/model/room.py | room.py | py | 4,807 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pydantic.BaseModel",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "datetime.datetime",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "datetime.datetime",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "datetim... |
14854743181 | import pyttsx3 #pip install pyttsx3
import speech_recognition as sr #pip install speechRecognition
from datetime import datetime
import wikipedia #pip install wikipedia
import webbrowser
import os
import smtplib
import psutil
from pygame import mixer
import json
import requests
import time
engine = pyttsx3.init('sapi5... | yash358/J.A.R.V.I.S | main.py | main.py | py | 5,838 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pyttsx3.init",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "speech_recogniti... |
16044252945 |
from pymysql import connect
import yaml
import logging.config
class DB():
def __init__(self):
"""连接数据库"""
logging.info('===================== init data =====================')
logging.info("connect db")
self.conn = connect(host='127.0.0.1', user='root', password='Zx123456', db='django_restful')
def clear(... | langlixiaobailongqaq/django_restful | api/test_project/mysql_action.py | mysql_action.py | py | 2,049 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "logging.config.info",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "logging.config",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "logging.config.info",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "logging.config... |
17386735173 | import numpy as np
import math
from skimage import io, util
import heapq
def randomPatch(texture, patchLength):
h, w, _ = texture.shape
i = np.random.randint(h - patchLength)
j = np.random.randint(w - patchLength)
return texture[i:i+patchLength, j:j+patchLength]
def L2OverlapDiff(patch, patchLength, ov... | QURATT/https---github.com-QURATT-DIPProject | image_quilting.py | image_quilting.py | py | 5,186 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "numpy.random.randint",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "numpy.random.randint",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.random... |
22546241259 | from PySide2.QtUiTools import QUiLoader #pip3 install PySide2
from PySide2.QtWidgets import QApplication, QTableWidgetItem
from PySide2.QtCore import QFile, QIODevice, QTimer
from PySide2.QtWidgets import QFileDialog, QMessageBox
import math
from PySide2.QtCore import QStringListModel
import sys
import os
from PySide2.... | romenskiy2012/recording_spark | Client/GUI_user.py | GUI_user.py | py | 12,345 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "os.path.dirname",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "os.path.realpath",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "recording_spark_api.use... |
10272333559 | from flask import Flask, g, render_template,\
request, redirect, url_for, flash, session
import hashlib
import os
import mysql.connector
import google.oauth2.credentials
import google_auth_oauthlib.flow
from google.auth.transport import requests
import requests, json
os.environ['OAUTHLIB_INSECURE_TRANSPORT'] = '... | FaelPressao/Projeto_Academia_Versao_Final | academia/main.py | main.py | py | 10,533 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "os.environ",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "flask.Flask",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "flask.request.path",
"line_number": 42,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
... |
43348915031 | """
Default tests for Env classes
"""
import pytest
import numpy as np
import tensorflow as tf
from sionna.ofdm import PilotPattern
from cebed.envs import OfdmEnv, EnvConfig
def mock_pilot_pattern(config):
"""Dummy pilot pattern where the pilots are set to one"""
shape = [
config.n_ues,
confi... | SAIC-MONTREAL/CeBed | tests/test_env.py | test_env.py | py | 5,096 | python | en | code | 7 | github-code | 36 | [
{
"api_name": "numpy.zeros",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "numpy.complex64",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "numpy.ones",
"line_n... |
73788737704 | import pathlib
import re
import shutil
import subprocess
import tarfile
import tempfile
import urllib.parse
import urllib.request
import zipfile
javaVersion = "11.0.12+7"
def createBinaryArchive(platform: str, arch: str) -> None:
print(f"Processing platform/arch '{platform}/{arch}'...")
lspCliVersion = getLspCl... | valentjn/lsp-cli | tools/createBinaryArchives.py | createBinaryArchives.py | py | 4,493 | python | en | code | 7 | github-code | 36 | [
{
"api_name": "pathlib.Path",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "tempfile.TemporaryDirectory",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
... |
8899583521 | from flask import redirect, render_template, request, url_for
from flask_login import login_required
from application import app, db, get_css_framework, ITEMS_PER_PAGE
from application.room.models import Room
from application.place.models import Place
from application.place.forms import PlaceForm
from application.plac... | Robustic/Orchestime | application/place/views.py | views.py | py | 2,867 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "flask.request.args.get",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "flask.request.args",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "flask.re... |
34493975789 | import logging
import os
from argparse import ArgumentParser
from typing import Dict, List, Tuple, Set
import pandas as pd
from tqdm import tqdm
from gebert.utils.io import save_node_id2terms_list, save_dict, save_tuples, read_mrconso, read_mrrel
def get_concept_list_groupby_cui(mrconso_df: pd.DataFrame, cui2node_i... | Andoree/GEBERT | gebert/data/umls2graph.py | umls2graph.py | py | 10,606 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "pandas.DataFrame",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "typing.Dict",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "logging.info",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "typing.Dict",
"lin... |
9454046228 | # coding: utf-8
import os
from mongoengine import connect
from fastapi import APIRouter
from app.database.documents import Article
from app.database.utils import query_to_dict
router = APIRouter(prefix="/api", tags=["Api"])
@router.get("/articles")
def articles(skip: int = 0, limit: int = 10):
"""List the articl... | nicolasjlln/lbc-challenge | app/routers/api.py | api.py | py | 1,626 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "fastapi.APIRouter",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "mongoengine.connect",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "app.database.doc... |
37854390965 | #!/usr/bin/env python3
'''
curve fit to histogram
'''
import collections
import numpy as np
from scipy.optimize import curve_fit
import matplotlib.axes as maxes
import matplotlib.patches as mpatches
from matplotlib.lines import Line2D as mline
from .markline import add_fcurve
__all__=['add_gauss_fit']
# gaus... | hujh08/datapy | plot/curvefit.py | curvefit.py | py | 5,360 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "numpy.exp",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.diff",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "numpy.asarray",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "numpy.sum",
"line_number": 45,... |
28091727369 | from flask import render_template, request, redirect, url_for, send_from_directory, jsonify, make_response, flash, Markup
import os
from werkzeug.utils import secure_filename
from web_scripts import *
@app.route('/')
def home():
return render_template('main.html')
@app.route('/upload-music', methods = ['GET', 'PO... | philipk19238/slowed-and-reverbed | app/routes.py | routes.py | py | 2,366 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "flask.render_template",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "flask.request.method",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "flask.re... |
31456650987 |
from nltk.corpus import movie_reviews
import re
from nltk.corpus import stopwords
from nltk.tokenize import word_tokenize
from nltk.stem import WordNetLemmatizer
from nltk import pos_tag
import string
clitics = open('clitics', 'r').readlines()
sents0 = movie_reviews.words("neg/cv000_29416.txt")
sents1 = movie_revi... | hassanMetwally/pre-processing | pre processing.py | pre processing.py | py | 2,678 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "nltk.corpus.movie_reviews.words",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "nltk.corpus.movie_reviews",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "nltk.corpus.movie_reviews.words",
"line_number": 15,
"usage_type": "call"
},
... |
34326375432 | import tensorflow as tf
# from tensorflow.keras import layers
from tensorflow import keras
from data import DataManager
import os
from utils import utils
# https://github.com/rlcode/reinforcement-learning-kr/blob/master/3-atari/1-breakout/breakout_a3c.py
# https://github.com/yinchuandong/A3C-keras/blob/master/a3c.py
#... | aoba0203/magi | train/agent/BaseModel.py | BaseModel.py | py | 6,290 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "tensorflow.keras.layers.Input",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "tensorflow.keras.layers",
"line_number": 39,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.keras",
"line_number": 39,
"usage_type": "name"
},
{
"api_n... |
13628425885 | from collections import Counter
import pandas as pd
import nltk
from src.tagger import Tagger
def get_counts(dataf):
with open(dataf, "r") as fh:
# Get counts
raw = fh.read()
# tokens = nltk.word_tokenize(raw)
tokens = raw.split()
unigrm = Counter(tokens)
bigrm = nl... | rgalhama/retro_adjs | src/analyses_TPs/tps.py | tps.py | py | 3,266 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "collections.Counter",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "nltk.bigrams",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "nltk.FreqDist",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "src.tagger.Tagger",
... |
151229982 | import sys
import uuid
import os
import shutil
from lxml import etree
import openpyxl
from zipfile import ZipFile
core = "docProps/core.xml"
def extractWorkbook(filename, outfile="xml"):
with ZipFile(filename, "r") as zip:
zip.extract(core, outfile)
def checkForCheaters(filename):
try:
parse... | suborofu/tulactf-2022-writeups | web/Cheaters/web/flask-serv/tester.py | tester.py | py | 1,878 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "zipfile.ZipFile",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "lxml.etree.XMLParser",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "lxml.etree",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "lxml.etree.parse",
... |
28318096244 | from sqlalchemy import create_engine, Column, String, Integer
from sqlalchemy.orm import sessionmaker
from sqlalchemy.ext.declarative import declarative_base
import pymysql
pymysql.install_as_MySQLdb()
# 构建连接引擎对象
engine = create_engine("mysql://root@localhost/py1709_torn_db1",
encoding="utf-8"... | laomu/py_1709 | 2.Tornado_cursor/days02数据模型/demo02sqlalchemy增删改.py | demo02sqlalchemy增删改.py | py | 2,838 | python | zh | code | 0 | github-code | 36 | [
{
"api_name": "pymysql.install_as_MySQLdb",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.create_engine",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.orm.sessionmaker",
"line_number": 14,
"usage_type": "call"
},
{
"ap... |
36378630131 | import unittest
import os
import opendatasets as od
import sqlite3
import pandas as pd
#Testing automated pipeline
class TestDownloadAndSaveDataset(unittest.TestCase):
def setUp(self):
# Set up necessary variables for testing
self.dataset_url = 'https://www.kaggle.com/datasets/thedevastator/jobs-da... | arpita739/made-template | project/test.py | test.py | py | 1,677 | python | en | code | null | github-code | 36 | [
{
"api_name": "unittest.TestCase",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "opendatasets.download",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.path",
... |
4454907121 | from flask_testing import TestCase
from config import create_app
from db import db
AUTHORISED_ENDPOINTS_DATA = (
("POST", "/new_resource/"),
("POST", "/tag_resource/"),
("POST", "/upload_file/1/"),
("PUT", "/resource_status/1/read/"),
("PUT", "/resource_status/1/dropped/"),
("PUT", "/resource_... | tedypav/FlaskCourse_OnlinePersonalLibrary | tests/test_application.py | test_application.py | py | 4,228 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "flask_testing.TestCase",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "config.create_app",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "db.db.init_app",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "db.db",
"... |
74147827945 | import re
import argparse
from os import listdir
def read_file(filename: str) -> str:
with open("./regex_labs/src/{}.txt".format(filename)) as f:
return f.read()
def creditcards(content):
"""All credit card numbers and respective brands"""
matches = re.findall(r"([0-9\s]+)\n?([a-zA-Z\s]+)\n?", c... | zepcp/code_labs | regex_labs/regex.py | regex.py | py | 1,669 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "re.findall",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "re.findall",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "re.findall",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "re.finditer",
"line_number": 38,... |
42778570533 | from typing import Any
import pytest
from pydantic import ValidationError
from toucan_connectors.toucan_connector import ToucanDataSource
class DataSource(ToucanDataSource):
collection: str # required, validated against type
query: Any # required, not validated
comment: str = None # not required, no ... | ToucanToco/toucan-connectors | tests/test_datasource.py | test_datasource.py | py | 3,757 | python | en | code | 16 | github-code | 36 | [
{
"api_name": "toucan_connectors.toucan_connector.ToucanDataSource",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "typing.Any",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "pytest.raises",
"line_number": 32,
"usage_type": "call"
},
{
"api_n... |
21131295808 | """Nautobot Golden Config plugin application level metrics ."""
from django.conf import settings
from django.db.models import Count, F, Q
from nautobot.dcim.models import Device
from prometheus_client.core import GaugeMetricFamily
from nautobot_golden_config.models import ComplianceFeature, ComplianceRule, ConfigCompl... | nautobot/nautobot-plugin-golden-config | nautobot_golden_config/metrics.py | metrics.py | py | 4,420 | python | en | code | 91 | github-code | 36 | [
{
"api_name": "django.conf.settings.PLUGINS_CONFIG.get",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.conf.settings.PLUGINS_CONFIG",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "django.conf.settings",
"line_number": 9,
"usage_type": "na... |
1762674415 | import logging
import itertools
from typing import Optional
import demoji
from .apple import scraper_apple
from .google import scraper_google
__all__ = ["scraper", "scraper_google", "scraper_apple"]
def content_filter(content: str) -> Optional[str]:
content = demoji.replace(content)
if len(content) < 20:
... | moriW/app_words | scraper/__init__.py | __init__.py | py | 1,099 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "demoji.replace",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "typing.Optional",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "itertools.product",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "logging.info",
"... |
5134072941 | import asyncio
from telethon.tl.functions.channels import EditAdminRequest
from telethon.tl.functions.contacts import BlockRequest, UnblockRequest
from telethon.tl.types import ChatAdminRights
from telethon.errors.rpcerrorlist import ChatSendMediaForbiddenError, PeerIdInvalidError
from . import *
@telebot.on(admin_... | ankitkumarbh/Telegram-Userbot | telebot/plugins/schd.py | schd.py | py | 1,538 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "asyncio.sleep",
"line_number": 34,
"usage_type": "call"
}
] |
7044056393 | # !/usr/bin/env python
import rospy
import websocket
import json
# from msg.ObjectArray import ObjectArray
from detection.msg._ObjectArray import ObjectArray
LABELS = ["human", "unknown", "animals"]
try:
import thread
except ImportError:
import _thread as thread
import time
def on_message(ws, message):
... | cds-mipt/animal_ir_detection | sender/scripts/sender.py | sender.py | py | 1,890 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "time.time",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "_thread.start_new_thread",
"line_... |
28511009690 | import tester # tester
import random
import pexpect
import time
import struct
import sys
import socket
import importlib.util
EASYDB_PATH = "/cad2/ece326f/tester/bin/easydb"
def load_module(modname):
path = tester.datapath(modname + ".py", 'asst3')
spec = importlib.util.spec_from_file_location(modname, path)
... | CoraZhang/Object-Oriented-Programming | tester/scripts/asst3.py | asst3.py | py | 6,122 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "tester.datapath",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "importlib.util.util.spec_from_file_location",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "importlib.util.util",
"line_number": 14,
"usage_type": "attribute"
},
{
... |
17218989395 | import torch
import torch.nn as nn
from modules.updown_cell import UpDownCell
from modules.captioner import Captioner
class UpDownCaptioner(Captioner):
def __init__(self, vocab, image_feature_size=2048, embedding_size=1000, hidden_size=512,
attention_projection_size=512, seq_length=20, beam_size... | Songtuan/Captioning-Model | modules/captioner/UpDownCaptioner.py | UpDownCaptioner.py | py | 1,641 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "modules.captioner.Captioner",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "modules.updown_cell.UpDownCell",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "torch.nn.Embedding.from_pretrained",
"line_number": 27,
"usage_type": "call"
... |
34588741728 | import os
from pathlib import Path
from pyontutils.utils import get_working_dir
from pyontutils.integration_test_helper import _TestScriptsBase as TestScripts
from .common import project_path, project_path_real, test_organization, onerror
from .common import fake_organization
import sparcur
import sparcur.cli
import sp... | SciCrunch/sparc-curation | test/test_integration.py | test_integration.py | py | 4,836 | python | en | code | 11 | github-code | 36 | [
{
"api_name": "common.fake_organization",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "sparcur.utils.log.warning",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "sparcur.utils.log",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "... |
31911094208 | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | TendTo/Telegram-SpottedDMI-Bot | docs/source/conf.py | conf.py | py | 4,898 | python | en | code | null | github-code | 36 | [
{
"api_name": "sys.path.insert",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_num... |
5972086108 | import random
import pygame
import copy
l = [[random.choice([0, 1]) for i in range(48)] for i in range(48)]
k = [[0 for i in range(48)] for i in range(48)]
pygame.init()
s = pygame.display.set_mode((480, 480), 0, 32)
o = True
def z(x, y):
m = 0
for i in (x - 1, x, x + 1):
for j in (y ... | Lil-Shawn/game-of-life | main.py | main.py | py | 1,240 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "random.choice",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pygame.init",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"... |
34105486078 | from pymongo import MongoClient
from wa_api import WA_API
# Collection Names
AC = "archers"
CC = "competitions"
QC = "qualifications"
QAC = "qualifications_arrows"
class MongoManage:
def __init__(self, host='localhost', port=27017, rs=None):
if rs:
self.client = MongoClient(host=host, port=po... | Tayum/di0d | courses/database_discipline/course3_term2/coursework/mongomanage.py | mongomanage.py | py | 7,237 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pymongo.MongoClient",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pymongo.MongoClient",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "wa_api.WA_API",
"line_number": 46,
"usage_type": "call"
}
] |
2266175166 | import dash_core_components as dcc
import dash_html_components as html
from dash_devices.dependencies import Input, Output, State
import numpy as np
import pandas as pd
import sys
import re
import num2words
from app import app
from apps import user_mode
sys.path.insert(1, 'C:\\Users\\Antoine\\CloudStation... | antoine-zurcher/master-project | prototype/apps/god_mode.py | god_mode.py | py | 37,217 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "sys.path.insert",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "pandas.read_json",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "dash_html_components.D... |
74879223784 | import pandas as pd
import streamlit as st
import numpy as np
from common import session_manager
ssm = session_manager.st_session()
# ssm.write_session_info()
st.title("表を描画する")
# データフレームを元に表を表示する
df = pd.DataFrame({
'first column': [1, 2, 3, 4],
'second column': [10, 20, 30, 40]
})
st.write("write関数")
st.write... | nishimu555/streamlit-lab | lab2/app/pages/02_write_and_table.py | 02_write_and_table.py | py | 1,107 | python | ja | code | 0 | github-code | 36 | [
{
"api_name": "common.session_manager.st_session",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "common.session_manager",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "streamlit.title",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": ... |
4079175993 | import os
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from deconstruct_lc import read_config
from deconstruct_lc import tools_fasta
from deconstruct_lc import tools_lc
from deconstruct_lc.scores.norm_score import NormScore
class RemovePfam(object):
def __init__(self):
config = r... | shellydeforte/deconstruct_lc | deconstruct_lc/remove_structure/remove_pfam.py | remove_pfam.py | py | 7,821 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "deconstruct_lc.read_config.read_config",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "deconstruct_lc.read_config",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "os.path.join",
"line_number": 14,
"usage_type": "call"
},
{
"ap... |
22277300373 | #!/usr/bin/env python
"""
https://www.codewars.com/kata/520b9d2ad5c005041100000f/python
"""
import ipdb
import pytest
"""
pig_it('Pig latin is cool') # igPay atinlay siay oolcay
pig_it('Hello world !') # elloHay orldway !
"""
# from codewars solution
def pig_it(text):
lst = text.split()
return ' '.join(... | romantix74/codewars | move_first_letter_word_end.py | move_first_letter_word_end.py | py | 1,144 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pytest.mark.parametrize",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "pytest.mark",
"line_number": 20,
"usage_type": "attribute"
}
] |
74612434345 | '''
概念:一种保存数据的格式
作用:可以保存本地的json文件,也可以将json串进行传输,通常将json称为轻量级的传输方式
json文件组成
{} 代表对象(字典)
[] 代表列表
: 代表键值对
, 分隔两个部分
'''
import json
jsonStr = '''{
"rate": "8.0",
"cover_x": 1400,
"title": "我是余欢水",
"url": "https:\/\/movie.douban.com\/subject\/33442331\/",
"playable": true,
"cover": "https://img3.doub... | hanyb-sudo/hanyb | 正则表达式与爬虫/3、爬虫/7、json数据解析.py | 7、json数据解析.py | py | 1,279 | python | zh | code | 0 | github-code | 36 | [
{
"api_name": "json.loads",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 50,
"usage_type": "call"
}
] |
23234426744 | from motor import Motor
import keyboard, time, sys
from threading import Thread
import tkinter as tk
'''
#PINOS DE COMUNICAÇÃO EM BINÁRIO
#[0,1,2,3, 4, 5, 6, 7] - BITS DA PLACA
#[1,2,4,8,16,32,64,128] - SINAL DE COMUNICAÇÃO CORRESPONDENTE
'''
mx = Motor(4, 8)
my = Motor(16, 32)
dx, dy = 2700, 270
... | eduardof-rabelo/IC | main.py | main.py | py | 642 | python | pt | code | 0 | github-code | 36 | [
{
"api_name": "motor.Motor",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "motor.Motor",
"line_number": 13,
"usage_type": "call"
}
] |
17310575825 | # MIT License
#
# Copyright (c) 2023 Andrey Zhdanov (rivitna)
# https://github.com/rivitna
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction, including
# without l... | rivitna/Malware | HsHarada/hsharada_extract_cfg.py | hsharada_extract_cfg.py | py | 3,594 | python | en | code | 218 | github-code | 36 | [
{
"api_name": "zlib.decompressobj",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "zlib.MAX_WBITS",
"line_number": 36,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 45,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"... |
12717941520 | # -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html
import json
# ---
# title: hello,hikyson
# tags: [Default]
# category: [Default]
# comments: true
# date: 2014-04-20 22:18:43
#... | Kyson/ScrapyForAndroidDashboard | ScrapyForAndroidDashboard/ScrapyForAndroidDashboard/pipelines.py | pipelines.py | py | 2,522 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "ScrapyForAndroidDashboard.git_pusher.post_title",
"line_number": 34,
"usage_type": "name"
},
{
"api_name": "ScrapyForAndroidDashboard.git_pusher.local_time_str",
"line_number": 38,
"usage_type": "name"
},
{
"api_name": "ScrapyForAndroidDashboard.git_pusher.local_ti... |
74772398185 | # https://cloud.google.com/pubsub/docs/create-topic#create_a_topic
# https://cloud.google.com/python/docs/reference/pubsub/latest
# %%
from google.cloud import pubsub_v1
# TODO(developer)
project_id = "podact-topic-extractor"
topic_id = "your-topic-id"
publisher = pubsub_v1.PublisherClient()
topic_path = publisher.... | lgarzia/topic_extractions | pub_sub_tutorials/create_and_manage_topic.py | create_and_manage_topic.py | py | 6,502 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "google.cloud.pubsub_v1.PublisherClient",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "google.cloud.pubsub_v1",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "google.cloud.pubsub_v1.PublisherClient",
"line_number": 20,
"usage_type": "... |
39303555840 | #!usr/bin/env python
# -*- coding:utf-8 -*-
"""
@author: admin
@file: MultiHeadedAttention.py
@time: 2021/09/02
@desc:
"""
import copy
import torch
import math
from torch import nn
import torch.nn.functional as F
def clones(module, N):
"""
克隆基本单元,克隆的单元之间参数不共享
"""
return nn.ModuleList([
copy.dee... | coinyue/Transformer | model/MultiHeadedAttention.py | MultiHeadedAttention.py | py | 2,463 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "torch.nn.ModuleList",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "copy.deepcopy",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "torch.matmul",
"line_n... |
2835263565 | import pandas as pd
import plotly.express as px
from ..sequence_info.sequences import group_2_coins
from ..utils import google_form_question_to_coin_sequence
DATA_FILENAME = "C:/Users/Crystal Wang/Downloads/9.660/9.660-final-project/data/data.csv"
def get_df():
df = pd.read_csv(DATA_FILENAME)
df = df.drop("T... | cwcrystal8/9.660-final-project | coins/data_cleaning/groups.py | groups.py | py | 3,884 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pandas.read_csv",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "plotly.express.line",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "plotly.express",
"line_number": 44,
"usage_type": "name"
},
{
"api_name": "utils.google_form_... |
26376325124 | #!/usr/bin/env python
# coding: utf-8
# In[12]:
# Question 1 c)
# Author: Ilyas Sharif
import numpy as np
import matplotlib.pyplot as plt
# Defining the parameters that didn't change (same as code for before)
v_f = 0.1
omega_0 = 1
tau = 1
gamma = 0.5
a = 0.0
b = 100.0
N = 10000
h = (b-a)/N
tpoints = np.arange(a, ... | SpencerKi/Computational-Methods | Differentiation and Differential Equations/Lab06_Q1_c.py | Lab06_Q1_c.py | py | 1,726 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "numpy.arange",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "numpy.log",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "numpy.exp",
"line_number": 43,... |
2808401161 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
__version__ = "0.1.2"
__author__ = "Abien Fred Agarap"
import argparse
from models.svm.svm import Svm
# Hyper-parameters
BATCH_SIZE = 256
LEARNING_RATE = 1e-5
N_CLASSES = 2
SEQUENCE_LENGTH = 21
def parse_ar... | AFAgarap/gru-svm | svm_main.py | svm_main.py | py | 3,519 | python | en | code | 136 | github-code | 36 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "models.svm.svm.Svm",
"line_number": 85,
"usage_type": "call"
},
{
"api_name": "models.svm.svm.Svm.predict",
"line_number": 116,
"usage_type": "call"
},
{
"api_name":... |
9924072616 | import os
import re
import sys
from lib.instruction import Instruction, AInstruction, CInstruction, LInstruction
from typing import Generator, Tuple
class Parser:
"""
Parse the Xxx.asm into stream of instructions.
- read source file
- understand the format of input file
- break each into differen... | mtx2d/nand2tetris | projects/06/src/lib/parser.py | parser.py | py | 2,398 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "lib.instruction.CInstruction",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "lib.instruction.CInstruction",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "lib.instruction.CInstruction",
"line_number": 44,
"usage_type": "call"
},
{... |
36307745878 | import cv2
import numpy
import torch
import torch.nn.functional as F
import numpy as np
import matplotlib.pyplot as plt
from sklearn.linear_model import LogisticRegression
from sklearn.model_selection import KFold
import os
import random
from tqdm import tqdm
from segment_anything import SamAutomaticMaskGenerator, sam_... | PeterYYZhang/few-shot-self-prompt-SAM | main.py | main.py | py | 13,776 | python | en | code | 44 | github-code | 36 | [
{
"api_name": "os.path.exists",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "os.listdir",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_numbe... |
74605435944 | from model.contact import Contact
from datetime import datetime
import re
import csv
class Phonebook:
"""
The Phonebook class allows users to create, update, delete, search, and perform various operations on contacts.
Attributes:
contacts (list): A list of Contact objects representing the phoneb... | Kartik-Nair/PhoneBook | phonebook.py | phonebook.py | py | 16,960 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "model.contact.Contact",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "datetime.datetime",
"line_number": 74,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 75,
"usage_type": "call"
},
{
"api_name": "model.conta... |
26540686747 | from random import randint
import xlrd
from datetime import datetime
import matplotlib.pyplot as plt
# this should be done with a database, so I should not put too much effort into making this program easy to use
PATH = "/home/yannick/git-repos/MyPython/math programs/investi.xls" # .xls only
DATA_RANGE = (15, 559) # ... | su595/MyPython | math programs/statistics.py | statistics.py | py | 4,798 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "random.randint",
"line_number": 102,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 103,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 103,
"usage_type": "name"
},
{
"api_name": "xlrd.open_w... |
32882450678 | #!/usr/bin/python3
import os, os.path
import json
import subprocess
from flask import Flask, request, redirect, abort
from time import sleep
app = Flask(__name__)
GITROOT = '/home/ubuntu/service/'
@app.route('/')
def index():
return redirect('https://github.com/TauWu/spider_monitor_api')
@app.route('/', methods... | TauWu/spider_monitor_api | extra/hook.py | hook.py | py | 732 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "flask.Flask",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "flask.redirect",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 2... |
30325551719 | # -*- coding: utf-8 -*-
import http.client
import csv
import json
conn = http.client.HTTPSConnection("empresa.app.invoicexpress.com")
# Lendo os dados do arquivo CSV com ponto e vírgula como separador
with open("itens2.csv", newline="") as csvfile:
reader = csv.reader(csvfile, delimiter=";") # Especific... | wesleyy598/Consumindo-API-Python | InvoiceXpress/Importar Invoice/Importar Preços de Portugal.py | Importar Preços de Portugal.py | py | 1,145 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "http.client.client.HTTPSConnection",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "http.client.client",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "http.client",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "c... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.