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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
24398372709 | import tweepy
import os
consumer_key = os.environ.get('CUTIESINSF_CONSUMER_KEY')
consumer_secret = os.environ.get('CUTIESINSF_CONSUMER_SECRET')
access_token = os.environ.get('CUTIESINSF_ACCESS_TOKEN')
access_token_secret = os.environ.get('CUTIESINSF_ACCESS_TOKEN_SECRET')
class TweetPoster(object):
def __init__(... | ecalifornica/CutePetsSF | twitter_oauth.py | twitter_oauth.py | py | 1,190 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "os.environ.get",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "os.environ.get",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_num... |
25812567758 | import matplotlib.pyplot as plt
import unittest
import numpy as np
import smuthi
import smuthi.simulation
import smuthi.initial_field
import smuthi.layers
import smuthi.particles
import smuthi.postprocessing.far_field as ff
import smuthi.utility.optical_constants as opt
import io
import yaml
# for single wavelength
d... | semyonbo/particle-scattering | multipoles_TM_dipoles_and_quadrupoles.py | multipoles_TM_dipoles_and_quadrupoles.py | py | 5,534 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "smuthi.layers.LayerSystem",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "smuthi.layers",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "smuthi.particles.Sphere",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "... |
25375579863 | import os
import time
import json
import requests
path = ""
# ex. "public/"
whitelist_file_path = "/opt/SentinelNetGuard/whitelist.txt"
cfg_file_path = "/opt/SentinelNetGuard/config.json"
class local_server:
def __init__(self, pre_whitelist=None, unid="null", owner="null", lifetime=3600, destruct... | wilarN/SentinelNetGuard_Node-Host_Software | srv_src/useful.py | useful.py | py | 10,640 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "os.path.exists",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 38,
"usage_type": "attribute"
},
{
"api_name": "os.path.exists",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number... |
3210811157 | import numpy as np
import cv2
import matplotlib.pyplot as plt
import torch
import AENetwork
from cfg import DefaultConfig
# import time
torch.backends.cudnn.deterministic = True # 因为使用了GPU,需要保证种子固定才能保证每次结果相同
torch.backends.cudnn.benchmark = True # 让cuDNN找到最合适的算法
device = torch.device("cuda" if torch.cuda.is_availabl... | Amoo1121/Graduate | src/AE/Backup/test.py | test.py | py | 2,273 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "torch.backends",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "torch.backends",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "torch.device",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "torch.cuda.is_ava... |
30801385183 | import tensorflow as tf
import numpy as np
import os
import cifar10_input as c
from PIL import Image
cur_dir = os.getcwd()
print("resizing images")
print("current directory:",cur_dir)
def modify_image(image):
flipped_images = tf.image.flip_up_down(image)
return flipped_images
def read_image(filename_queue):
... | charlieLehman/cifar_isic | bin_test.py | bin_test.py | py | 1,016 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "os.getcwd",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "tensorflow.image.flip_up_down",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "tensorflow.image",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "tensorfl... |
26103569267 | import ast
from functools import partial
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import scipy.stats
import seaborn as sn
import torch
from tqdm import tqdm
pd.set_option("mode.chained_assignment", None)
SCALE = 13
HEIGHT_SCALE = 0.5
sn.set(rc={"figure.figsize": (SCALE, int(HEIGHT_SCALE ... | samholt/DeepGenerativeSymbolicRegression | process_results/process_logs.py | process_logs.py | py | 8,284 | python | en | code | 7 | github-code | 1 | [
{
"api_name": "pandas.set_option",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "seaborn.set",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "seaborn.set",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "seaborn.set_style",
"li... |
15618952456 | import torch
from torch.autograd import Variable
from torch.utils.data import TensorDataset, DataLoader
import numpy as np
def to_Variables(*args, cuda=False):
ret = []
for arg in args:
if cuda:
ret.append(Variable(arg).cuda())
else:
ret.append(Variable(arg))
retur... | davevanveen/fairness_logistic_regression | test/test_fairness_penalty.py | test_fairness_penalty.py | py | 2,943 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "torch.autograd.Variable",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "torch.autograd.Variable",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "torch.is_tensor",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "torch... |
23106661609 | import sys
from pathlib import Path
from typing import Any, Optional
import loguru
import loguru._logger
logger = loguru.logger
def setup_logger(
output_dir: Optional[Path] = None,
bind: dict[str, Any] = {},
stderr_level: str = "INFO",
file_level: str = "DEBUG",
# ) -> "loguru.Logger":
) -> None... | berleon/savethat | savethat/log.py | log.py | py | 1,109 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "loguru.logger",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "typing.Optional",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "pathlib.Path",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "typing.Any",
"line... |
3654338359 | from PIL import Image
from pytesseract import pytesseract, Output
import os
import spacy
import cv2
import streamlit as st
pytesseract.tesseract_cmd = r"C:/Program Files/Tesseract-OCR/tesseract.exe"
def img_to_txt(file_name):
img = Image.open(file_name)
print('image is loaded')
text = pytesseract.image_to... | jpsanchezg/My-heroes-gene-challenge | streamlit_app.py | streamlit_app.py | py | 3,345 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pytesseract.pytesseract.tesseract_cmd",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "pytesseract.pytesseract",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "PIL.Image.open",
"line_number": 11,
"usage_type": "call"
},
{
"a... |
21682344443 | import pytest
import allure
@allure.feature('omplogin-分销商登录')
class TestDemo8_omplogin(object):
@allure.story('omp登录有效类')
@allure.title('1111111111111')
@allure.severity('Normal')
@allure.step('输入正确的用户名和密码')
def test_loginYXL(self):
'''
用例描述:输入正确的用户名和密码可正常登录
'''
... | su9695/myPytestDay | Learning/pytest/test_demo8.py | test_demo8.py | py | 1,507 | python | zh | code | 0 | github-code | 1 | [
{
"api_name": "allure.story",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "allure.title",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "allure.severity",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "allure.step",
"line_number... |
17358919878 | #!/usr/bin/env python
from pprint import pprint
from napalm import get_network_driver
import my_devices
def task1b(dev):
device_type = dev.pop("device_type")
driver = get_network_driver(device_type)
device = driver(**dev)
device.open()
print(device,"\n")
facts = device.get_facts()
ppri... | mickdcsw/PyPlus | class9/class9_task1.py | class9_task1.py | py | 519 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "napalm.get_network_driver",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pprint.pprint",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "my_devices.all_devices",
"line_number": 24,
"usage_type": "attribute"
}
] |
30531416686 | from src.utils.testmodelutils import test_models_on_batch_and_show
from src.utils.Metrics import auc, acc, highest_tpr_thresh, lowest_fpr_thresh
from src.utils.ParamTuner import ParamTuner
from src.utils.utils import init_folder, make_folder_if_not_there
from src.utils.Plotting import make_plot
from src.experiments.ut... | dastronmighty/dl-project | src/experiments/RunExperiment.py | RunExperiment.py | py | 7,868 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "torch.optim",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "torch.cuda.empty_cache",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
... |
21588129706 | from time import time, sleep
from typing import Any
def benchmark(method: Any, critical_time: float):
"""
This is function for time execution calc
:param method: Class method
:param critical_time: critical time execution value in sec
:return: func
"""
def wrapper(*args, **kwargs):
... | Dimiyss/Itea_training | home_work_3/hw_3_clas_decor.py | hw_3_clas_decor.py | py | 2,016 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "typing.Any",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "time.time",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 16,
... |
33352893131 | import docker
from docker .errors import NotFound, APIError
# system
import sys, os
import pathlib
import logging
from datetime import datetime
# MultiThreading
from threading import Thread
# Own
from arq_decorators.service_decorator import enableFunction
from arq_server.services.CoreService import Configuration
from a... | RafaelGB/pythonScripts | Arquitectura/arq_server/services/support/DockerTools.py | DockerTools.py | py | 4,146 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "logging.Logger",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "arq_server.services.CoreService.Configuration",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "threading.Thread",
"line_number": 59,
"usage_type": "call"
},
{
... |
5376519317 | from airflow import DAG
from airflow.operators.bash_operator import BashOperator
from datetime import datetime
default_args = {
'owner': 'airflow',
'start_date': datetime(2015, 6, 1)
}
dag = DAG(
'hello',
default_args = default_args
)
hello = BashOperator(
task_id='hello',
bash_command='echo ... | komparo/rosetta-pipeline | tasks/one-job/airflow/workflow.py | workflow.py | py | 366 | python | en | code | 6 | github-code | 1 | [
{
"api_name": "datetime.datetime",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "airflow.DAG",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "airflow.operators.bash_operator.BashOperator",
"line_number": 15,
"usage_type": "call"
}
] |
17520414020 | import os
from setuptools import setup
README = open(os.path.join(os.path.dirname(__file__), 'README.rst')).read()
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name='django-tagconstants',
version='0.1',
packages=['tagconstants', 'tagconstants.templatetags'],
i... | nalourie/django-tagconstants | setup.py | setup.py | py | 1,227 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "os.path.join",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "os.chdir",
"line_number": ... |
22136340954 | from typing import List
class Solution:
def plusOne(self, digits: List[int]) -> List[int]:
s=''.join(map(str,digits))
k=str(int(s)+1)
k=k.zfill(len(s))
ans=list(map(int,k))
print(ans)
return ans
plusOne(1,[1,2,3])
a=Solution()
| pandey-ankur-au17/Python | coding-challenges/week06/day04/ccQ2.py | ccQ2.py | py | 299 | python | fa | code | 0 | github-code | 1 | [
{
"api_name": "typing.List",
"line_number": 5,
"usage_type": "name"
}
] |
1143306668 | #과제2 히스토그램 평활화
import numpy as np
import matplotlib.pyplot as plt
import imageio as io
img = io.imread('low_contrast.jpg')
des = np.zeros((img.shape), dtype=np.int16)
des_value = np.zeros(256, dtype=np.uint8)
hist, bins = np.histogram(img.flatten(), 256, [0,256])
cdf = hist.cumsum()
print(cdf)
for i in range(0, img... | konis123/image_processing_assign | school_190513/190513_4.py | 190513_4.py | py | 608 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "imageio.imread",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.int16",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "numpy.zeros",
"line_numb... |
13026115262 | # By submitting this assignment, I agree to the following:
# "Aggies do not lie, cheat, or steal, or tolerate those who do."
# "I have not given or received any unauthorized aid on this assignment."
#
# Name: ANDERSON WAYNE LOAN
# Section: 574
# Assignment: 4-9
# Date: 17/09/22
#
#imports libaries to make code easier
f... | AndersonLoan/Calculate-Roots | calculate_roots.py | calculate_roots.py | py | 1,026 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sympy.symbols",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "sympy.solve",
"line_number": 19,
"usage_type": "call"
}
] |
2581022894 | from time import time
import pysodium
import msgpack
import logging
import re
from kafkacrypto.utils import str_shim_eq, str_shim_ne, msgpack_default_pack
from kafkacrypto.keys import get_pks, SignPublicKey
class ProcessChainError(ValueError):
def __init__(self, message, printable):
super().__init__(message)
... | tmcqueen-materials/kafkacrypto | kafkacrypto/chain.py | chain.py | py | 12,215 | python | en | code | 14 | github-code | 1 | [
{
"api_name": "msgpack.unpackb",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "kafkacrypto.keys.get_pks",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "kafkacrypto.utils.str_shim_eq",
"line_number": 69,
"usage_type": "call"
},
{
"api_name":... |
24254939395 | from collections import deque
def orangesRotting(self, grid):
"""
:type grid: List[List[int]]
:rtype: int
"""
rotten = deque()
time = 0
freshCount = 0
ROWS = len(grid)
COLUMNS = len(grid[0])
for r in range(ROWS):
for c in range(COLUMNS):
if grid[r][c] == 2:... | NTiger07/Leet75-python | Graphs/994.RottingOranges.py | 994.RottingOranges.py | py | 1,084 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "collections.deque",
"line_number": 9,
"usage_type": "call"
}
] |
24265607850 | import cv2
import numpy as np
import matplotlib.pyplot as plt
def make_line(image, line_parameters):
slope = line_parameters[0]
intercept = line_parameters[1]
y1 = image.shape[0] #lane detection line starts from bottom of image
y2 = int(y1*(3/5)) #lane detection line ends at 3/5 of height o... | praveenvenkat06/Lane_Object_Detection | Lane_Object_Detection_Project/laneDetection.py | laneDetection.py | py | 4,971 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "numpy.array",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_RGB2GRAY",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "cv2.GaussianBlur",
... |
23150637820 | ###############################################################################
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
... | donovan-h-parks/UniteM | unitem/external/prodigal.py | prodigal.py | py | 14,478 | python | en | code | 16 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "subprocess.Popen",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "subprocess.PIPE",
"line_number": 57,
"usage_type": "attribute"
},
{
"api_name": "os.path.join"... |
5976061038 | import argparse
import csv
from collections import defaultdict, OrderedDict
import os
import pprint
import re
from ssg.constants import product_directories
import ssg.utils
import ssg.rule_yaml
import ssg.yaml
def escape_path(path):
return re.sub(r'[-\./]', '_', path)
def accounts_password_csv_to_dict(csv_line... | 0day-xc-Our/2020-Security-Guide | utils/migrate_template_csv_to_rule.py | migrate_template_csv_to_rule.py | py | 33,684 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "re.sub",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "collections.OrderedDict",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "collections.OrderedDict",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "os.path.basena... |
71112216994 | import os
import re
import argparse
import configparser
from AIPUBuilder.Optimizer.logger import opt_workflow_register, OPT_ERROR, OPT_INFO, OPT_WARN
from AIPUBuilder.Optimizer.framework import ALL_OPT_OP_DICT, ALL_OPT_QUANT_OP_DICT
from . cfg_fields import ALL_FIELDS, DEFAULT_FIELDS
class CfgParser(object):
def ... | Arm-China/Compass_Optimizer | AIPUBuilder/Optimizer/config/parser.py | parser.py | py | 11,634 | python | en | code | 18 | github-code | 1 | [
{
"api_name": "os.path.exists",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "AIPUBuilder.Optimizer.logger.OPT_ERROR",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "AI... |
12274171666 | import numpy as np
import cv2
#Description missing
cap = cv2.VideoCapture('cars2.mp4')
def make_coordinates(video, line_parameters):
slope, intercept = line_parameters
y1 = video.shape[0]
y2 = int(y1 * 0.5)
x1 = ((y1 - intercept) / slope)
x2 = ((y2 - intercept) / slope)
return np.array([x1, ... | Voyage-Self-Drive/Voyage | LinesAndArea.py | LinesAndArea.py | py | 3,121 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.polyfit",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.average",
"line_n... |
72358336355 | from typing import List
class Solution:
def countServers(self, grid: List[List[int]]) -> int:
r, c = len(grid), len(grid[0])
rowCnt, colCnt = [0] * r, [0] * c
for i in range(r):
for j in range(c):
if grid[i][j] == 1:
rowCnt[i] += 1
... | lyzsk/leetcode-solutions | python-solutions/1267-count-servers-that-communicate/solution.py | solution.py | py | 540 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "typing.List",
"line_number": 5,
"usage_type": "name"
}
] |
21377441019 | from __future__ import annotations
from itertools import product
import dask.array as da
import numpy as np
import pandas as pd
import xarray as xr
from skimage.draw import random_shapes
from skimage.measure import regionprops_table
def get_data(mode="numpy", shape=(3, 4, 256, 256)):
data = np.zeros(shape, dty... | jrussell25/dask-regionprops | tests/util.py | util.py | py | 1,699 | python | en | code | 4 | github-code | 1 | [
{
"api_name": "numpy.zeros",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "itertools.product",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "skimage.draw.random_sh... |
10869211389 | '''
Created on Nov 20, 2017
@author: csantoso
@reference : https://github.com/dialogflow/fulfillment-webhook-weather-python
'''
from __future__ import print_function
from future.standard_library import install_aliases
install_aliases()
from urllib.parse import urlparse, urlencode
from urllib.request import urlopen, R... | ccs1910/elsa-fulfilment | yahoo_weather_api.py | yahoo_weather_api.py | py | 1,665 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "future.standard_library.install_aliases",
"line_number": 9,
"usage_type": "call"
}
] |
38719852186 | #!/usr/bin/env python
# coding: utf-8
# In[5]:
get_ipython().system('pip install opencv-python')
# In[2]:
import numpy as np
import cv2
cap = cv2.VideoCapture(r'C:\Users\ASUS\Desktop\WorldWar.mp4')
while(cap.isOpened()):
ret, frame = cap.read()
gray = cv2.cvtColor(frame,1)
cv2.imshow('frame',gray... | mztaljeh/opencv | video .py | video .py | py | 999 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "cv2.imshow",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "cv2.waitKey",
"line_numb... |
9464396727 | from django.shortcuts import render_to_response, get_object_or_404
from ask.models import question, answer
from django.contrib.auth.models import User
from django.http import HttpResponseRedirect, HttpResponse
from ask.forms import questionForm, answerForm
import datetime
from django.contrib.auth.forms import UserCreat... | Trizalio/alexeyWebProject | ask/views.py | views.py | py | 11,017 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "ask.models.question.objects.all",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "ask.models.question.objects",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "ask.models.question",
"line_number": 13,
"usage_type": "name"
},
{
... |
69905808034 | import numpy as np
import cv2
import sys
def get_click(event, x, y, flags, param):
if event == cv2.EVENT_LBUTTONDOWN:
print(x, y)
def main():
if len(sys.argv) == 1: # pass the device number
cap = cv2.VideoCapture(0)
else:
try:
cap = cv2.VideoCapture(int(sys.argv[1])... | tttamaki/lecture_code | ImageProcessing/opencv/2-2-capture_click.py | 2-2-capture_click.py | py | 897 | python | en | code | 18 | github-code | 1 | [
{
"api_name": "cv2.EVENT_LBUTTONDOWN",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "cv2.VideoCapture",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "cv2.VideoCap... |
70643890275 | import sys
import os
import json
from candidate_dictionary import candidates
from handle_file_dict import handle_dict
from twitter_client import get_twitter_client
root = 'timelines/'
def get_retweets(tweet):
retweets = tweet.get('retweet_count', [])
#print("The number of retweets is: {}".format(retweets))
return... | azaidi06/twitter_analysis | tweet_stats.py | tweet_stats.py | py | 1,071 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "handle_file_dict.handle_dict",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "os.path.join",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "json.loads",
... |
9491554968 | import os
import logging
import datetime as dt
class SingletonType(type):
_instances = {}
def __call__(cls, *args, **kwargs):
# Only create a new instance if one does not exist
if cls not in cls._instances:
cls._instances[cls] = super(SingletonType, cls).__call__(*args, **kwargs)
... | rahulmsys/automation | lib/logger.py | logger.py | py | 2,328 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.environ.get",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
... |
15849092722 | import json
from typing import List, Any
import os
import sys
from copy import deepcopy
def get_data_folder() -> str:
root_folder = os.path.dirname(sys.modules['__main__'].__file__)
data_folder = f'{root_folder}/data'
os.makedirs(data_folder, exist_ok=True)
return data_folder
def load_json_list(file... | hungntit/python-jwt-example-api | utils/load_json_file.py | load_json_file.py | py | 2,697 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.path.dirname",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "sys.modules",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "os.makedirs",
"line_nu... |
21482840418 | import torch.nn as nn
import torch.nn.functional as F
import torch
class nn_resampler(nn.Module):
def __init__(self, n_input, n_output):
super(nn_resampler, self).__init__()
# encoder
self.enc1 = nn.Linear(n_input,75)
self.enc2 = nn.Linear(75,50)
self.enc3 = nn... | ajrheng/smc-nn-resampler | nn_resampler.py | nn_resampler.py | py | 1,316 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "torch.nn.Module",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "torch.nn.Linear",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_numb... |
72404397793 | from bs4 import BeautifulSoup
import requests
import json
from unicodedata import normalize
import os
from datetime import datetime
import re
remove_diacritics = lambda string : normalize("NFKD", string).encode('ASCII','ignore').decode('ASCII')
def update_clearing_file_names():
clearing_files = {}
html_pag... | holondo/B3_collector | utils/clearing_files_scraper.py | clearing_files_scraper.py | py | 2,223 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "unicodedata.normalize",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
... |
43419247130 | import time
import sys
import yaml
import numpy as np
import torch as t
import torch.nn.functional as F
sys.path.insert(0, './gnet')
from g_init import set_optimizer_g
opts = yaml.safe_load(open('./tracking/options.yaml','r'))
def g_pretrain(model, model_g, criterion_g, pos_data):
# Evaluate mask
n = pos_da... | abnerwang/py-Vital | gnet/g_pretrain.py | g_pretrain.py | py | 2,470 | python | en | code | 35 | github-code | 1 | [
{
"api_name": "sys.path.insert",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "yaml.safe_load",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "torch.zeros",
"line_nu... |
3946316334 | # -*- coding: utf-8 -*-
"""
PAnM-S: Model for autotrophic growth of mixed culture photoautotrophic
and photoheterotrophic bacteria with sulfide as electron donor from:
F. Egger, T. Hulsen, S. Tait, D. J. Batstone,
Autotrophic sulfide removal by mixed culture purple phototrophic bacteria,
Water Research 182 (202... | fegger/PPB-MOD-AUT-S | PAnM-S.py | PAnM-S.py | py | 14,800 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "dataclasses.dataclass",
"line_number": 50,
"usage_type": "name"
},
{
"api_name": "scipy.optimize.root_scalar",
"line_number": 178,
"usage_type": "call"
},
{
"api_name": "math.log10",
"line_number": 180,
"usage_type": "call"
},
{
"api_name": "scipy.i... |
26553103154 | from flask_app.config.mysqlconnection import connectToMySQL
from flask import flash
from flask_app.controllers.users import User
class Show:
def __init__(self, data):
self.id = data['id']
self.title = data['title']
self.network = data['network']
self.release_date = data['release_dat... | OhJackie21/Python-Practice | practice/tvshow/flask_app/models/show.py | show.py | py | 3,261 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "flask_app.config.mysqlconnection.connectToMySQL",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "flask_app.controllers.users.User",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "flask.flash",
"line_number": 48,
"usage_type": "call"
... |
40894969872 | import time
import gpiozero
import gpiozero.pins.rpigpio
import click
from loguru import logger
from rich.console import Console
from rich.table import Table
# zone = bcm pin
zones = dict()
zones[1] = 17 # 11 gpio0
zones[2] = 18 # 12 gpio1
zones[3] = 27 # 13 gpio2
zones[4] = 22 # 15 gpio3
zones[5] = 23 # ... | why-pengo/sprinkler | scripts/zone_tool.py | zone_tool.py | py | 3,351 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "gpiozero.OutputDevice",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "gpiozero.pins.rpigpio.RPiGPIOFactory",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "gpiozero.pins",
"line_number": 31,
"usage_type": "attribute"
},
{
"api... |
72410673635 | import asyncio
from argparse import ArgumentParser
import datetime as dt
from typing import Optional
from time import monotonic
import aiohttp
import pandas as pd
import requests
from pydantic import BaseSettings, BaseModel
class Date(BaseModel):
year: int
month: int
day: int
class Config:
o... | online-lyceum/async_lyceum_creator | lesson_creator/main2.py | main2.py | py | 7,148 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pydantic.BaseModel",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "pydantic.BaseModel",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "pydantic.BaseSe... |
36861341863 | import argparse
import os
import pathlib
import shlex
import subprocess
import tempfile
import typing
from logzero import logger
import pysam
import vcfpy
from .config import BamExtractConfig, DEFAULT_GENOME_RELEASE
from ..common import GenomeRelease, SITES_VCFS
from ..exceptions import SampleNameGuessingError
from .... | holtgrewe/clin-qc-tk | qctk/bam/extract.py | extract.py | py | 8,410 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "config.BamExtractConfig",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "models.vcf.Site",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "models.... |
9416815920 | """
Heizungsregelung Exporter
Started: 5.4.2023
see: https://trstringer.com/quick-and-easy-prometheus-exporter/
Possible parameters:
Environment variables:
- POLLING_INTERVAL_SECONDS -> default value: 5
- APP_PORT -> default value: 42424
- EXPORTER_PORT ... | mneuroth/heizungsregelung-public | heizung_exporter.py | heizung_exporter.py | py | 7,589 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "socket.socket",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "socket.AF_INET",
"line_number": 42,
"usage_type": "attribute"
},
{
"api_name": "socket.SOCK_STREAM",
"line_number": 42,
"usage_type": "attribute"
},
{
"api_name": "selectors.E... |
43858548346 | import requests
# your code here
response=requests.get("https://assets.breatheco.de/apis/fake/sample/project_list.php")
proyects = response.json()
proyect1 = proyects[1]
print(proyect1["name"])
proyects_names=[]
for proyect in proyects:
proyects_names.append(proyect["name"])
print(proyects_names)
| SilMontes/python-http-requests-api-tutorial-exercises | exercises/06-project-list/app.py | app.py | py | 303 | python | es | code | 0 | github-code | 1 | [
{
"api_name": "requests.get",
"line_number": 4,
"usage_type": "call"
}
] |
33479963348 | from PIL import Image
from lib.prediction_processing import denormalize_bbox
from lib.logging_config import logger
def get_crop(image, bbox, extension_factor=None, angle=0, resize_w=None, patchwork=False):
"Takes a pil image"
w = image.size[0]
h = image.size[1]
if bbox is not None:
# for tag/... | Deepomatic/workflows-sa-lib | deepomatic/workflows/sa/image_processing.py | image_processing.py | py | 1,991 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "lib.prediction_processing.denormalize_bbox",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "lib.logging_config.logger.debug",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "lib.logging_config.logger",
"line_number": 35,
"usage_type": "... |
31669461633 | import time
import base64
import hmac
def generator(user_key, expire=2 * 60 * 60):
token_header = 'dsf132cqwdsfsdafrewdcsveqrasc3reqsdvsdcdrdsvdx'
ts_str = str(time.time() + expire)
ts_byte = ts_str.encode("utf-8")
hmac_token_header = hmac.new(token_header.encode('utf-8'), ts_byte, 'sha1').he... | yaolixin-creater/UI | code-v1/autoTestPlatform/apps/user/auth_token.py | auth_token.py | py | 2,366 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "time.time",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "hmac.new",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "hmac.new",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "base64.urlsafe_b64encode",
"line_numbe... |
43182715341 | import zipfile,rarfile
from zipfile import ZipFile
def unzip(zip_file_path,pwd,target_path):
zip_file = support_gbk(zipfile.ZipFile(zip_file_path))
zip_list = zip_file.namelist()
for f in zip_list:
if pwd != None:
zip_file.extract(f,target_path,pwd.encode("utf-8"))
else:
... | MapleNe/SaltZip-For-Android | sfa/library/Core/Zip/zip.py | zip.py | py | 861 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "zipfile.ZipFile",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "rarfile.RarFile",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "zipfile.ZipFile",
"line_number": 17,
"usage_type": "name"
}
] |
72092613794 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('main', '0011_city_office'),
]
operations = [
migrations.AddField(
model_name='scholluser',
name='off... | andriyl1993/course_work | main/migrations/0012_scholluser_office.py | 0012_scholluser_office.py | py | 421 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.AddField",
"line_number": 14,
"usage_type": "call"
},
{
... |
12047436942 | from dataclasses import dataclass, field
import transformers
import datasets
import tqdm.auto as tqdm
import os
import math
@dataclass
class TokenizeArguments:
dataset_path: str = field()
save_fol: str = field()
rank: int = field()
world_size: int = field()
tokenizer_path: str = field(default="met... | zphang/minimal-llama | minimal_llama/hyper/tokenize_flan.py | tokenize_flan.py | py | 1,667 | python | en | code | 447 | github-code | 1 | [
{
"api_name": "dataclasses.field",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "dataclasses.field",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "dataclasses.field",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "dataclasses.fie... |
11721013436 | from setuptools import find_packages, setup
def get_lines(relative_path):
with open(relative_path) as f:
return f.readlines()
INSTALL_REQUIRES = get_lines("requirements.txt")
setup(
name="ecci",
version="2.0.2",
author="Data Science - DSI APHP",
author_email="thomas.petitjean-ext@aphp.f... | aphp-datascience/study-collaborative-workflow-nlp | ecci/setup.py | setup.py | py | 494 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "setuptools.setup",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "setuptools.find_packages",
"line_number": 18,
"usage_type": "call"
}
] |
25037508638 | from fastapi import FastAPI, APIRouter, Depends, HTTPException
from ..db import users_crud, auth_crud, matches_crud, profile_crud,anime_crud
from ..schemas.matches_schema import Matches
from pydantic import BaseModel
import random
#from .. import files
router = APIRouter(
prefix="/user",
tags=["user"],
re... | konn1ehuang/Backend | app/routers/users.py | users.py | py | 4,851 | python | en | code | null | github-code | 1 | [
{
"api_name": "fastapi.APIRouter",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "db.auth_crud.check_uuid_user_existence",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "db.auth_crud",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "... |
40151074581 | from typing import List, Any, Optional
from fastapi import APIRouter, Depends, Response
from sqlalchemy.orm import Session
import crud
import schemas
from api import deps
from services import DBTableService
router = APIRouter()
@router.get('/', response_model=List[schemas.DBTableInDB])
def read_db_tables(
resp... | mifercre/auto-dq | backend/api/endpoints/db_tables.py | db_tables.py | py | 1,574 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "fastapi.APIRouter",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "fastapi.Response",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.orm.Session",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "typing.Opti... |
18992750458 | # -*- coding: utf-8 -*-
"""
Created by: Rishabh Gupta
Description: To update corn, soybean, and potato cultivars in *.CUL file
"""
from typing import Optional, Union
def update_corn_cultivar(param: Union[str,dict],
cul_srcdir: str, cul_dstdir: str) -> None:
'param can be dictionary of parameters ... | AgroClimaticTools/dssat-pylib | dssatpylib/util_cultivar.py | util_cultivar.py | py | 7,334 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "typing.Union",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "typing.Union",
"line_number": 59,
"usage_type": "name"
},
{
"api_name": "typing.Union",
"line_number": 124,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_n... |
22493893152 | import streamlit as st
import sklearn
import joblib
model = joblib.load('Coursera Review Sentiment')
st.title('Coursera Sentiment')
ip = st.text_input('Enter your review')
op = model.predict([ip])
if st.button('Predict'):
temp = op[0]
if temp==5:
st.title("Loved It! (Rating: 5)")
elif temp==4:
st.title("I... | AmreshSinha/Sentiment-Analysis-Major-Project-ML | app.py | app.py | py | 539 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "joblib.load",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "streamlit.title",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "streamlit.text_input",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "streamlit.button",
... |
14797687487 | import torch
import torch.nn as nn
from torch.nn import init
from torch.optim import lr_scheduler
from typing import Dict, Any
from copy import deepcopy
from i2iTranslation.constant import NORM_CFG
###############################################################################
# Helper Functions
#####################... | AI4SCR/VirtualMultiplexer | i2iTranslation/models/networks.py | networks.py | py | 21,560 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "typing.Dict",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "typing.Any",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "copy.deepcopy",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "torch.nn.InstanceNorm2d",
"l... |
17610873425 | # -*- coding: utf-8 -*-
"""
Created on Sun Nov 11 14:19:15 2018
@author: Arunodhaya
"""
import torch
import pandas as pd
from torch.utils.data import dataset
def crt_emb(df):
df['thal']=df['thal'].replace({3:0,6:1,7:2})
df['slope']=df['slope'].replace({1:0,2:1,3:2})
df['exercise_induced_angin... | rajagurunath/CategoricalEmbedding | pred_inference.py | pred_inference.py | py | 1,644 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "torch.utils.data.dataset.Dataset",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "torch.utils.data.dataset",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "torch.FloatTensor",
"line_number": 26,
"usage_type": "call"
},
{
"... |
2190214220 |
from sklearn.model_selection import StratifiedKFold
import numpy as np
from dsp.utils import Timer
class CrossValidator:
debug = False
def __init__(self, Examples, Labels, model, model_train_eval,
n_folds=10, batch_size=100, epochs=100):
"""CrossValidator(Exa... | vyshakbellur/Recurrent-Neural-Network-Architectures | classifier/crossvalidator.py | crossvalidator.py | py | 3,546 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sklearn.model_selection.StratifiedKFold",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "dsp.utils.Timer",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "n... |
26100104371 | from flask import Flask, render_template, request, jsonify
from config.default import SECRET_KEY, UPLOAD_DIR, HOST, PORT
from utils import validate
from utils.custom_log import log_msg
from werkzeug.utils import secure_filename
from utils.data_constructor import build_data_to_insert
from utils.db_helper import select_r... | praveencali2017/file_uploader_fr | uploader_back_end/controller.py | controller.py | py | 1,997 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "flask.Flask",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "config.default.SECRET_KEY",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "config.default.UPLOAD_DIR",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "flask... |
44047520749 | import preprocess_images
from constants import *
#tf and tf keras
import tensorflow as tf
import keras
# Helper libraries
import numpy as np
import matplotlib.pyplot as plt
from sklearn.model_selection import train_test_split
import json
#imports needed to build model
from keras.models import Sequential,Input,Model... | KhazanahAmericasInc/waste-classifier | cnn_trainer.py | cnn_trainer.py | py | 10,205 | python | en | code | 4 | github-code | 1 | [
{
"api_name": "preprocess_images.load_dataset",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "preprocess_images.load_dataset",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 37,
"usage_type":... |
17144892623 | from django.shortcuts import render, get_object_or_404, redirect
from .forms import QuestionForm, TestCreateForm
from Test_Designing.models import Test,QuestionSet,Question,StudentResult
from Result_Analysis.models import Teacher,Student
from django.contrib import messages
from django.forms import formset_factory
from ... | BrijeshBumrela/Scholaris | Scholaris/Test_Designing/views.py | views.py | py | 8,626 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "Result_Analysis.models.Teacher.objects.get",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "Result_Analysis.models.Teacher.objects",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "Result_Analysis.models.Teacher",
"line_number": 17,
... |
42699274096 | import random
import time
import math
import matplotlib.pyplot as plt
from copy import deepcopy
COLORS = ['\33[31m', '\33[35m', '\33[33m', '\33[36m'] # colors in the console
MAPCOLORS = {"red": "lightcoral", "green": "seagreen", "blue": "turquoise", "purple": "mediumpurple"} # colors in the graph
RESET = '\033[0m'
RE... | Nastionagr/Bachelor-University-Projects | Projects (Python)/KNN-algorithm/program.py | program.py | py | 8,748 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "math.dist",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "copy.deepcopy",
"line_number": 70,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 83,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_num... |
31653910747 | import codecs
import os
import re
import json
from collections import defaultdict
from nlplingo.annotation.ace import AceAnnotation
from nlplingo.annotation.serif import to_lingo_doc
from nlplingo.text.text_theory import Document
from nlplingo.annotation.idt import process_idt_file
from nlplingo.annotation.enote impor... | BBN-E/nlplingo | nlplingo/annotation/ingestion.py | ingestion.py | py | 13,495 | python | en | code | 4 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.path.basename",
"line_number": 84,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 84,
"usage_type": "attribute"
},
{
"api_name": "codecs.open",
"li... |
42614751433 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Author: Bertrand256
# Created on: 2021-04
from __future__ import annotations
import hashlib
import logging
import re
import sys
import threading
import time
from datetime import datetime
from enum import Enum
from typing import Callable, Optional, List, Dict, Any, Tuple
... | Bertrand256/dash-masternode-tool | src/app_main_view_wdg.py | app_main_view_wdg.py | py | 123,464 | python | en | code | 69 | github-code | 1 | [
{
"api_name": "enum.Enum",
"line_number": 44,
"usage_type": "name"
},
{
"api_name": "enum.Enum",
"line_number": 51,
"usage_type": "name"
},
{
"api_name": "logging.getLogger",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtWidgets.QWidget",
"... |
13043454998 | """A list of changes to an emulated device for verification purposes."""
import sys
import threading
from collections import namedtuple
import csv
from time import monotonic
StateChange = namedtuple("StateChange", ['time', 'tile', 'property', 'value', 'string_value'])
class EmulationStateLog(object):
"""A threa... | iotile/coretools | iotileemulate/iotile/emulate/virtual/state_log.py | state_log.py | py | 3,752 | python | en | code | 14 | github-code | 1 | [
{
"api_name": "collections.namedtuple",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "threading.Lock",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "time.monotonic",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "sys.version_info"... |
28549650826 | """
Created by plough on 2019/1/21.
"""
import re
import sys
from app.utils.callback.WXBizMsgCrypt import WXBizMsgCrypt
from app.utils.wx_manager import WxManager
from config import WxConf, WxBotConf
class WxBotHelper:
wx_crypt = WXBizMsgCrypt(WxConf.APP_TOKEN, WxConf.APP_ENCODING_AES_KEY, WxConf.CORP_ID)
c... | plough/wxbot | app/utils/wxbot_helper.py | wxbot_helper.py | py | 5,431 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "app.utils.callback.WXBizMsgCrypt.WXBizMsgCrypt",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "config.WxConf.APP_TOKEN",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "config.WxConf",
"line_number": 13,
"usage_type": "name"
},
... |
16722909802 | """
The main script that controls the deployment towards Azure.
It is executed inside the container 'live-deploy'
"""
import os
import time
import json
def getEnvDataAsDict(path: str) -> dict:
with open(path, 'r') as f:
return dict(tuple(line.replace('\n', '').split('=')) for line
in f.readl... | martinkarlssonio/azure-dataplatform | main.py | main.py | py | 6,847 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "os.system",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": ... |
19323588275 | import psycopg2
import sqlalchemy
import sqlalchemy_utils
import pytest
from intergov.conf import env_postgres_config
from intergov.repos.api_outbox.postgres_objects import Base, Message
from tests.unit.domain.wire_protocols import test_generic_message as test_messages
def pg_is_responsive(ip, docker_setup):
try:... | bizcubed/intergov | tests/integration/repos/api_outbox/postgres/conftest.py | conftest.py | py | 2,226 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "psycopg2.connect",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "psycopg2.OperationalError",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "intergov.conf.env_postgres_config",
"line_number": 32,
"usage_type": "call"
},
{
... |
7455908050 | import sys
try:
metaID = sys.argv[1]
except Exception:
metaID = None
import json
import uuid
taskParamMap = {}
taskParamMap["taskName"] = str(uuid.uuid4())
taskParamMap["userName"] = "pandasrv1"
taskParamMap["vo"] = "atlas"
taskParamMap["taskPriority"] = 100
taskParamMap["architecture"] = "i686-slc5-gcc43-opt... | PanDAWMS/panda-jedi | pandajedi/jeditest/addTestTaskParamToDEFT.py | addTestTaskParamToDEFT.py | py | 2,257 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "sys.argv",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "uuid.uuid4",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "uuid.uuid4",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "uuid.uuid4",
"line_number": 33... |
23601928367 | import psycopg2
from psycopg2.extras import Range
import json
from db_config import db_config
def main():
# Connect to PostgreSQL
conn = psycopg2.connect(**db_config)
# Create a cursor object
cur = conn.cursor()
# Load state from genesis
with open('genesis.json') as f:
data = json.loa... | gitopia/gitopia-subgraph-scripts | main.py | main.py | py | 3,236 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "psycopg2.connect",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "db_config.db_config",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "json.load",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "psycopg2.extras.Range",
... |
14194317798 | import numba
import numpy as np
import pytest
try:
import cupy # type: ignore
except ImportError:
cupy = None
import tdgl
from tdgl.geometry import box, circle
from tdgl.solver.options import SolverOptionsError
@pytest.mark.parametrize("current", [5.0, lambda t: 10])
@pytest.mark.parametrize("field", [0, 1... | loganbvh/py-tdgl | tdgl/test/test_solve.py | test_solve.py | py | 5,348 | python | en | code | 24 | github-code | 1 | [
{
"api_name": "tdgl.SolverOptions",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "pytest.raises",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "tdgl.solver.options.SolverOptionsError",
"line_number": 44,
"usage_type": "argument"
},
{
"api_n... |
24010628131 | import os
from flask import Flask, flash, request, redirect, url_for
from werkzeug.utils import secure_filename
import model.apply_model as am
UPLOAD_FOLDER = '/Users/Fabian/Projects/HackBay2019/hail_model/request_data'
ALLOWED_EXTENSIONS = set(['txt', 'pdf', 'png', 'jpg', 'jpeg', 'gif'])
app = Flask(__name__)
app.c... | Diadochokinetic/HackBay2019 | hail_model/test_request.py | test_request.py | py | 2,544 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "flask.Flask",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "flask.request.method",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "flask.request.fil... |
5948752164 | from django.db import models
from comments.models import Comment
from authentication.models import User
# Create your models here.
class Reply(models.Model):
created = models.DateTimeField(auto_now_add=True)
user = models.ForeignKey(
User, related_name='replies', on_delete=models.CASCADE)
comment ... | LadyHazle2010/ReactDjangoYoutube | backend/replies/models.py | models.py | py | 564 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.db.models.Model",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.db.models.DateTimeField",
"line_number": 8,
"usage_type": "call"
},
{
"api_name... |
23770881786 | import openai
import time
import requests
import re
import json
import logging
# Set up your API keys here or load them from environment variables
# Define a class for managing the dialog context
class DialogContext:
def __init__(self, maxlen=5):
self.maxlen = maxlen
self.history = []
def add... | nky001/LLM | chatbot_utils.py | chatbot_utils.py | py | 3,266 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "time.strftime",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "openai.ChatCompletion.create",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "openai.ChatCompl... |
45798614001 | #!/usr/bin/env python3
import argparse
import json
import os.path
from collections import OrderedDict
import numpy as np
import pandas as pd
import xarray as xr
from dateutil.parser import parse
from pkg_resources import resource_filename
from aodntools import __version__
from aodntools.timeseries_products import ag... | aodn/python-aodntools | aodntools/timeseries_products/hourly_timeseries.py | hourly_timeseries.py | py | 25,463 | python | en | code | 8 | github-code | 1 | [
{
"api_name": "pkg_resources.resource_filename",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pkg_resources.resource_filename",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 34,
"usage_type": "call"
},
{
"... |
20520651806 | import os.path
import warnings
from django_docker_helpers.config import ConfigLoader
from . import __version__
# --------------- PATHS ---------------
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
PROJECT_NAME = os.path.basename(BASE_DIR)
PROJECT_PATH = os.path.abspath(os.path.dirname(__fil... | atten/dictionary-trainer-bot | dictrainer/settings.py | settings.py | py | 7,040 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.path.path.dirname",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path.path",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "os.path",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "os.path.path.abspath",... |
39948100628 | """
Module for defining the database models for representing items.
"""
from typing import Optional, List, Any
from pydantic import BaseModel, Field, ConfigDict, field_validator, AwareDatetime
from inventory_management_system_api.models.catalogue_item import Property
from inventory_management_system_api.models.custom... | ral-facilities/inventory-management-system-api | inventory_management_system_api/models/item.py | item.py | py | 1,868 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pydantic.BaseModel",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "inventory_management_system_api.models.custom_object_id_data_types.CustomObjectIdField",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 18... |
13452235470 | #!/usr/bin/env python3
import math
import os,sys,subprocess, multiprocessing, re, getopt
import shutil
import struct
import hashlib
import glob
ASSETS_DIR = "../deploy/assets"
APPS_DIR = "../deploy/apps"
TUTS_DIR = "../deploy/tutorials"
NO_CONV_NAME = ".b4w_no_conv"
WHITE = "\033[97m"
YELLOW = "\033[93m"
RED = ... | PauloBarbeiro/Blend4Web | scripts/converter.py | converter.py | py | 12,743 | python | en | code | null | github-code | 1 | [
{
"api_name": "os.path.splitext",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 38,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number... |
9788791815 | import argparse
import matplotlib.pyplot as plt
from model_sir import Simulation
from model_animation import Animation, LineAnimation
from model_plot import plot_simulation
from model_animation import get_ylim
def main(*args):
"""Command line entry point.
$ python runsim_model.py ... | norman-cheen/Covid19-Epidemic-Modelling | modified_model/model_runsim.py | model_runsim.py | py | 4,091 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "model_sir.Simulation",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "model_animation.get_ylim",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": ... |
27286953893 | import pytest
from cleanlab.datalab.internal.data import Data
from cleanlab.datalab.internal.data_issues import DataIssues
class TestDataIssues:
labels = ["B", "A", "B"]
label_name = "labels"
@pytest.fixture
def data_issues(self):
data = Data(data={self.label_name: self.labels}, label_name=se... | cleanlab/cleanlab | tests/datalab/test_data_issues.py | test_data_issues.py | py | 1,965 | python | en | code | 7,004 | github-code | 1 | [
{
"api_name": "cleanlab.datalab.internal.data.Data",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "cleanlab.datalab.internal.data_issues.DataIssues",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pytest.fixture",
"line_number": 10,
"usage_type": "a... |
17880564669 | import logging
import sys
import json
import IOUtil
import numpy as np
import re
from nltk.tokenize import word_tokenize
DATAPATH = "/Users/zxj/Google 云端硬盘/models_and_sample/"
BRACKETS = re.compile("[\[\]]")
def read_file(file_path, preprocess):
content_list = []
try:
with open(file_path, encoding="u... | contemn1/sentence_evaluation | word_dict_test.py | word_dict_test.py | py | 3,623 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "re.compile",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "logging.error",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 28,... |
15999910432 | import os
import sys
import requests
from bs4 import BeautifulSoup
import colorama
tabs = []
tags = ['p', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'a', 'ul', 'li', 'head', 'title', "div"]
# write your code here
while True:
text = input()
dots = [pos for pos, char in enumerate(text) if char == '.']
if len(dots) ... | Arpita2005/Programming | Python/Python/Browser/Browser.py | Browser.py | py | 1,579 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "sys.argv",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "os.path.exists",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "os.mkdir",
"line_number... |
29587463507 | import os
import json
import torch
import pandas as pd
from wilds.datasets.wilds_dataset import WILDSDataset
from wilds.common.utils import map_to_id_array
from wilds.common.metrics.all_metrics import F1, multiclass_logits_to_pred
from wilds.common.grouper import CombinatorialGrouper
REGIONS = {'Beijing': 0, 'Liaoning... | coastalcph/fairlex | dataloaders/cail_dataset.py | cail_dataset.py | py | 6,203 | python | en | code | 10 | github-code | 1 | [
{
"api_name": "wilds.datasets.wilds_dataset.WILDSDataset",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "torch.LongTensor",
"line_number": 66,
"usage_type": "call"
},
{
"api_name": "wilds.common.metrics.all_metrics.F1",
"line_number": 96,
"usage_type": "call"
... |
43749345101 | import csv
import sys
import json
import os
cwd = os.getcwd()
def minsToDegrees (minsString, isLongitude):
parts = minsString.split("-")
parts[0] = float(parts[0])
parts[1] = float(parts[1])
parts[2] = float(parts[2][:parts[2].find(" ")])
degrees = parts[0] + (parts[1] / 60) + (parts[2] / 3600... | tristan-morrison/airspace-fixes | toCSV.py | toCSV.py | py | 1,801 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.getcwd",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "os.path.isdir",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 28,
... |
25431418879 | from collections import Counter
import sys
input = sys.stdin.readline
def is_row_high(arr: list[list]) -> bool:
return len(arr) >= len(arr[0])
def correct(arr: list[list], r: int, c: int, k: int) -> bool:
if len(arr) >= r and len(arr[0]) >= c:
return arr[r-1][c-1] == k
return False
de... | reddevilmidzy/baekjoonsolve | 백준/Gold/17140. 이차원 배열과 연산/이차원 배열과 연산.py | 이차원 배열과 연산.py | py | 2,210 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "sys.stdin",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "collections.Counter",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "collections.Counter",
"line_number": 47,
"usage_type": "call"
}
] |
9977912268 | import time
import cv2
import os,random
import subprocess
import numpy as np
from keras.models import model_from_json
from keras.preprocessing import image
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
#load model
model = model_from_json(open("fer.json", "r").read())
#load weights
model.load_weights('fer.h5')
size = 4
# We... | adarshsingh2001/Music-Recommender-through-emotion-detection | music_player_webcam.py | music_player_webcam.py | py | 6,490 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "os.environ",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "keras.models.model_from_json",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "cv2.CascadeClassifier",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "cv2... |
15509216773 |
import petsc4py
import sys
import numpy as np
import matplotlib.pyplot as plt
petsc4py.init(sys.argv)
from petsc4py import PETSc
DX = 0.02
DT = 0.01
T0 = 1.0
N_POINTS = int(1/DX)+1
N_TIME_STEPS = int(T0/DT)+1
AA = 1.0
ALPHA = 0.01
CC = AA*DT/DX
SS = ALPHA*DT/DX**2
def exact_solution(x, t: float):
c1 = 0.025/n... | swayli94/notes | docs/source/05-examples/01-pdes/codes/example_02.py | example_02.py | py | 3,705 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "petsc4py.init",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "numpy.sqrt",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "numpy.exp",
"line_number": 2... |
27848174064 | # LEnet 网络
################################
# linear input
# linear 16
# linear 64
# linear 100
###################################
import torch.nn as nn
# 定义网络结构
class Net(nn.Module):
def __init__(self, input, output):
super(Net, self).__init__()
self.l1 = nn.Sequential(
nn.Linear(... | BobbyBBY/machine-learning-course | Net.py | Net.py | py | 675 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "torch.nn.Module",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "torch.nn.Sequential",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"lin... |
27509355015 | import datetime
import braintree
from django.db.models.query import QuerySet
from django.http import HttpRequest
from django.test import RequestFactory, TestCase, Client
from django.urls import reverse
import json
from unittest.mock import Mock, patch
from wagtail.models import Site
from accounts.factories import User... | WesternFriend/WF-website | subscription/tests.py | tests.py | py | 24,841 | python | en | code | 46 | github-code | 1 | [
{
"api_name": "django.test.TestCase",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "braintree.Configuration",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "braintree.Environment",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name"... |
24156552472 | import sys
import os
import time
from multiprocessing import Pool, cpu_count
import numpy as np
import matplotlib.pyplot as plt
from torch import nn
sys.path.insert(0, 'graph_enc_dec')
from graph_enc_dec import data_sets
from graph_enc_dec import graph_clustering as gc
from graph_enc_dec import architecture
from graph... | vmtenorio/GIGOArchitecture | graph_enc_dec_basic_test.py | graph_enc_dec_basic_test.py | py | 5,144 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sys.path.insert",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "multiprocessing.cpu_count",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "graph_enc_dec.d... |
30995288356 | # use open cv to show new images from AirSim
from PythonClient import *
import cv2
import time
import sys
client = AirSimClient('127.0.0.1')
# get depth image
result = client.setImageTypeForCamera(0, AirSimImageType.Depth)
time.sleep(1) # give it time to render
help = False
while True:
# becau... | geevargs/AirSim | PythonClient/camera.py | camera.py | py | 919 | python | en | code | null | github-code | 1 | [
{
"api_name": "time.sleep",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "cv2.imdecode",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "cv2.IMREAD_UNCHANGED",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "cv2.imshow",
"l... |
25460129335 | import logging
import os
import shutil
import tempfile
import unittest
from telemetry.core import util
from telemetry.core import exceptions
from telemetry import decorators
from telemetry.internal.browser import browser as browser_module
from telemetry.internal.browser import browser_finder
from telemetry.internal.pl... | hanpfei/chromium-net | third_party/catapult/telemetry/telemetry/internal/browser/browser_unittest.py | browser_unittest.py | py | 10,334 | python | en | code | 289 | github-code | 1 | [
{
"api_name": "telemetry.testing.browser_test_case.BrowserTestCase",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "telemetry.testing.browser_test_case",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "telemetry.decorators.Enabled",
"line_number": 34... |
25378245657 | import pyramid.httpexceptions as exc
from pyramid.response import Response
from werkzeug.test import Client
from werkzeug.wrappers import BaseResponse
from opentelemetry.configuration import Configuration
class InstrumentationTest:
def setUp(self): # pylint: disable=invalid-name
super().setUp() # pylin... | NathanielRN/clone-opentelemetry-python | instrumentation/opentelemetry-instrumentation-pyramid/tests/pyramid_base_test.py | pyramid_base_test.py | py | 1,563 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "opentelemetry.configuration.Configuration._reset",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "opentelemetry.configuration.Configuration",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "pyramid.httpexceptions.HTTPInternalServerError",
"... |
5905755203 | import contextlib
import enum
import functools
import hashlib
import math
import re
from datetime import datetime
from functools import cache, lru_cache, wraps
from typing import Tuple
import redis
from django.conf import settings
from django.contrib.auth.decorators import user_passes_test
from django.db.models import... | teammatehunt/tph-site | server/puzzles/utils.py | utils.py | py | 9,749 | python | en | code | 4 | github-code | 1 | [
{
"api_name": "django.http.JsonResponse",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "functools.wraps",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "functools.lru_cache",
"line_number": 79,
"usage_type": "call"
},
{
"api_name": "puzzles.... |
25971869559 | from django.urls import path
from . import views
urlpatterns = [
path('',views.mainpage),
path('signup',views.signup),
path('login',views.login),
path('register',views.register.as_view()),
path('loginuser',views.loginuser.as_view()),
path('friends',views.handlerfiends),
path('transactions',... | hks74123/moneytracker | mainapp/urls.py | urls.py | py | 904 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.urls.path",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
15763631512 | import pygame as pg
import random as rnd
class Couleurs:
BLACK = (0,0,0)
RED = (255,0,0)
BLUE = (0, 0, 200)
class Jeu:
def __init__(self):
"""
Ici, on initialise des variables utiles
"""
self.TAILLE_ECRAN = 500 # pixels
self.FPS = 15
self.COULEUR_ARRIERE_PLAN = Couleurs.BLUE
self.LE_JEU_TOURNE = Tr... | Mistergix/deficode | dist/assets/code/seance5/pygame_template.py | pygame_template.py | py | 1,699 | python | fr | code | 0 | github-code | 1 | [
{
"api_name": "pygame.init",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "pygame.displa... |
31216842139 | import json
from flask import request
from pymongo.errors import DuplicateKeyError
from werkzeug.urls import url_encode
from biocontainers.biomongo.helpers import InsertContainers
from biocontainers.common.models import MongoTool, _CONSTANT_TOOL_CLASSES, MongoToolVersion, MongoWorkflow, SimilarTool
from biocontainer... | BioContainers/biocontainers-backend | biocontainers_flask/server/controllers/ga4_gh_controller.py | ga4_gh_controller.py | py | 25,340 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "biocontainers.common.models.MongoTool.get_tools",
"line_number": 73,
"usage_type": "call"
},
{
"api_name": "biocontainers.common.models.MongoTool",
"line_number": 73,
"usage_type": "name"
},
{
"api_name": "biocontainers_flask.server.controllers.utils.get_facets",
... |
38573736688 | import json
from django.http import HttpResponse
from django.views.generic import View
from .models import ClientRecord
class CreateView(View):
def post(self, request):
message = request.body.decode('utf-8')
user_agent = request.META['HTTP_USER_AGENT']
username = str(request.user)
... | wfmexpert/verme-logs | applogs/views.py | views.py | py | 586 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "django.views.generic.View",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "json.dumps",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "models.ClientRecord",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "django.http.H... |
35635175211 | import numpy as np
import matplotlib.pyplot as plt
pi =np.pi
fs = 10000
ts = 1/fs
t = np.arange(0, 1-ts, step=ts)
# signal parameters
A = 5 # amplitude
f0 = 10.834095034955 # frequency
phi = -pi/8 # phase
signal = A*np.cos(2*pi*f0*t + phi)+0.5*np.cos(2*pi*200.234*t + phi)+np.random.rand(len(t))
# DTFT evaluated... | HOLL95/General_electrochemistry | EIS/freq_tests.py | freq_tests.py | py | 563 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "numpy.pi",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "numpy.arange",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "numpy.cos",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.random.rand",
"line_numb... |
19945551153 | """
Michael Miller and Kurt Tuohy
CS 598 Deep Learning for Healthcare - University of Illinois
Final project - Paper Results Verification
4/4/2022
Reproduce the k-Nearest Neighbors models in the paper below.
Do both classification and regression.
Paper: "Natural language processing for cognitive therapy: Extracting... | mich1eal/cs598_dl4hc | src/knn.py | knn.py | py | 12,293 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "psutil.virtual_memory",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.random.seed",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 55,
"usage_type": "attribute"
},
{
"api_name": "cog_globals... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.