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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
26238944709 | # coding=utf-8
from __future__ import unicode_literals, absolute_import, print_function, division
import errno
import json
import os.path
import sys
from sopel.tools import Identifier
from sqlalchemy import create_engine, Column, ForeignKey, Integer, String
from sqlalchemy.engine.url import URL
from sqlalchemy.exc i... | examknow/Exambot-Source | sopel/db.py | db.py | py | 19,385 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "sys.version_info",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "json.loads",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.ext.declarative.declarative_base",
"line_number": 37,
"usage_type": "call"
},
{
"api_... |
22916095420 | #Create a gspread class and extract the data from the sheets
#requires:
# 1. Google API credentials json_key file path
# 2. scope e.g. ['https://spreadsheets.google.com/feeds','https://www.googleapis.com/auth/drive']
# 3. gspread_url e.g. 'https://docs.google.com/spreadsheets/d/1itaohdPiAeniCXNlntNztZ_oRvjh0HsGuJXUJWET... | yenlow/utils | apis/google.py | google.py | py | 2,442 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "oauth2client.service_account.ServiceAccountCredentials.from_json_keyfile_name",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "oauth2client.service_account.ServiceAccountCredentials",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "gspread.auth... |
35970918283 | from __future__ import annotations
__all__: list[str] = []
import argparse
import subprocess
import sys
import cmn
class _LintReturnCodes(cmn.ReturnCodes):
"""Return codes that can be received from pylint."""
SUCCESS = 0
# Error code 1 means a fatal error was hit
ERROR = 2
WARNING = 4
ERRO... | kiransingh99/gurbani_analysis | tools/lint.py | lint.py | py | 2,043 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "cmn.ReturnCodes",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "argparse.Namespace",
"line_number": 37,
"usage_type": "attribute"
},
{
"api_name": "cmn.get_python_files",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "cmn... |
7640577991 | test = 2+3 # 答案存在指定test物件
test # 最後一行打指定物件名稱
import random
x=[random.randint(0,100) for i in range(0,12)]
x
x0_str=str(x[0])
x0_str
x_str=[str(x[i]) for i in range(0,len(x))]
x_str
x6_logi=x[6]<50
x6_logi
x_logi=[x[i]<50 for i in range(0,len(x))]
x_logi
num_false=x_logi.count(False)
num_false
import pandas as pd
df_bus... | godgodgod11101/course_mathEcon_practice_1081 | hw1_ans.py | hw1_ans.py | py | 2,367 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "random.randint",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 27,
"usage_type": "call"
}
] |
43247812084 | import subprocess
import os
import shutil
import pytest
TEMP_DIRECTORY = os.path.join(os.path.dirname(__file__), '..', 'tmp')
TEMP_HEADER = os.path.join(TEMP_DIRECTORY, 'header.h')
TEMP_SOURCE = os.path.join(TEMP_DIRECTORY, 'source.c')
def set_up():
os.mkdir(TEMP_DIRECTORY)
def tear_down():
shutil.rmtree(... | BjoernLange/C-Mock-Generator | tests/generate_mock_integration_test.py | generate_mock_integration_test.py | py | 1,290 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.path.join",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_numbe... |
28838106101 | import numpy as np
try:
from math import prod
except:
from functools import reduce
def prod(iterable):
return reduce(operator.mul, iterable, 1)
import zipfile
import pickle
import sys
import ast
import re
from fickling.pickle import Pickled
if sys.version_info >= (3, 9):
from ast import unparse
else:
... | divamgupta/diffusionbee-stable-diffusion-ui | backends/model_converter/fake_torch.py | fake_torch.py | py | 15,028 | python | en | code | 11,138 | github-code | 6 | [
{
"api_name": "functools.reduce",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sys.version_info",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "math.prod",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"li... |
71409709627 | ###############################
####### SETUP (OVERALL) #######
###############################
## Import statements
# Import statements
import os
from flask import Flask, render_template, session, redirect, url_for, flash, request
from flask_wtf import FlaskForm
from wtforms import StringField, SubmitField, RadioFiel... | katmazan/SI364midtermKatmazan | SI364midterm.py | SI364midterm.py | py | 6,662 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "flask_sqlalchemy.SQLAlchemy",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "flask_wtf.FlaskForm",
"line_number": 67,
"usage_type": "name"
},
{
"api_name": "wtforms.S... |
36273427497 | from collections import namedtuple
import itertools
import torch
import numpy as np
from sklearn.feature_extraction.text import TfidfVectorizer
import torch.nn.functional as F
import data_utils
import train_utils
from models import BinaryClassifier, LSTM, CNN
import part2_train_utils
import helpers
#################... | timt51/question_retrieval | part2.py | part2.py | py | 5,017 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "collections.namedtuple",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "data_utils.download_ask_ubuntu_dataset",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "data_utils.load_part2_embeddings",
"line_number": 26,
"usage_type": "call"
... |
3084393112 | import numpy as np
import pandas as pd
import math
import json
import matplotlib as mpl
import matplotlib.pyplot as plt
import seaborn as sns
import warnings
warnings.filterwarnings('ignore')
import optuna
def create_data(f1, f2, A1, A2, sigma=0.02):
outs = []
ts = 1000
theta1 = 1.4
theta2 = 1.0
... | ksk-S/DynamicChangeBlindness | workspace_models/mcmc_model/test_ekf.py | test_ekf.py | py | 3,468 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.random.normal",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "numpy.r... |
29433457016 | #! /usr/bin/env python
#
# Implementation of elliptic curves, for cryptographic applications.
#
# This module doesn't provide any way to choose a random elliptic
# curve, nor to verify that an elliptic curve was chosen randomly,
# because one can simply use NIST's standard curves.
#
# Notes from X9.62-1998 (draft):
# ... | espressif/ESP8266_RTOS_SDK | components/esptool_py/esptool/ecdsa/ellipticcurve.py | ellipticcurve.py | py | 8,609 | python | en | code | 3,148 | github-code | 6 | [
{
"api_name": "six.print_",
"line_number": 192,
"usage_type": "call"
},
{
"api_name": "six.print_",
"line_number": 196,
"usage_type": "call"
},
{
"api_name": "six.print_",
"line_number": 202,
"usage_type": "call"
},
{
"api_name": "six.print_",
"line_number": 2... |
74750167547 | import torch
from transformers import T5ForConditionalGeneration, T5Tokenizer
import re
def title_generation(data):
print("[!] Server logs: Title generation has started")
text = data["content"]
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
model = T5ForConditionalGeneration.fro... | SVijayB/Gist | scripts/title_generation.py | title_generation.py | py | 1,106 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "torch.device",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "torch.cuda.is_available",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "transformers.T5ForC... |
40696675203 | import re
from typing import NamedTuple, Optional
from magma.magmad.check import subprocess_workflow
class LscpuCommandParams(NamedTuple):
pass
class LscpuCommandResult(NamedTuple):
error: Optional[str]
core_count: Optional[int]
threads_per_core: Optional[int]
architecture: Optional[str]
mo... | magma/magma | orc8r/gateway/python/magma/magmad/check/machine_check/cpu_info.py | cpu_info.py | py | 2,341 | python | en | code | 1,605 | github-code | 6 | [
{
"api_name": "typing.NamedTuple",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "typing.NamedTuple",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
... |
36703905624 | import soundfile as sf
import numpy as np
import time
import matplotlib.pyplot as plt
from parameterization import STFT, iSTFT, optimal_synth_window, first_larger_square
DEF_PARAMS = {
"win_len": 25,
"win_ovlap": 0.75,
"blocks": 800,
"max_h_type": "lin-lin",
"min_gain_dry": 0,
"bias": 1.01,
... | Revzik/AGH-ZTPS_Acoustical-Environment-Classification | deverb.py | deverb.py | py | 10,820 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.logspace",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "numpy.ones",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "numpy.finfo",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "numpy.float32",
"line_numbe... |
74197689149 | import workAssyncFile
from sora.prediction import prediction
from sora.prediction.occmap import plot_occ_map as occmap
import json
import datetime
import restApi
import os
def __clearName(name):
name = "".join(x for x in name if x.isalnum() or x==' ' or x=='-' or x=='_')
name = name.replace(' ', '_'... | linea-it/tno | container-SORA/src/main.py | main.py | py | 2,969 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "os.path.join",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "json.loads",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number"... |
11315559084 | #coding:utf-8
import sys
sys.path.insert(0, "./")
import os
os.environ["KMP_DUPLICATE_LIB_OK"]="TRUE"
from flask import Flask
from flask import render_template, redirect, url_for
from flask import request, session, json
from flask import jsonify
from keywords.keywordExtract import getKeywords
from parser.analysis_doc i... | nlp520/policy_web | app.py | app.py | py | 8,806 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sys.path.insert",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "flask.Flask",
"line_nu... |
16413423811 | from datetime import datetime, date, time
import time
from collections import OrderedDict
def parametrized_decor(parameter):
def decor(foo):
def new_foo(*args, **kwargs):
print(datetime.now())
print(f'Имя функции - {foo.__name__}')
if args is not None:
print(f'Позиционные аргументы arg... | Smelkovaalla/4.5-Decorator | main.py | main.py | py | 1,414 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "datetime.datetime.now",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 9,
"usage_type": "name"
}
] |
6606964316 | import sys
from collections import deque
MOVES = [(-1, 0), (0, 1), (1, 0), (0, -1)]
input = sys.stdin.readline
def isrange(x: int, y: int) -> bool:
return 0 <= x < n and 0 <= y < n
def get_lands(x: int, y: int, island: int) -> set[tuple[int, int]]:
lands: set[tuple[int, int]] = set()
que: deque[tuple[... | JeongGod/Algo-study | seonghoon/week06(22.02.01~22.02.07)/b2146.py | b2146.py | py | 2,298 | python | en | code | 7 | github-code | 6 | [
{
"api_name": "sys.stdin",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "collections.deque",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "collections.deque",
"line_number": 44,
"usage_type": "name"
},
{
"api_name": "sys.maxsize",
"... |
28912342142 | import transformers
import torch.nn as nn
import config
import torch
class BERT_wmm(nn.Module):
def __init__(self, keep_tokens):
super(BERT_wmm,self).__init__()
self.bert=transformers.BertModel.from_pretrained(config.BERT_PATH)
self.fc=nn.Linear(768,768)
self.layer_no... | Zibo-Zhao/Semantic-Matching | model.py | model.py | py | 1,326 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "torch.nn.Module",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "transformers.BertModel.from_pretrained",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "tra... |
73817307386 | #
# test_ab.py - generic tests for analysis programs
# repagh <rene.vanpaassen@gmail.com, May 2020
import pytest
from slycot import analysis
from slycot.exceptions import SlycotArithmeticError, SlycotResultWarning
from .test_exceptions import assert_docstring_parse
@pytest.mark.parametrize(
'fun, ... | python-control/Slycot | slycot/tests/test_analysis.py | test_analysis.py | py | 2,436 | python | en | code | 115 | github-code | 6 | [
{
"api_name": "test_exceptions.assert_docstring_parse",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "pytest.mark.parametrize",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pytest.mark",
"line_number": 13,
"usage_type": "attribute"
},
{
"a... |
5654287369 | from django.shortcuts import render
from django.http import Http404, HttpResponse, JsonResponse
from django.template import loader
from catalog.models import *
from django.forms.models import model_to_dict
import random
from django.views.decorators.csrf import csrf_exempt
from django.middleware.csrf import get_token
im... | jng27/Agile | psb_project/locallibrary/catalog/views.py | views.py | py | 2,686 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.template.loader.get_template",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "django.template.loader",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "random.shuffle",
"line_number": 22,
"usage_type": "call"
},
{
"api_nam... |
10423490633 | from __future__ import annotations
import pytest
from randovania.lib import migration_lib
def test_migrate_to_version_missing_migration() -> None:
data = {
"schema_version": 1,
}
with pytest.raises(
migration_lib.UnsupportedVersion,
match=(
"Requested a migration fro... | randovania/randovania | test/lib/test_migration_lib.py | test_migration_lib.py | py | 899 | python | en | code | 165 | github-code | 6 | [
{
"api_name": "pytest.raises",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "randovania.lib.migration_lib.UnsupportedVersion",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "randovania.lib.migration_lib",
"line_number": 14,
"usage_type": "name"... |
33800228048 | # BFS
from collections import deque
import sys
input = lambda: sys.stdin.readline()
def bfs(i, c): # 정점, 색상
q = deque([i])
visited[i] = True
color[i] = c
while q:
i = q.popleft()
for j in arr[i]:
if not visited[j]:
visited[j] = True
q.append(... | devAon/Algorithm | BOJ-Python/boj-1707_이분그래프.py | boj-1707_이분그래프.py | py | 2,065 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sys.stdin.readline",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "sys.stdin",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "collections.deque",
"line_number": 7,
"usage_type": "call"
}
] |
23423087794 | import logging
from ab.base import NavTable
from ab.base import Link, Data, Item
class Console (object):
def __init__ (self):
self._indent = 0
self._nt = NavTable()
self.logger = logging.getLogger ('ab')
self.log = lambda msg, level=logging.INFO: self.logger.info (msg)
def r... | oftl/ab | ui.py | ui.py | py | 2,324 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "ab.base.NavTable",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "ab.base.NavTable... |
36559608646 | import scipy as sci
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import animation
import scipy.integrate
#Definitionen
G=6.67408e-11
m_nd=1.989e+30 #Masse der Sonne
r_nd=5.326e+12
v_nd=30000
t_nd=79.91*365*24*3600*0.51
K1=G*t_nd*m_nd/(r_nd**2*v... | Gauner3000/Facharbeit | Euler_Planetenbewegung_3D.py | Euler_Planetenbewegung_3D.py | py | 3,103 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.array",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": ... |
44407906870 | import wx
import ResizableRuneTag
'''
Created on 23/lug/2011
@author: Marco
'''
class DrawableFrame(wx.Window):
'''
Allows user to put resizable rune tags in a A4 like white frame
Configuration realized on that frame is then replicated proportionally at export time
'''
def __init__(self, parent, ... | mziccard/RuneTagDrawer | DrawableFrame.py | DrawableFrame.py | py | 2,831 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "wx.Window",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "wx.Window.__init__",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "wx.Window",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "wx.Colour",
"line... |
36008540577 | import sqlite3
import os
import shlex
class Database():
def __init__(self, db_file):
"""Connect to the SQLite DB"""
try:
self.conn = sqlite3.connect(db_file)
self.cursor = self.conn.cursor()
except BaseException as err:
#print(str(err))
self.c... | echeadle/File_Track | app/sqlite_db.py | sqlite_db.py | py | 3,901 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sqlite3.connect",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.remove",
"line_number": 101,
"usage_type": "call"
}
] |
39259262942 | #!/usr/bin/env python3
import rclpy
from rclpy.node import Node
import speech_recognition as sr
from custom_if.srv import SendSentence
from functools import partial
import time
### Node class
class SpeechToText(Node):
def __init__(self):
super().__init__("stt_node")
self.get_logger().info("STT node is up.")
s... | Alessandro-Scarciglia/VoiceAssistant | speech_to_text/speech_to_text/speech_to_text.py | speech_to_text.py | py | 1,732 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "rclpy.node.Node",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "speech_recognition.Recognizer",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "speech_recognition.Microphone",
"line_number": 29,
"usage_type": "call"
},
{
"api_n... |
7920943241 | """
Neural Networks - Deep Learning
Heart Disease Predictor ( Binary Classification )
Author: Dimitrios Spanos Email: dimitrioss@ece.auth.gr
"""
import numpy as np
from cvxopt import matrix, solvers
# ------------
# Kernels
# ------------
def poly(x, z, d=3, coef=1, g=1):
return (g * np.dot(x, z.T)... | DimitriosSpanos/SVM-from-Scratch | SVM.py | SVM.py | py | 2,908 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.dot",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.exp",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.linalg.norm",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.linalg",
"line_number... |
42710543766 | '''
@ Carlos Suarez 2020
'''
import requests
import datetime
import time
import json
from cachetools import TTLCache
import ssl
import sys
class MoodleControlador():
def __init__(self,domain,token,cert):
self.domain = domain
self.token = token
self.cert = cert
#Moodle LTI
def ... | sfc-gh-csuarez/PyCollab | controladores/MoodleControlador.py | MoodleControlador.py | py | 6,010 | python | en | code | 15 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": ... |
18680754942 |
import matplotlib.pyplot as plt
import numpy as np
import os
import PIL
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers
from tensorflow.keras.models import Sequential
import pathlib
data_dir = "./Covid(CNN)/Veriseti"
data_dir = pathlib.Path(data_dir)
image_count = len(list... | elifyelizcelebi/Covid-CNN | model.py | model.py | py | 7,465 | python | tr | code | 0 | github-code | 6 | [
{
"api_name": "pathlib.Path",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "tensorflow.keras.preprocessing.image_dataset_from_directory",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "tensorflow.keras",
"line_number": 34,
"usage_type": "attribute"
... |
6425852046 | # 한자리 숫자가 적힌 종이 조각이 흩어져있습니다. 흩어진 종이 조각을 붙여 소수를 몇 개 만들 수 있는지 알아내려 합니다.
# 각 종이 조각에 적힌 숫자가 적힌 문자열 numbers가 주어졌을 때,
# 종이 조각으로 만들 수 있는 소수가 몇 개인지 return 하도록 solution 함수를 완성해주세요.
# 제한사항
# numbers는 길이 1 이상 7 이하인 문자열입니다.
# numbers는 0~9까지 숫자만으로 이루어져 있습니다.
# 013은 0, 1, 3 숫자가 적힌 종이 조각이 흩어져있다는 의미입니다.
def find_prime(n... | script-brew/2019_KCC_Summer_Study | programmers/Lv_2/MaengSanha/findPrime.py | findPrime.py | py | 1,326 | python | ko | code | 0 | github-code | 6 | [
{
"api_name": "itertools.permutations",
"line_number": 26,
"usage_type": "call"
}
] |
16053211401 | import os
import sys
import glob
import argparse
from lsdo_viz.problem import Problem
from lsdo_viz.utils import clean, get_viz, get_args, exec_python_file
def main_viz(args=None):
if args is None:
args = sys.argv[1:]
parser = argparse.ArgumentParser()
parser.add_argument('args_file_name', nargs... | MAE155B-Group-3-SP20/Group3Repo | lsdo_viz/lsdo_viz/main_viz.py | main_viz.py | py | 1,938 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sys.argv",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "lsdo_viz.utils.get_args",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "matplot... |
41815384400 | from urllib import response
import requests
from pprint import pprint
from time import sleep
import os
from sqlalchemy import null
url = "http://10.0.1.10:8080"
# ------------------------ PRINT ------------------------
def menu():
os.system('clear') or None
print("-------------------:-------------------")
... | hencabral/Python-BoxCode-API | cliente.py | cliente.py | py | 8,346 | python | pt | code | 0 | github-code | 6 | [
{
"api_name": "os.system",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.system",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "pprint.pprint",
"line_number": 78,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number": ... |
14493907058 | # -*- coding: utf-8 -*- #
'''
--------------------------------------------------------------------------
# File Name: PATH_ROOT/utils/signal_vis.py
# Author: JunJie Ren
# Version: v1.1
# Created: 2021/06/15
# Description: — — — — — — — — — — — — — — — — — — — — — — — — — — —
... | jjRen-xd/PyOneDark_Qt_GUI | app/utils/signal_vis.py | signal_vis.py | py | 11,107 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "matplotlib.use",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "sys.path.append",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 50,
"usage_type": "attribute"
},
{
"api_name": "numpy.int",
"line_nu... |
4534308606 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
# REF [site] >> https://scrapy.org/
import scrapy
class BlogSpider(scrapy.Spider):
name = 'blogspider'
start_urls = ['https://blog.scrapinghub.com']
def parse(self, response):
for title in response.css('.post-header>h2'):
yield {'title': title.css('a ::text').ge... | sangwook236/SWDT | sw_dev/python/ext/test/networking/scrapy_test.py | scrapy_test.py | py | 581 | python | en | code | 17 | github-code | 6 | [
{
"api_name": "scrapy.Spider",
"line_number": 8,
"usage_type": "attribute"
}
] |
24650911393 | import asyncio
import curses
import typing
from curses_tools import draw_frame
class Obstacle:
def __init__(
self,
row: int,
column: int,
rows_size: int = 1,
columns_size: int = 1,
uid: str | None = None,
) -> None:
self.row = row
self.column = ... | Alex-Men-VL/space_game | src/obstacles.py | obstacles.py | py | 4,841 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "typing.Generator",
"line_number": 72,
"usage_type": "attribute"
},
{
"api_name": "curses.window",
"line_number": 87,
"usage_type": "attribute"
},
{
"api_name": "curses_tools.draw_frame",
"line_number": 101,
"usage_type": "call"
},
{
"api_name": "asy... |
22368252597 | import os, sys
import numpy as np
import pandas as pd
import pickle
import argparse
from keras import backend
from keras.models import load_model
from keras.optimizers import *
from sklearn.metrics import accuracy_score
from sklearn.decomposition import PCA
from sklearn.neighbors import KNeighborsClassifier
from model ... | tom6311tom6311/dlcv2018final | task2/knn/code/knn_test.py | knn_test.py | py | 2,377 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "keras.backend.set_image_dim_ordering",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "keras.backend",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "os.environ",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "ar... |
32129181331 | import logging
import pandas as pd
from flask import Flask, request, jsonify
from data_preprocessing import process_data_for_training
import psycopg2
from psycopg2 import sql
# Create a Flask app
app = Flask(__name__)
app.logger.setLevel(logging.DEBUG)
app.logger.addHandler(logging.StreamHandler())
db_params = {
... | evialina/automotive_diagnostic_recommender_system | training-service/script.py | script.py | py | 1,290 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "logging.StreamHandler",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "psycopg2.connect"... |
30439578880 | import networkx as nx
from networkx.generators.degree_seq import expected_degree_graph
# make a random graph of 500 nodes with expected degreees of 50
n = 500 # n nodes
p = 0.1
w = [p * n for i in range(n)] # w = p*n for all nodes
G = expected_degree_graph(w) # configuration model
print("Degree Histogram")
print... | oimichiu/NetworkX | graph/ex24.py | ex24.py | py | 503 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "networkx.generators.degree_seq.expected_degree_graph",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "networkx.degree_histogram",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "networkx.degree",
"line_number": 12,
"usage_type": "call"
... |
5229315790 | from django.http import HttpResponsePermanentRedirect, HttpResponseGone
def redirect_to(request, url, convert_funcs=None, **kwargs):
"""
A version of django.views.generic.simple.redirect_to which can handle
argument conversion. The 'convert_funcs' parameter is a dictionary mapping
'kwargs' keys to a fu... | gboue/django-util | django_util/view_utils.py | view_utils.py | py | 819 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "django.http.HttpResponseGone",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "django.http.HttpResponsePermanentRedirect",
"line_number": 19,
"usage_type": "call"
}
] |
36606021901 | import os
import csv
import queue
import logging
import argparse
import traceback
import itertools
import numpy as np
import tensorflow.compat.v1 as tf
from fedlearner.trainer.bridge import Bridge
from fedlearner.model.tree.tree import BoostingTreeEnsamble
from fedlearner.trainer.trainer_master_client import LocalTra... | rain701/fedlearner-explain | fedlearner/fedlearner/model/tree/trainer.py | trainer.py | py | 21,840 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "tensorflow.compat.v1.train.Example",
"line_number": 162,
"usage_type": "call"
},
{
"api_name": "tensorflow.compat.v1.train",
"line_number": 162,
"usage_type": "attribute"
... |
10769330374 | """my_first_django URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/4.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Cla... | shine-codestove/my_first_django | my_first_django/urls.py | urls.py | py | 1,750 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "rest_framework.routers.DefaultRouter",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "rest_framework.routers",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "myapp.views.user.UserViewSet",
"line_number": 32,
"usage_type": "argument"
... |
7263711725 | # -*- coding: utf-8 -*-
from PyQt5.QtWidgets import QMainWindow, QVBoxLayout, QWidget, QTabWidget
from .movies_view import MoviesTab
from .games_view import GamesTab
from .music_view import MusicTab
class Window(QMainWindow):
"""Main Window."""
def __init__(self, parent=None):
"""Initializer."""
... | aisandovalm/media-library | media_library/views/main_view.py | main_view.py | py | 1,186 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "PyQt5.QtWidgets.QMainWindow",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtWidgets.QWidget",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtWidgets.QWidget",
"line_number": 25,
"usage_type": "argument"
},
{
"ap... |
11849550981 |
"""
Created on Thu Dec 10 22:51:52 2020
@author: yzaghir
Image Arthmeric Opeations Add -
We can add two images with the OpenCV function , cv.add()
-Resize the two images and make sur they are exactly the same size before adding
"""
# import cv library
import cv2 as cv
#import numpy as np
# read image from c... | zaghir/python | python-opencv/arithmetic_operations_addition_and_subtraction.py | arithmetic_operations_addition_and_subtraction.py | py | 906 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "cv2.imread",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "cv2.imshow",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "cv2.imshow",
"line_number": 31,
... |
28237649684 | import typing
import requests
from requests import Session
from zenora.errors import MissingAccess, AvatarError, InvalidSnowflake
# Request functions
def fetch(
url: str,
headers: typing.Dict[str, str],
params: typing.Dict[str, str] = {},
) -> typing.Dict:
r = requests.get(url=url, headers=headers, p... | StarrMan303/zenora | zenora/utils/helpers.py | helpers.py | py | 1,778 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "typing.Dict",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "typing.Dict",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "requests.get",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "typing.Dict",
"lin... |
70075742268 | # -*- encoding:utf-8 -*-
'''
@time: 2019/12/21 9:48 下午
@author: huguimin
@email: 718400742@qq.com
'''
import os
import random
import math
import torch
import argparse
import numpy as np
from util.util_data_gcn import *
from models.word2vec.ecgcn import ECGCN
from models.word2vec.ecgat import ECGAT
from models.word2vec.... | LeMei/FSS-GCN | train.py | train.py | py | 15,194 | python | en | code | 14 | github-code | 6 | [
{
"api_name": "math.ceil",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "math.sqrt",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "torch.nn.init.uniform_",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_numbe... |
42095752382 | import os, settings
from app import myApp
import uuid
from flask import request, render_template
from pdf_core import PdfHelper
from threading import Timer
@myApp.route('/', methods=['GET', 'POST'])
def upload_file():
if request.method == 'POST':
# create a list with all pdf files
... | icruces/blog-PDFMerging | app/views.py | views.py | py | 1,305 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "flask.request.method",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "flask.request.files.getlist",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "f... |
72940803068 | # This is a sample Python script.
# Press ⌃R to execute it or replace it with your code.
# Press Double ⇧ to search everywhere for classes, files, tool windows, actions, and settings.
import os, requests, json
# python request examples
# https://www.pythonforbeginners.com/requests/using-requests-in-python
def print... | lean35/python101 | main.py | main.py | py | 915 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "json.dumps",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number": 18,
"usage_type": "call"
}
] |
70082164988 |
from routersim.interface import LogicalInterface
from .messaging import FrameType
from .messaging import ICMPType, UnreachableType
from .mpls import MPLSPacket, PopStackOperation
from .observers import Event, EventType
from scapy.layers.inet import IP,ICMP,icmptypes
from copy import copy
import ipaddress
class Forwa... | jdewald/router-sim | routersim/forwarding.py | forwarding.py | py | 9,267 | python | en | code | 5 | github-code | 6 | [
{
"api_name": "ipaddress.ip_network",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "messaging.FrameType.IPV4",
"line_number": 34,
"usage_type": "attribute"
},
{
"api_name": "messaging.FrameType",
"line_number": 34,
"usage_type": "name"
},
{
"api_name":... |
21797961836 | # make a time series of instantaneous electric power consumption graph from a csv file
import csv
import glob
import re
import os
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from statistics import mean
# define variables
timestep = 0.01
def csv_to_graph(path):
data = pd.read_csv(path, ... | is0232xf/BIWAKO_unit_test | csv_to_graph.py | csv_to_graph.py | py | 4,460 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pandas.read_csv",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.argmax",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "statistics.mean",
"line_... |
70132131389 | from typing import Tuple
from sqlalchemy import and_, desc
from quizard_backend import db
from quizard_backend.utils.exceptions import raise_not_found_exception
from quizard_backend.utils.transaction import in_transaction
def dict_to_filter_args(model, **kwargs):
"""
Convert a dictionary to Gino/SQLAlchemy'... | donjar/quizard | api/quizard_backend/utils/query.py | query.py | py | 5,219 | python | en | code | 5 | github-code | 6 | [
{
"api_name": "sqlalchemy.and_",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "quizard_backend.utils.exceptions.raise_not_found_exception",
"line_number": 59,
"usage_type": "call"
},
{
"api_name": "quizard_backend.db.select",
"line_number": 65,
"usage_type": "... |
1883488340 | import sys
import pefile
import re
# Pega os headers de um executável
def get_headers(executable):
pe = pefile.PE(executable)
sections = []
for section in pe.sections:
sections.append(section.Name.decode('utf-8'))
return sections
# Pega os headers dos argumentos de entrada
sections1 = get_head... | kkatzer/CDadosSeg | T2/Parte2/T2P2b.py | T2P2b.py | py | 1,323 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pefile.PE",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "re.sub",
"line_number": 28,
... |
3235447487 | from __future__ import annotations
from typing import TYPE_CHECKING
from avilla.core.context import Context
from avilla.core.event import RelationshipCreated, RelationshipDestroyed
from avilla.core.selector import Selector
from avilla.core.trait.context import EventParserRecorder
from cai.client.events.group import (... | RF-Tar-Railt/Avilla-CAI | avilla/cai/event/group.py | group.py | py | 2,023 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "typing.TYPE_CHECKING",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "avilla.core.trait.context.EventParserRecorder",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "protocol.CAIProtocol",
"line_number": 34,
"usage_type": "name"
},
... |
22034975052 | from lib2to3.pgen2 import token
from brownie import Test, accounts, interface
from eth_utils import to_wei
from web3 import Web3
def main():
deploy()
def deploy():
amount_in = Web3.toWei(1000000, "ether")
# DAI address
DAI = "0x6B175474E89094C44Da98b954EedeAC495271d0F"
# DAI whale
DAI_WHAL... | emrahsariboz/DeFi | uniswap/scripts/_deployAndAddLiquidity.py | _deployAndAddLiquidity.py | py | 1,713 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "web3.Web3.toWei",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "web3.Web3",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "brownie.interface.IERC20",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "brownie.interface"... |
35800840346 | import unittest
import numpy as np
from numpy import linalg
from task import img_rescaled, img_array_transposed, U, s, Vt
class TestCase(unittest.TestCase):
def test_transpose(self):
np.testing.assert_array_equal(img_array_transposed, np.transpose(img_rescaled, (2, 0, 1)),
... | jetbrains-academy/Python-Libraries-NumPy | Projects/SVD/Applying to All Colors/tests/test_task.py | test_task.py | py | 1,073 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "unittest.TestCase",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "numpy.testing.assert_array_equal",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "task.img_array_transposed",
"line_number": 9,
"usage_type": "argument"
},
{
... |
40467350126 | # 1번 풀이
# import sys
# dx = [0,0,-1,1] # 우좌상하
# dy = [1,-1,0,0]
# def dfs(places, x, y,depth):
# if depth == 3: # depth 3까지 찾아봤는데 거리두기 잘 지키는 경우 True
# return True
# for i in range(4):
# nx = x + dx[i]
# ny = y + dy[i]
# if 0<= nx <5 and 0<= ny <5 and visited[nx][ny] == 0 and pla... | Cho-El/coding-test-practice | 프로그래머스 문제/파이썬/level2/거리두기 확인하기.py | 거리두기 확인하기.py | py | 4,381 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "collections.deque",
"line_number": 102,
"usage_type": "call"
}
] |
25182089444 | # adapated from munch 2.5.0
from collections.abc import Mapping
class Munch(dict):
"""A dictionary that provides attribute-style access.
>>> b = Munch()
>>> b.hello = 'world'
>>> b.hello
'world'
>>> b['hello'] += "!"
>>> b.hello
'world!'
>>> b.foo = Munch(lol=True)
>>> b.foo.l... | SAIL-Labs/AMICAL | amical/externals/munch/__init__.py | __init__.py | py | 11,370 | python | en | code | 9 | github-code | 6 | [
{
"api_name": "collections.abc.Mapping",
"line_number": 262,
"usage_type": "argument"
},
{
"api_name": "collections.abc.Mapping",
"line_number": 275,
"usage_type": "argument"
},
{
"api_name": "collections.abc.Mapping",
"line_number": 324,
"usage_type": "argument"
},
{... |
37568054562 | # import libraries
import sys
import nltk
nltk.download(['punkt', 'wordnet', 'stopwords'])
import re
import numpy as np
import pandas as pd
from sqlalchemy import create_engine
from nltk.corpus import stopwords
from nltk.tokenize import word_tokenize
from nltk.stem import WordNetLemmatizer
from sklearn.metrics import... | goitom/project_2_disaster_response | models/train_classifier.py | train_classifier.py | py | 5,371 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "nltk.download",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.create_engine",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "pandas.read_sql_table",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "re.findal... |
37272423624 |
import sys
from aspartix_parser import Apx_parser
import itertools
def conflict_free(arguments, attacks):
confl_free_sets = []
combs = []
for i in range(1, len(arguments) + 1):
els = [list(x) for x in itertools.combinations(arguments, i)]
combs.extend(els)
combs_sorted =... | Vladimyr23/aspartix_file_parsing_and_reasoning_with_args | Python_parser_and_reasoning_semantics/semantics.py | semantics.py | py | 3,690 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "itertools.combinations",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 90,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 91,
"usage_type": "attribute"
},
{
"api_name": "aspartix_parser.Ap... |
25546051885 | import os
import json
import flask
from vrprot.alphafold_db_parser import AlphafoldDBParser
import vrprot
from . import map_uniprot
from . import settings as st
from . import util
from .classes import NodeTags as NT
def get_scales(uniprot_ids=[], mode=st.DEFAULT_MODE):
return vrprot.overview_util.get_scale(uni... | menchelab/ProteinStructureFetch | src/workflows.py | workflows.py | py | 5,793 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "vrprot.overview_util.get_scale",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "vrprot.overview_util",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "vrprot.alphafold_db_parser.AlphafoldDBParser",
"line_number": 19,
"usage_type": ... |
72473999867 | from math import sqrt
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
x1_list = []
x2_list = []
y_list = []
counter = 0
def show(x1_list, x2_list):
N = int(x1_list.__len__())
if (N <= 0):
return
fig, ax = plt.subplots(subplot_kw={"projection": "3d"})
... | AlexSmirno/Learning | 6 Семестр/Оптимизация/Lab_4_1.py | Lab_4_1.py | py | 3,768 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "numpy.arange",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.arang... |
18308754842 | from tempfile import gettempdir
import urllib.request
import platform
import zipfile
from os.path import join
from os import walk
pth = "https://github.com/AequilibraE/aequilibrae/releases/download/V0.6.0.post1/mod_spatialite-NG-win-amd64.zip"
outfolder = gettempdir()
dest_path = join(outfolder, "mod_spatialite-NG-w... | AequilibraE/aequilibrae | tests/setup_windows_spatialite.py | setup_windows_spatialite.py | py | 1,347 | python | en | code | 140 | github-code | 6 | [
{
"api_name": "tempfile.gettempdir",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "urllib.request.request.urlretrieve",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "u... |
24072421464 | """
Parser.py
Used to parse URLs into a linked list of dictionaries.
"""
from bs4 import BeautifulSoup
import requests
import re
class Node: # pragma: no cover
"""
Creates a Node that contains data, and a next node
Data holds any object.
Next points to the next node, and should always be a node.
... | Jhawk1196/CS3250PythonProject | src/parser.py | parser.py | py | 5,232 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 69,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 70,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 74,
"usage_type": "call"
},
{
"api_name": "re.search",
"line_numbe... |
3229327686 | #!/usr/bin/python
### File Information ###
"""
Rejector
"""
__author__ = 'duanqz@gmail.com'
import os
import fnmatch
from config import Config
class Rejector:
""" Rejector:
1. Check whether conflicts happen.
2. Resolve conflicts automatically.
"""
CONFILCT_START = "<<<<<<<"
CONFL... | baidurom/tools | autopatch/rejector.py | rejector.py | py | 4,416 | python | en | code | 12 | github-code | 6 | [
{
"api_name": "fnmatch.fnmatch",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "os.path.relpath",
"line_number": 122,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 122,
"usage_type": "attribute"
},
{
"api_name": "config.Config.PRJ_ROOT... |
29214262320 | import os.path
import unittest
from pathlib import Path
from sflkit.analysis.analysis_type import AnalysisType
from sflkit.analysis.spectra import Spectrum
from sflkit.analysis.suggestion import Location
from tests4py import framework
from tests4py.constants import DEFAULT_WORK_DIR
from utils import BaseTest
class ... | smythi93/Tests4Py | tests/test_sfl.py | test_sfl.py | py | 3,851 | python | en | code | 8 | github-code | 6 | [
{
"api_name": "utils.BaseTest",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "tests4py.framework.default.tests4py_checkout",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "tests4py.framework.default",
"line_number": 19,
"usage_type": "attribute"
}... |
27672884251 | from typing import Dict, Tuple
from copy import deepcopy
import torch
from config import tqc_config
from modules import Actor, TruncatedQuantileEnsembledCritic
class TQC:
def __init__(self,
cfg: tqc_config,
actor: Actor,
critic: TruncatedQuantileEnsembledCritic) ... | zzmtsvv/rl_task | offline_tqc/tqc.py | tqc.py | py | 5,082 | python | en | code | 8 | github-code | 6 | [
{
"api_name": "config.tqc_config",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "modules.Actor",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "modules.TruncatedQuantileEnsembledCritic",
"line_number": 12,
"usage_type": "name"
},
{
"api_name... |
19167053066 | """
Common utilities for derp used by various classes.
"""
from collections import namedtuple
import cv2
from datetime import datetime
import heapq
import logging
import pathlib
import numpy as np
import os
import socket
import time
import yaml
import zmq
import capnp
import messages_capnp
Bbox = namedtuple("Bbox", ["... | notkarol/derplearning | derp/util.py | util.py | py | 9,198 | python | en | code | 40 | github-code | 6 | [
{
"api_name": "collections.namedtuple",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "messages_capnp.Camera",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "messages_capnp.Controller",
"line_number": 23,
"usage_type": "attribute"
},
{
"... |
2888676781 | import numpy as np
from matplotlib import pyplot as plt
if __name__ == '__main__':
ch, time, date = np.genfromtxt("events220302_1d.dat", unpack=True,
dtype=(int, float, 'datetime64[ms]'))
mask1 = ch==1
mask2 = ch==2
time1 = time[mask1]
time2 = time[mask2]
date... | brinus/Sciami_lab4 | UNIX_vs_FPGA.py | UNIX_vs_FPGA.py | py | 841 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.genfromtxt",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "numpy.datetime64",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "matplotli... |
25003790859 | import math
from typing import Tuple
import tensorflow as tf
class ParityDataset(tf.keras.utils.Sequence):
def __init__(self, n_samples: int, n_elems: int = 64, batch_size: int = 128):
"""
Parameters
----------
n_samples : int
Number of samples.
n_elems : int, ... | EMalagoli92/PonderNet-TensorFlow | pondernet_tensorflow/dataset/parity_dataset.py | parity_dataset.py | py | 1,598 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "tensorflow.keras",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "math.floor",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "tensorflow.random.uniform",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "tensorflow.... |
23750393543 | """
최적화 비중을 계산해주는 모듈
@author: Younghyun Kim
Created on 2021.10.05
"""
import numpy as np
import pandas as pd
import cvxpy as cp
import torch
from cvxpylayers.torch import CvxpyLayer
class ClassicOptimizer:
"""
Classic Optimizer
"""
def __init__(self, m=100,
buying_fee=... | kimyoungh/singlemolt | statesman/classic_optimizer.py | classic_optimizer.py | py | 11,771 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pandas.DataFrame",
"line_number": 41,
"usage_type": "attribute"
},
{
"api_name": "numpy.cov",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "numpy.nan_to_num",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "numpy.nan_to_num",
... |
73529467707 | import os.path
from sklearn import metrics
from torch import nn, optim
# noinspection PyUnresolvedReferences
from tests.pytest_helpers.data import dataloaders, image
# noinspection PyUnresolvedReferences
from tests.pytest_helpers.nn import sample_model
def test_fit(sample_model, dataloaders):
try:
model ... | default-303/easyTorch | tests/testUtils/test_trainer.py | test_trainer.py | py | 1,039 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "tests.pytest_helpers.nn.sample_model",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "torch.nn.CrossEntropyLoss",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 14,
"usage_type": "name"
},
{
"api_... |
21299192914 | """Module to evaluate full pipeline on the validation set.
python evaluate.py
"""
#!/usr/bin/env python
# coding: utf-8
import os
import sys
import glob
import numpy as np
import image_preprocessing
import cnn
import bayesian_network
import json
import pandas as pd
# class mapping
classes = {"Positive": 0, "Neu... | samanyougarg/Group-Emotion-Recognition | evaluate.py | evaluate.py | py | 3,390 | python | en | code | 43 | github-code | 6 | [
{
"api_name": "json.load",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "image_preprocessing.preprocess",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "cnn.predict_image",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "bayesian_n... |
23196116357 | import pyspark
import networkx as nx
import pandas as pd
from pyspark.sql.types import (
LongType,
StringType,
FloatType,
IntegerType,
DoubleType,
StructType,
StructField,
)
import pyspark.sql.functions as f
from pyspark.sql.functions import pandas_udf, PandasUDFType
from networkx.algorithms... | moj-analytical-services/splink_graph | splink_graph/node_metrics.py | node_metrics.py | py | 6,877 | python | en | code | 6 | github-code | 6 | [
{
"api_name": "pyspark.sql.types.StructType",
"line_number": 84,
"usage_type": "call"
},
{
"api_name": "pyspark.sql.types.StructField",
"line_number": 86,
"usage_type": "call"
},
{
"api_name": "pyspark.sql.types.StringType",
"line_number": 86,
"usage_type": "call"
},
... |
74750230586 | import os
import pathlib
import shutil
from datetime import datetime
from pathlib import Path
from my_logger_object import create_logger_object
def copy_component(component_kb_list, component_name, source_folder, target_folder):
# source_folder = r"C:\CodeRepos\GetOfficeKBs\Folder_Office2016_KBs\x64_msp"
# t... | FullStackEngN/GetOfficeKBs | get_msp_file_for_specified_msp_list.py | get_msp_file_for_specified_msp_list.py | py | 3,495 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "os.path.exists",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "os.makedirs",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.walk",
"line_number": ... |
23303525367 | import pandas as pd
from sklearn.cluster import KMeans
from sklearn.metrics import silhouette_score
import matplotlib.pyplot as plt
def kmeans():
data = \
pd.read_csv(
'2019-04-28xm_fish.csv',
names=['房源名称', '租赁种类', '房源类型', '房源户型', '房源面积', '房源楼层', '房源朝向', '装修等级', '房源地址', '行政区划', '房... | Joy1897/Spider_58 | kmeans.py | kmeans.py | py | 2,423 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pandas.read_csv",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sklearn.cluster.KMeans",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.scatter",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "matpl... |
41543430774 | import re
import sys
from .ply import lex
from .ply.lex import TOKEN
class CLexer(object):
""" A lexer for the C- language. After building it, set the
input text with input(), and call token() to get new
tokens.
The public attribute filename can be set to an initial
filaneme, but ... | ricoms/mips | compiladorCminus/pycminus/c_lexer.py | c_lexer.py | py | 4,426 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "re.compile",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "ply.lex.lex",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "ply.lex",
"line_number": 53,
... |
24200680597 | from collections import Counter
class Solution:
def func(self, strings, K):
"""
Args:
strings: list[str]
K: int
"""
counter = Counter(strings)
counter_list = [(key, counter[key]) for key in counter]
# 频数大, 字母序小 -> 频数小, 字母序大
counter_li... | AiZhanghan/Leetcode | 秋招/腾讯/3.py | 3.py | py | 787 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "collections.Counter",
"line_number": 11,
"usage_type": "call"
}
] |
71567683388 | import streamlit as st
import pandas as pd
@st.cache
def load_data():
data = pd.read_csv('data.csv', sep=';', encoding='latin1')
return data
data = load_data()
selected_country = st.selectbox("Select a Country", data['Country'])
col1, col2 = st.columns(2)
with col1:
coal_percent = st.slider("Coal %",... | sneha-4-22/Energy-Calculator | app.py | app.py | py | 3,135 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pandas.read_csv",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "streamlit.cache",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "streamlit.selectbox",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "streamlit.colu... |
23202639490 | import struct
import socket
import sys
import ipaddress
import threading
import os
class client:
"""
Responsible for keeping track of the clients information
"""
def __init__(self, ip_address, ll_address):
"""
Initialises all variables needed
Constructor: __init___(self, ip_address, ll_address)
"""
self.... | TSampey/COMS3200-Assign3 | assign3.py | assign3.py | py | 12,355 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "ipaddress.ip_interface",
"line_number": 151,
"usage_type": "call"
},
{
"api_name": "ipaddress.IPv4Address",
"line_number": 159,
"usage_type": "call"
},
{
"api_name": "ipaddress.ip_network",
"line_number": 159,
"usage_type": "call"
},
{
"api_name": "... |
71353706429 | # GMM implementation
# good resource http://www.rmki.kfki.hu/~banmi/elte/bishop_em.pdf
import numpy as np
from scipy import stats
import seaborn as sns
from random import shuffle, uniform
sns.set_style("white")
#Generate some data from 2 different distributions
x1 = np.linspace(start=-10, stop=10, num=1000)
x2 = np.l... | cristian904/GMMs | GMM.py | GMM.py | py | 2,456 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "seaborn.set_style",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.linspace",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.linspace",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "scipy.stats.norm.pdf",... |
71781170429 | import cv2
# read your picture and store into variable "img"
img = cv2.imread('picture.jpg')
# scale image down 3 times
for i in range(3):
img = cv2.pyrDown(img)
# save scaled image
cv2.imwrite(f'picture_scaled_{i}.jpg', img) | yptheangel/opencv-starter-pack | python/basic/image_pyramid.py | image_pyramid.py | py | 240 | python | en | code | 8 | github-code | 6 | [
{
"api_name": "cv2.imread",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "cv2.pyrDown",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "cv2.imwrite",
"line_number": 11,
"usage_type": "call"
}
] |
38231691013 | from django.shortcuts import render, get_object_or_404
from .models import Post, Group
def index(request):
posts = Post.objects.order_by('-pub_date')[:10]
title = 'Это главная страница проекта Yatube'
context = {
'posts': posts,
'title': title,
}
return render(request, 'posts/index... | NikitaKorovykovskiy/Yatube_project | yatube/posts/views.py | views.py | py | 762 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "models.Post.objects.order_by",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "models.Post.objects",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "models.Post",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "django... |
5479668707 | import argparse
import os, numpy as np
import os.path as osp
from multiprocessing import Process
import h5py
import json
os.environ["D4RL_SUPPRESS_IMPORT_ERROR"] = "1"
os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID"
os.environ["MKL_NUM_THREADS"] = "1"
os.environ["NUMEXPR_NUM_THREADS"] = "1"
os.environ["OMP_NUM_THREADS"... | haosulab/ManiSkill2-Learn | tools/convert_state.py | convert_state.py | py | 10,700 | python | en | code | 53 | github-code | 6 | [
{
"api_name": "os.environ",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_... |
6117949220 | from google.cloud import bigquery
import os
import sys
import json
import argparse
import gzip
import configparser
import pandas as pd
def main():
# Load args
args = parse_args()
In_config=args.in_config
Input_study=args.in_study
Configs = configparser.ConfigParser()
Configs.read(In_config)
... | xyg123/SNP_enrich_preprocess | scripts/LDSC_format_single_sumstat.py | LDSC_format_single_sumstat.py | py | 3,343 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "configparser.ConfigParser",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "google.cloud.bigquery.Client",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "google.cloud.bigquery",
"line_number": 20,
"usage_type": "name"
},
{
"api_... |
8257233523 | # Use the environment variables DIANA_BROKER and DIANA_RESULT to attach the celery
# app to a message queue.
import os
from celery import Celery
app = Celery('diana')
app.conf.update(
result_expires = 3600,
task_serializer = "pickle",
accept_content = ["pickle"],
result_serializer = "pickle",
tas... | derekmerck/DIANA | packages/diana/diana/star/app.py | app.py | py | 776 | python | en | code | 11 | github-code | 6 | [
{
"api_name": "celery.Celery",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.environ.get",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "os.environ.get",
"lin... |
3337645854 | import time
from pyspark import SparkContext,SparkConf
#-----------------------------------------------
#spark map reduce练习
def mymap(line):
return len(line)
#在spark中这样对数字进行叠加是不可行对 由于闭包机制,每一份机器上都单独有一份所引用都对象 应该使用saprk提供都累加器
nums_all=0
def test_foreach(nums):
global nums_all
nums_all+=nums
print(nums_... | zml1996/learn_record | learn_spark/test_spark2.py | test_spark2.py | py | 1,066 | python | fa | code | 2 | github-code | 6 | [
{
"api_name": "pyspark.SparkConf",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "pyspark.SparkContext",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 30,
"usage_type": "call"
}
] |
25145650810 | import pytest
import datetime
import pytz
from mixer.backend.django import mixer
from telegram_message_api.helpers import (
ParsedData, ParseText, CategoryData,
)
@pytest.mark.parametrize(
'text', [
'150 test',
'150 test 150',
'150',
]
)
def test_parsetext_dataclass(text):
""... | enamsaraev/telegram_bot_api | telegram_message_api/tests/test_helpers.py | test_helpers.py | py | 1,071 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "telegram_message_api.helpers.ParseText",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "pytest.mark.parametrize",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pytest.mark",
"line_number": 12,
"usage_type": "attribute"
},
{
"a... |
3982882771 | from time import time
import sys, argparse, heightfield, os, povray_writer, load_info, read_lidar, cameraUtils, calculate_tile
#/media/pablo/280F8D1D0A5B8545/TFG_files/cliente_local/
#/media/pablo/280F8D1D0A5B8545/TFG_files/strummerTFIU.github.io/
def tiles_to_render(c1, c2, zoom):
"""
Return the tiles needed to re... | strummerTFIU/TFG-IsometricMaps | src/main_program.py | main_program.py | py | 18,332 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "calculate_tile.calculate_tile",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "calculate_tile.calculate_tile",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "calculate_tile.calculate_coordinates",
"line_number": 41,
"usage_type": "call... |
37056080424 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Simple univariate BLUP implementation for starting values estimation."""
import numpy as np
from scipy.optimize import minimize
def grad(sigmas: np.ndarray, y: np.ndarray, k: np.ndarray):
v = 1 / (sigmas[0] + sigmas[1] * k)
if np.any(v < 1e-12):
return... | planplus/pysem | pysem/univariate_blup.py | univariate_blup.py | py | 1,705 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "numpy.ndarray",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "numpy.any",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.nan",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "numpy.zeros",
"line_nu... |
71666200828 | from django.contrib import admin
from .models import newdoc
class DocAdmin(admin.ModelAdmin):
fieldsets = [
(None, {"fields": ["title"]}),
("Date information", {"fields": ["created_time"]}),
(None, {"fields": ["modified_time"]}),
("Au... | JarvisDong/Project-CGD | mysite/documents/admin.py | admin.py | py | 652 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.contrib.admin.ModelAdmin",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "django.contrib.admin.site.register",
"line_number": 20,
"usage_type": "call"
},... |
72060297789 | from flask import render_template, Flask, request, jsonify, url_for, redirect
import requests
from flask_pymongo import PyMongo
import json
from Model import *
import time
def after_request(response):
response.headers['Access-Control-Allow-Origin'] = '*'
response.headers['Access-Control-Allow-Methods'] = 'PUT... | xiechzh/Accomodation-Web-Portal | COMP9900_Proj/COMP9900_Proj.py | COMP9900_Proj.py | py | 13,953 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "flask_pymongo.PyMongo",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "flask.render_... |
22095502736 | from django.urls import path
from user import views
urlpatterns = [
path('fun',views.fun),
path('fun1',views.fun1),
path('u',views.us, name='uuu'),
path('user',views.user, name='aaaa'),
] | anshifmhd/demo | user/urls.py | urls.py | py | 205 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "user.views.fun",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "user.views",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "django.urls.path",
"... |
10699368918 | # -*- coding:utf-8 -*-
import cv2
import os
from glob import glob
import numpy as np
import shutil
'''处理原图片得到人物脸部图片并按比例分配train和test用于训练模型'''
SRC = "Raw" # 待处理的文件路径
DST = "data2" # 处理后的文件路径
TRAIN_PER = 5 # train的图片比例
TEST_PER = 1 # test的图片比例
def rename_file(path, new_name="", start_num=0, file_type=""):
if n... | mikufanliu/AnimeCharacterRecognition | get_faces.py | get_faces.py | py | 5,231 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "os.path.exists",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "os.listdir",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_numbe... |
7161765994 | from typing import List
class Solution:
def calculate(self, nums, k, max_len, s, nums_len):
if nums[s:] == []:
print("max_len=",max_len)
return max_len
else:
i = 0
temp = k
ans = []
temp_nums = nums[s:]
print("nums... | CompetitiveCodingLeetcode/LeetcodeEasy | JuneLeetcodeChallenge/MaxConsecutiveOnesIII.py | MaxConsecutiveOnesIII.py | py | 1,280 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "typing.List",
"line_number": 33,
"usage_type": "name"
}
] |
18609666305 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
from waveapi import events
from waveapi import model
from waveapi import robot
from pyactiveresource.activeresource import ActiveResource
import logging
import settings
CC_XMPP = 'cc:xmpp'
CC_TWITTER = 'cc:twitter'
logger = logging.getLogger('GAE_Robot')
logger.setLeve... | zh/gae-robot | gaerobot.py | gaerobot.py | py | 2,435 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "pyactiveresource.activeresource.ActiveResource",
"line_number": 19,
"usage_type": "name"
},
{
... |
21812044102 | import pytest
from src.error import InputError
from src.auth import auth_register_v2
from src.user import user_profile_v2
from src.other import clear_v1
@pytest.fixture
def register_user():
clear_v1()
user = auth_register_v2("johnsmith@gmail.com", "123456", "john", "smith")
token = user['token']
id = u... | TanitPan/comp1531_UNSW_Dreams | tests/user_profile_test.py | user_profile_test.py | py | 857 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "src.other.clear_v1",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "src.auth.auth_register_v2",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pytest.fixture",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "src.us... |
23950521358 | #!/usr/bin/python3
import argparse
from iCEburn.libiceblink import ICE40Board
def rtype(x):
return ('R', int(x, 16))
def wtype(x):
return ('W', [int(i,16) for i in x.split(':')])
def main():
ap = argparse.ArgumentParser()
ap.add_argument("-r", "--read", dest='actions', type=rtype, action='append')
... | davidcarne/iceBurn | iCEburn/regtool.py | regtool.py | py | 868 | python | en | code | 32 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "iCEburn.libiceblink.ICE40Board",
"line_number": 18,
"usage_type": "call"
}
] |
14720838146 | import torch
import torch.nn as nn
from collections import OrderedDict
from networks.reshape import Reshape
class ImageEncoder(nn.Module):
def __init__(self, input_channels, layers_channels, prefix, useMaxPool=False, addFlatten=False):
'''
If useMaxPool is set to True, Max pooling is used to reduce... | PradeepKadubandi/DemoPlanner | networks/imageencoder.py | imageencoder.py | py | 1,593 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "torch.nn.Module",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "collections.OrderedDict",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "torch.nn.Conv2d",... |
18020255074 | import random,argparse,sys
parser = argparse.ArgumentParser()
import numpy as np
class PlannerEncoder:
def __init__(self, opponent, p,q) -> None:
self.p = p; self.q = q
self.idx_to_states = {}
self.opp_action_probs = {}
with open(opponent,'r') as file:
i = 0
... | kiluazen/ReinforcementLearning | Policy Iteration/encoder.py | encoder.py | py | 10,197 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 138,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 174,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line... |
7886651161 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Nov 18 21:42:00 2021
@author: fyy
"""
import scipy.stats as stats
import numpy as np
import random
import scipy.io as scio
import matplotlib.pyplot as plt
import math
dataFile = './_dat/val_dataset.mat'
ratio = 0.05
sample_num = ... | Carty-Bao/BNPHMM | code/gen_new.py | gen_new.py | py | 9,565 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.ones",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "numpy.random.randint",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 39,
"usage_type": "attribute"
},
{
"api_name": "random.randint",
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.