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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3533303117 | from googleapiclient.discovery import build
from googleapiclient.errors import HttpError
from youtube_cache import YoutubeCache
from datetime import timedelta
import configparser
class YoutubeHandler:
def __init__(self):
config = configparser.ConfigParser()
config.read('info.ini')
self.__a... | glahiator/for_how_long | youtube_handler.py | youtube_handler.py | py | 4,783 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "configparser.ConfigParser",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "googleapiclient.discovery.build",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "youtube_cache.YoutubeCache",
"line_number": 14,
"usage_type": "call"
},
{
... |
5242424160 | from min.utils.functional import AllExtensions
from min.utils.extend import activate
from min.utils import EnumVisitor, expect
from min.objspace import MinValue
import logging
logger = logging.getLogger(__name__)
activate(*AllExtensions)
class FuncInterpreter(EnumVisitor):
def __init__(self, func, module, builtin... | tuomas56/portfolio | python/min/src/min/interpreter.py | interpreter.py | py | 3,912 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "min.utils.extend.activate",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "min.utils.functional.AllExtensions",
"line_number": 8,
"usage_type": "name"
},
{
"api_n... |
10930948256 | from datetime import datetime
from alertaclient.utils import DateTime
class History:
def __init__(self, id, event, **kwargs):
self.id = id
self.event = event
self.severity = kwargs.get('severity', None)
self.status = kwargs.get('status', None)
self.value = kwargs.get('val... | alerta/python-alerta-client | alertaclient/models/history.py | history.py | py | 3,894 | python | en | code | 27 | github-code | 6 | [
{
"api_name": "datetime.datetime.utcnow",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "alertaclient.utils.DateTime.parse",
"line_number": 72,
"usage_type": "call"
},
{
"api_... |
70555621309 | # -*- coding:utf-8 –*- #
import cv2
from matplotlib import pyplot as plt
import numpy as np
src_image = cv2.imread("data/1.jpg")
print(src_image.shape)
src_fig = plt.figure()
plt.title("src_image")
plt.imshow(src_image)
gray_image = cv2.cvtColor(src_image, cv2.COLOR_RGB2GRAY)
plt.figure()
plt.title("gray_image")
plt... | zhmc/inpaint_demo | inpaint_simple.py | inpaint_simple.py | py | 886 | python | en | code | 6 | github-code | 6 | [
{
"api_name": "cv2.imread",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.... |
40407462603 | from PyQt5.QtCore import pyqtSignal, Qt, QDate, QMutex
from PyQt5 import uic, QtWidgets
from PyQt5.QtWidgets import (QApplication, QDialog, QPushButton, QTableWidget,
QTableWidgetItem, QAbstractItemView, QHeaderView, QMenu,
QActionGroup, QAction, QMessageBox)
im... | Panconquesocl/LAS | Frontend/PagoDiario.py | PagoDiario.py | py | 4,254 | python | es | code | 0 | github-code | 6 | [
{
"api_name": "PyQt5.uic.loadUiType",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "PyQt5.uic",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "parametros.RUTA_UI_PAGO_DIARIO",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "Py... |
5465016282 | #!/usr/bin/env python
# coding: utf-8
# # 백준 9020번
# ## 골드바흐의 추측 실버1
# ### 소수 응용 문제 2
# In[27]:
import random
T = int(input()) # 테스트 케이스
for i in range(T):
n = int(input())
a = [False,False] + [True]*(n-1)
primes=[]
for i in range(2,n+1):
if a[i]:
primes.append(i)
for j in ... | DodamKing/baekjoon_sol | 기본수학2/9020.py | 9020.py | py | 2,790 | python | ko | code | 0 | github-code | 6 | [
{
"api_name": "random.shuffle",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "itertools.combinations_with_replacement",
"line_number": 55,
"usage_type": "call"
}
] |
1241460731 | import pytest
from flask_package import create_app, db
from flask_package.models import User
@pytest.fixture(scope='module')
def test_client():
flask_app = create_app()
# Create a test client using the Flask application configured for testing
with flask_app.test_client() as testing_client:
# Esta... | Takuya-Akuzawa/flask_template | tests/conftest.py | conftest.py | py | 865 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask_package.create_app",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pytest.fixture",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "flask_package.db.create_all",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "fla... |
44914396256 | #!/usr/bin/env python3
#/*
# Measures time from servo[n].angle being sent to that command being resolved
# - without power to servo motors
# - with power to servo motors
# -from angles 0-180 [1]; save the results in an
#
# x: angle
# y_1: delay without power
# y_2: delay with power
# */
import numpy as np
impor... | Quark3e/Chromebook-projects | projects/proj_Hexclaw/measureDelays.py | measureDelays.py | py | 3,210 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "busio.I2C",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "board.SCL",
"line_number": 31,
"usage_type": "argument"
},
{
"api_name": "board.SDA",
"line_number": 31,
"usage_type": "argument"
},
{
"api_name": "adafruit_pca9685.PCA9685",
... |
20427022238 | """
All rights reserved.
--Yang Song (songyangmri@gmail.com)
--2021/1/7
"""
import time
import logging
import os
class Log(object):
'''
封装后的logging
'''
def __init__(self, logger=None, log_cate='search'):
'''
指定保存日志的文件路径,日志级别,以及调用文件
将日志存入到指定的文件中
'''
# 创建一个... | salan668/FAE | SA/Utility/MyLog.py | MyLog.py | py | 1,870 | python | zh | code | 121 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "time.strftime",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "os.getcwd",
"l... |
22425635676 | from __future__ import print_function
import pickle
import os.path
from googleapiclient.discovery import build
from google_auth_oauthlib.flow import InstalledAppFlow
from google.auth.transport.requests import Request
from pathlib import Path
import json
# If modifying these scopes, delete the file token.pickle.
SCOPES... | tamanobi/upload-google-drive | misc.py | misc.py | py | 4,805 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.path.path.exists",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "os.path.path",
"line_number": 36,
"usage_type": "attribute"
},
{
"api_name": "os.path",
"line_number": 36,
"usage_type": "name"
},
{
"api_name": "pickle.load",
"line... |
27147330924 | import json
import uuid
from .resource import Resource
from .resource_type import ResourceType
class LayoutDataResource(Resource):
'''
Represents the Layout data resource used to create PDF reports
'''
def __init__(self, layout_data, layout_data_resource_name = None):
'''
Initializes a... | dynamicpdf-api/python-client | dynamicpdf_api/layout_data_resource.py | layout_data_resource.py | py | 1,521 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "resource.Resource",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "resource_type.ResourceType.LayoutData",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "resource_type.ResourceType",
"line_number": 22,
"usage_type": "name"
},
{... |
26776371810 | """Manages which scan levels are run for packages."""
from typing import Any, Union
import yaml
from statick_tool.package import Package
class Profile: # pylint: disable=too-few-public-methods
"""Manages which scan levels are run for packages."""
def __init__(self, filename: str) -> None:
"""Init... | sscpac/statick | statick_tool/profile.py | profile.py | py | 1,305 | python | en | code | 66 | github-code | 6 | [
{
"api_name": "yaml.safe_load",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "yaml.YAMLError",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "statick_tool.package.Package",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "typin... |
41072148199 | from django.shortcuts import render
from django.http.response import JsonResponse
from rest_framework.parsers import JSONParser
from rest_framework import status
from main_oms.models import Orders
from main_oms.serializers import TutorialSerializer
from rest_framework.decorators import api_view
@api_view(['GET', ... | marto-karanja/oms-current | main_oms/views.py | views.py | py | 2,651 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "main_oms.models.Orders.objects.all",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "main_oms.models.Orders.objects",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "main_oms.models.Orders",
"line_number": 16,
"usage_type": "name"
... |
16328349942 | import unittest
import numpy
import cupy
try:
import cupy.cuda.cudnn as libcudnn
cudnn_enabled = True
modes = [
libcudnn.CUDNN_ACTIVATION_SIGMOID,
libcudnn.CUDNN_ACTIVATION_RELU,
libcudnn.CUDNN_ACTIVATION_TANH,
]
import cupy.cudnn
except ImportError:
cudnn_enabled = Fal... | hknerdgn/cupy | tests/cupy_tests/test_cudnn.py | test_cudnn.py | py | 2,908 | python | en | code | null | github-code | 6 | [
{
"api_name": "cupy.cuda.cudnn.CUDNN_ACTIVATION_SIGMOID",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "cupy.cuda.cudnn",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "cupy.cuda.cudnn.CUDNN_ACTIVATION_RELU",
"line_number": 11,
"usage_type": "a... |
805680732 | import os
import lpips
import torch
from tqdm import tqdm, trange
from PIL import Image
from transformers import CLIPTextModel, CLIPTokenizer
def update_from_embedding(model_path, placeholder_token, embedding, save_path):
'''
model_path = "/root/sd-v1-5"
placeholder_token = "<liukanshan>"
embedding = ... | HelloMrGeorge/Multi_Textual_Inversion | utils.py | utils.py | py | 5,755 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "transformers.CLIPTokenizer.from_pretrained",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "transformers.CLIPTokenizer",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "transformers.CLIPTextModel.from_pretrained",
"line_number": 18,
"us... |
73730901306 | import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
from scipy.interpolate import griddata
from Klein_Gordon_model_tf import Sampler, Klein_Gordon
if __name__ == '__main__':
def u(x):
"""
:param x: x = (t, x)
"""
return x[:, 1... | PredictiveIntelligenceLab/GradientPathologiesPINNs | Klein Gordon/Klein_Gordon.py | Klein_Gordon.py | py | 7,130 | python | en | code | 134 | github-code | 6 | [
{
"api_name": "numpy.cos",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.pi",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "numpy.pi",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "numpy.cos",
"line_number": ... |
43003503532 | from google.appengine.ext import webapp
from google.appengine.ext.webapp import template
from google.appengine.api import users
from models import *
import facebook
import config
import os
import yaml
class BaseRequestHandler(webapp.RequestHandler):
def get_template(self,template_name):
return os.pat... | ata/emotiongraph | base.py | base.py | py | 2,956 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "google.appengine.ext.webapp.RequestHandler",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "google.appengine.ext.webapp",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "os.path.join",
"line_number": 14,
"usage_type": "call"
},
... |
30517376374 | from .data import Asteroid
class NeoWsFeedPage:
"""Class representing the paginated NEO API feed endpoint.
Asteroids are sorted into a dict by date.
Attributes
----------
json: :class:`dict`
JSON data returned by the API.
element_count: :class:`int`
Number of Asteroids on this... | nwunderly/aionasa | aionasa/neows/paginators.py | paginators.py | py | 3,484 | python | en | code | 7 | github-code | 6 | [
{
"api_name": "data.Asteroid._from_list",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "data.Asteroid",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "data.Asteroid._from_list",
"line_number": 84,
"usage_type": "call"
},
{
"api_name": "data.... |
1432049960 | #!/usr/bin/env python3.7
from typing import List, Optional, Callable, Tuple, Any, Dict
from datetime import datetime
import argparse
import numpy as np
from utils import get_format
from PIL import Image
import matplotlib.pyplot as plt
import multiprocessing
def extract_features(file_name: str) -> list:
im = Imag... | anananacr/p09-utils | scripts/archive/extract_features.py | extract_features.py | py | 3,140 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "PIL.Image.open",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "numpy.asarray",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.sum",
"line_number":... |
38374419834 | from django.core.files.uploadedfile import InMemoryUploadedFile
from work.models import Project
from PIL import Image
from io import BytesIO
def create_project():
"""
Returns a newly created Project object that has already been saved in the db.
"""
return Project.objects.create(name='Test', url_slug... | todaatsushi/atsushi.dev | work/tests/helper.py | helper.py | py | 1,089 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "work.models.Project.objects.create",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "work.models.Project.objects",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "work.models.Project",
"line_number": 13,
"usage_type": "name"
},
... |
34160524026 | # -*- coding: utf-8 -*-
"""
Created on Thu Jun 22 13:37:16 2017
@author: Owner
うまく使えない
"""
import sys
from cx_Freeze import setup, Executable
base = None
copyDependentFiles = True
silent = True
includefiles = ["tmp.jpg", "log.txt"]
includes = ["matplotlib.pyplot"]
packages = ["wx", "math", "seaborn", "os"]
excludes ... | ogata-k/efieldGUI | setup.py | setup.py | py | 732 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sys.platform",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "cx_Freeze.setup",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "cx_Freeze.Executable",
"line_number": 30,
"usage_type": "call"
}
] |
15621200097 | import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
from data import make_tf
from model import create_model
import tensorflow as tf
test_dataset, test_steps = make_tf('test_dataset.csv', 64)
train_dataset, train_steps = make_tf('train_dataset.csv', 64)
model = create_model()
# model.summary()
model.compile(loss=tf.kera... | SaeidehMsv/ResNet50_COCO | main.py | main.py | py | 909 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.environ",
"line_number": 2,
"usage_type": "attribute"
},
{
"api_name": "data.make_tf",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "data.make_tf",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "model.create_model",
"line... |
15203233157 | from django.shortcuts import render
from rest_framework.views import APIView
from exercise.managers.exercise_manager import ExerciseManager
from rest_framework.response import Response
import csv
import os
from django.http import HttpResponse
from .models import *
# Create your views here.
class GetBodyParts(APIView):... | GautamDhiman/MyFitPal_server | exercise/views.py | views.py | py | 2,728 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "rest_framework.views.APIView",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "exercise.managers.exercise_manager.ExerciseManager",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "rest_framework.response.Response",
"line_number": 27,
"us... |
37888982323 | from abc import ABCMeta, abstractmethod
from typing import List
from api.dto.BookingDto import CreateBookingDto, EditBookingDto, GetBookingDto, ListBookingDto
from api.models import Booking
class BookingRepository(metaclass=ABCMeta):
@abstractmethod
def create_booking(self, model: CreateBookingDto):
... | laken11/nites | api/repositories/BookingRepository.py | BookingRepository.py | py | 4,678 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "abc.ABCMeta",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "api.dto.BookingDto.CreateBookingDto",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "abc.abstractmethod",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "abc.... |
30971768365 | from euphorie.client import model
from osha.oira.statistics.model import create_session
from osha.oira.statistics.utils import UpdateStatisticsDatabases
import argparse
import datetime
import logging
import sys
log = logging.getLogger(__name__)
def update_statistics():
logging.basicConfig(stream=sys.stderr, le... | euphorie/osha.oira | src/osha/oira/statistics/scripts.py | scripts.py | py | 2,597 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "logging.basicConfig",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "sys.stderr",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "argparse.Argume... |
41181849090 | """
Created on Thu Apr 15 08:02:19 2021
@author: Javier Duarte, Rohan Shenoy, UCSD
"""
import numpy as np
import mplhep as hep
import pickle
import os
import pandas as pd
import itertools
import sys
sys.path.insert(0, "../")
import matplotlib
import matplotlib.pyplot as plt
from utils.wafer import plot_wafer as p... | cmantill/Ecoder | ae_emd_cnn.py | ae_emd_cnn.py | py | 9,580 | python | en | code | null | github-code | 6 | [
{
"api_name": "sys.path.insert",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "pandas.read_csv",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "numpy.float64",
"li... |
35728968876 | import copy
import functools
import json
import math
import numpy as np
import os
import random
import torch
import torch.utils.data as data
from PIL import Image
import slowfast.utils.logging as logging
from . import ava_helper as ava_helper
from . import cv2_transform as cv2_transform
from . import transform as tra... | serre-lab/pred_gn | slowfast/datasets/intphys.py | intphys.py | py | 22,066 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "slowfast.utils.logging.get_logger",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "slowfast.utils.logging",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "PIL.Image.open",
"line_number": 32,
"usage_type": "call"
},
{
"api_name"... |
14222106770 | import logging
import os
import time
import libsubmit.error as ep_error
from libsubmit.channels import LocalChannel
from libsubmit.launchers import AprunLauncher
from libsubmit.providers.cobalt.template import template_string
from libsubmit.providers.cluster_provider import ClusterProvider
from libsubmit.utils import ... | Parsl/libsubmit | libsubmit/providers/cobalt/cobalt.py | cobalt.py | py | 8,642 | python | en | code | 14 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "libsubmit.providers.cluster_provider.ClusterProvider",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "libsubmit.utils.RepresentationMixin",
"line_number": 23,
"usage_ty... |
33186044632 | #!/usr/bin/env python
from traceback import print_exc
import logging
import argparse
import urllib2
import hashlib
import os.path
import os
import sys
import json
REGISTRY_URL = 'https://registry.npmjs.org'
MIRROR_PATH = '/var/lib/mirror/npm'
MIRROR_URL = 'https://archive.example.com/npm'
PACKAGE_BLACKLIST = ('error:... | JeremyGrosser/npm-mirror | npm_mirror.py | npm_mirror.py | py | 7,712 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logging.StreamHandler",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "logging.Formatter",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "logging.INF... |
74523929788 | #!/usr/bin/python3
"""
Start database
"""
from model_state import Base, State
from sqlalchemy import (create_engine)
from sqlalchemy.orm import sessionmaker
from sys import argv
if __name__ == "__main__":
"""
Conect and quering database
"""
sql = 'mysql+mysqldb://{}:{}@localhost:3306/{}'
engine =... | BrunoGuerraS/holbertonschool-higher_level_programming | 0x0F-python-object_relational_mapping/10-model_state_my_get.py | 10-model_state_my_get.py | py | 726 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sqlalchemy.create_engine",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "sys.argv",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "model_state.Base.metadata.... |
74370399867 | # https://github.com/fireflyes/Team-32-tsum-
import cv2
import numpy as np
import time
import sys
import TeensySerialMouse
from PyQt5.QtWidgets import (QWidget, QHBoxLayout,
QLabel, QApplication)
from PyQt5.QtGui import QPixmap, QImage
from PyQt5 import QtCore
#import all user created functions and classes
from s... | David-Keller/Team-32-tsum- | Team-32/Team_32.py | Team_32.py | py | 5,683 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "PyQt5.QtWidgets.QWidget",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtWidgets.QHBoxLayout",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtGui.QPixmap",
"line_number": 26,
"usage_type": "call"
},
{
"api_name"... |
22469461229 | from unittest.mock import MagicMock
import pytest
from belvo import resources
def test_tax_status_create(api_session):
tax_status = resources.TaxStatus(api_session)
tax_status.session.post = MagicMock()
tax_status.create("fake-link-uuid", attach_pdf=True)
tax_status.session.post.assert_called_with(... | belvo-finance/belvo-python | tests/unit/test_tax_status.py | test_tax_status.py | py | 769 | python | en | code | 15 | github-code | 6 | [
{
"api_name": "belvo.resources.TaxStatus",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "belvo.resources",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "unittest.mock.MagicMock",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "belvo... |
29924796271 |
#write error log to /home/pi/Desktop/Anvil/uplink_dev/Pides_VIEWER/error_log.txt.txt
import datetime
# Uplink imports:
try:
import utils.mySQL_utils as sql
from Globals import ERROR_LOG_PATH, DEBUG_LOG_PATH
# Local host imports:
except (ModuleNotFoundError) as mod_err:
print("trying local host imports i... | JonWakefield/Anvil-Web-App | server_code/utils/log_errors_utils.py | log_errors_utils.py | py | 1,373 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "datetime.datetime.now",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "Globals.ERROR_LOG_PATH",
"line_number": 31,
"usage_type": "argument"
},
{
"api_name"... |
38034992942 | ###################################
# !/usr/bin/python
# Python 3.10
# (C) 2023 admi.tech
###################################
# Import main packages
import openai
# Connection Key to openAI
openai.api_key = "key" # add your own key - go to web and generate one
# FUNCTIONS
def chat_with_bot(question1):
"""Funct... | ADMItech/Easy-OpenAI-Chatbot | main.py | main.py | py | 799 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "openai.api_key",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "openai.ChatCompletion.create",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "openai.ChatCompletion",
"line_number": 17,
"usage_type": "attribute"
}
] |
24945654695 | import threading
import multiprocessing
import functools
from time import perf_counter, perf_counter_ns, sleep
from random import randint
""" PROGRAM CHALLENGE
Threads vs. Concurrent Processes
The challenge is to write a Python script to do some Benchmarking. You'll need to use ... | tiagobka/PythonBenchmark | main.py | main.py | py | 6,147 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "time.perf_counter",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "time.perf_counter",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "functools.wraps",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "time.sleep",
... |
71602834108 | import click
import json
@click.command()
@click.argument('file_number', type=int)
def calc_avg(file_number):
file_name = "/Users/justinniestroy-admin/Documents/Work/Randall Data/houlter data//BEA/UVA" + str(file_number).rjust(4, '0') + ".bea"
with open(file_name) as f:
data = f.read()
data_li... | jniestroy/cwl_parser | workflows/calc_avg.py | calc_avg.py | py | 725 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "click.echo",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "click.command",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "click.argument",
"line_number"... |
24554515246 | import xml.etree.cElementTree as x2j
import json
import sys
with open("/var/www/vhosts/onlyrams.co.uk/httpdocs/data/json/rams.json") as json_format_file:
d = json.load(json_format_file)
len = len(d)
r = x2j.Element("root")
i=0
while i < len:
print(d[i]["title"])
x2j.SubElement(r,"title").text = d[i]["titl... | IslayAnderson/onlyrams | data/convert.py | convert.py | py | 642 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "json.load",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "xml.etree.cElementTree.Element",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "xml.etree.cElementTree",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "xml.etre... |
6212981541 | #!/usr/bin/env python
import requests
import configs
import time
from urllib.parse import urljoin
import re
MODE_LOGIN=191
MODE_LOGOUT=193
MODE_LIVE=192
HEADERS = {
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:73.0) Gecko/20100101 Firefox/73.0',
'Accept': '*/*',
'Accept-L... | j4w3d/pyCrclient | auto_login.py | auto_login.py | py | 2,049 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "urllib.parse.urljoin",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "configs.BASE_URL",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "configs.USERNAME",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "time... |
38340926646 | from django.shortcuts import render, redirect
from django.contrib import messages
from .models import Contact
from django.core.mail import BadHeaderError, send_mail
from django.http import HttpResponse, HttpResponseRedirect
def contact(request):
if request.method == 'POST':
listing_id = request.POST['listi... | zlatangoralija/btre_realestate | contacts/views.py | views.py | py | 1,858 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "models.Contact.objects.all",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "models.Contact.objects",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "models.Contact",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": ... |
30328202011 | """
Definition of views.
"""
from datetime import datetime
from django.shortcuts import render
from django.http import HttpRequest
from app import models
def home(request):
"""Renders the home page."""
assert isinstance(request, HttpRequest)
return render(
request,
'app/index.html',
... | geuryssierra/GKIphotography-Django-Web-App | GKIphotography/app/views.py | views.py | py | 2,271 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.http.HttpRequest",
"line_number": 12,
"usage_type": "argument"
},
{
"api_name": "django.shortcuts.render",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 18,
"usage_type": "call"
},
{
"api_nam... |
35968443486 | from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.support.ui import Select
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support import ui
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import... | surbhikhandelwal/Python-Projects | CBS/cbs.py | cbs.py | py | 9,697 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "selenium.webdriver.ChromeOptions",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 22,
"usage_type": "call"
},
{
"api... |
44711465227 |
import numpy as np
# import matplotlib.pyplot as plt
import tensorflow as tf
from optimization.gpu import build_pd_graph
from tfwavelets.nodes import idwt2d
from tfwavelets.dwtcoeffs import db4
from PIL import Image
from datetime import datetime
import time
im = np.array(Image.open('./tumor.png'))/255.
im_scaled = n... | krimha/thesis_code | run.py | run.py | py | 2,644 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.array",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "PIL.Image.open",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "numpy.array",
"line_number":... |
23652878351 | import sys
from sqlalchemy import create_engine
import sqlite3
import pandas as pd
import numpy as np
import re
import pickle
import nltk
nltk.download(['punkt', 'wordnet','stopwords'])
from nltk.tokenize import word_tokenize
from nltk.corpus import stopwords
from nltk.stem.wordnet import WordNetLemmatizer
from sklea... | lukazaplotnik/Disaster-Response-Pipeline | models/train_classifier.py | train_classifier.py | py | 7,622 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "nltk.download",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.create_engine",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "pandas.read_sql_table",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "re.sub",... |
21616316969 | import json
from datetime import timedelta
from typing import Any
from django.utils import timezone
from utils.testing.base import ExtendedGraphQLTestCase
from utils.testing.factories.listings import ListingFactory
from utils.testing.factories.organizations import MembershipFactory, OrganizationFactory
from utils.test... | rubberdok/indok-web | backend/apps/listings/tests.py | tests.py | py | 8,525 | python | en | code | 17 | github-code | 6 | [
{
"api_name": "utils.testing.base.ExtendedGraphQLTestCase",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "utils.testing.factories.users.UserFactory",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "utils.testing.factories.users.UserFactory",
"line_number... |
28184272006 | import json
from graphqlclient import GraphQLClient
def missing_tags(required, existing):
return list(required - existing)
def lambda_handler(event, context):
client = GraphQLClient("https://api.faros.ai/v0/graphql")
client.inject_token("Bearer {}".format(event["farosToken"]))
query = '''{
... | ferhimedamine/faros-apps | apps/ec2-missing-instance-tags/app.py | app.py | py | 1,046 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "graphqlclient.GraphQLClient",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 27,
"usage_type": "call"
}
] |
477710593 | import os
import json
import pandas as pd
from tqdm import tqdm
from Predictor.Utils.Vocab import Vocab
from sklearn.model_selection import train_test_split
import shutil
from Predictor.Utils.DataPipe import ByteDataPipe
from configs import DefaultConfigs
import fire
import pickle as pk
import ipdb
config = DefaultCo... | CNDPlab/ByteCup2018 | preprocess_byte.py | preprocess_byte.py | py | 6,745 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "configs.DefaultConfigs",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_nu... |
18804597157 | import logging
import re
import subprocess
from contextlib import suppress
from pkg_resources import DistributionNotFound, get_distribution
log = logging.getLogger(__name__)
__version__ = "0.0.0.dev"
with suppress(DistributionNotFound):
__version__ = get_distribution("pymilvus").version
def get_commit(versi... | milvus-io/pymilvus | pymilvus/client/__init__.py | __init__.py | py | 1,790 | python | en | code | 744 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "contextlib.suppress",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pkg_resources.DistributionNotFound",
"line_number": 14,
"usage_type": "argument"
},
{
"api_n... |
19768744312 | # This code will invoke another lambda
import boto3, json
def lambda_handler(event, context):
#change region_name as per the destination lambda function region
invokeLam = boto3.client("lambda", region_name="ap-south-1")
payload = {"message": "Hiii, Lambda has been invoked."}
#For InvocationType = "Requ... | praveenshrivas/Lambda | Lambda-Source.py | Lambda-Source.py | py | 676 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "boto3.client",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 14,
"usage_type": "call"
}
] |
36274011227 | import random
import pygame
from ..commons import *
from ..constants import *
from .field import Field
class Level(object):
def __init__(self):
self.grid = None
self.enemies = []
self.enemy_search_dict = {}
self.way = []
self.possible_flowers = []
self.possible_dec... | Timtam/ggj17 | wavomizer/engine/level.py | level.py | py | 5,279 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "random.randint",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "random.choice",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "random.choice",
"line... |
31732989954 | import torch
from PIL import Image
from models import get_model
from torchvision.transforms import functional as TF
from torchvision.utils import make_grid
import io
def output_sr(input_image, modelname, saved_model):
device='cpu'
# load model classes
Model = get_model(modelname)
model = Model.load_fr... | onlyred/pl-SuperResolution | src/predict.py | predict.py | py | 829 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "models.get_model",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "io.BytesIO",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "PIL.Image.open",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_numb... |
70727530107 | import cv2
import numpy
imageFn = 'C:/Users/admin/Desktop/32fa828ba61ea8d3fcd2e9ce9e0a304e241f5803.jpg'
img = cv2.imread(imageFn, 1)
cv2.imshow('img', img)
imageInfo = img.shape
height, width, mode = imageInfo
# 跟灰度图相同大小的目标图
dst = numpy.zeros((height, width, 3), numpy.uint8)
for h in range(0, height):
for w in... | chenghaojun/OpenCV-TensorFlow | 图像基础/图片缩放/12-颜色风格.py | 12-颜色风格.py | py | 570 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "cv2.imread",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "cv2.imshow",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.uint8",
"line_number": 12,
... |
16293579042 | import datetime
import json
import logging
from time import strftime
import boto3
from botocore import exceptions
import parsedatetime as pdt
Logger = logging.getLogger()
Logger.setLevel(logging.INFO)
CW_C = boto3.client('cloudwatch')
SNS_C = boto3.client('sns')
S3_C = boto3.client('s3')
# services zumoco has permi... | zulily/aws_monitor | zumoco.py | zumoco.py | py | 17,513 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "boto3.client",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "boto3.client",
"... |
31178088744 | import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import sys
# Check if the correct number of arguments are given
if len(sys.argv) != 3:
print('Usage: python script.py [pmr] [mr]')
sys.exit()
pmr = sys.argv[1]
mr = sys.argv[2]
# Adjust the parameters below according to your needs
csv_... | HIIM-PERINEDO/zagreb_dhcp | dMRI/working_dMRI_only/heatmap_plotting.py | heatmap_plotting.py | py | 1,097 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "sys.argv",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "sys.exit",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 12,
... |
18610938675 | from threading import Thread
from time import sleep
import csv
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import requests
# from bs4 import BeautifulSoup
# with open('urls.txt', 'r') as fobj:
# hospitals = fobj.readlines()
hospitals = [
"GRANT MEMORIAL HOSPITAL" ,
"BROADDUS HOSP... | zh-cse18/Selenium_Webdriver_Operation | Collect all website link to a given institute name list.py | Collect all website link to a given institute name list.py | py | 2,824 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 61,
"usage_type": "name"
},
{
"api_name": "selenium.webdriver.common.keys.Keys.ENTER",
"line_number": 70,
"usage_type": "attribute"
}... |
22335520794 | # Bring in deps
import streamlit as st
from langchain.chat_models import ChatOpenAI
from langchain.prompts import PromptTemplate
from langchain.chains import LLMChain
# Initialization
debug = True
ccss = 'CCSS.ELA-LITERACY.W.4.9'
ccss_link = 'https://www.thecorestandards.org/ELA-Literacy/W/4/#CCSS.ELA-Literacy.W.4.... | forsel/writing-coach | app.py | app.py | py | 9,471 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "streamlit.title",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "streamlit.write",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "streamlit.session_state",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "streamli... |
36848374763 | import logging
from typing import List, Optional
import carla
import numpy as np
import random
from more_itertools import windowed, unique_justseen
from carla_real_traffic_scenarios import DT
from carla_real_traffic_scenarios.artificial_lane_change.controller import TeleportCommandsController
from carla_real_traffic_... | deepsense-ai/carla-real-traffic-scenarios | carla_real_traffic_scenarios/artificial_lane_change/scenario.py | scenario.py | py | 14,765 | python | en | code | 67 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.ceil",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "numpy.random.randint",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "numpy.random",
... |
37575438612 | from django.conf.urls import patterns, include, url
from django.contrib import admin
from django.views.generic.base import TemplateView
# Uncomment the next two lines to enable the admin:
admin.autodiscover()
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'flujosdetrabajo.views.home', name='home'),
... | bishma-stornelli/flujosdetrabajo | flujosdetrabajo/urls.py | urls.py | py | 794 | python | en | code | 7 | github-code | 6 | [
{
"api_name": "django.contrib.admin.autodiscover",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.contrib.admin",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.conf.urls.patterns",
"line_number": 9,
"usage_type": "call"
},
{
"api... |
4311420580 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Wed Jun 7 17:33:04 2017
@author: al
"""
import cv2
import numpy as np
from scipy import misc
from scipy.ndimage.interpolation import rotate
import matplotlib.pyplot as plt
def add_noise(image, intensity):
# add noise with a varying degree of intensity... | psrikanthm/satellite-image-classification | src/image_processing.py | image_processing.py | py | 1,975 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "numpy.random.randn",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "numpy.matrix.clip",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.matrix",... |
43140846971 | ''' Determine the relative position of object to reference
This is basically a rewrite of cspice_spkezr without having to remember
all the options to set
Inputs:
obj: target object name
reference: reference object name
et: either a single astropy Time object, a single et, a list of Time objects,
o... | mburger-stsci/nexoclom | nexoclom/solarsystem/relative_position.py | relative_position.py | py | 1,445 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "nexoclom.solarsystem.load_kernels.load_kernels",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "astropy.time.Time",
"line_number": 26,
"usage_type": "argument"
},
{
"api_name": "spiceypy.str2et",
"line_number": 27,
"usage_type": "call"
},
{
... |
17609266071 | from collections import OrderedDict
from apispec_drf.decorators import apispec_get_operation, apispec_post_operation
from django.conf import settings
from django.shortcuts import reverse
from django.utils.dateparse import parse_datetime
from django.views.generic.base import RedirectView
from rest_framework import stat... | reedu-reengineering-education/badgr-server | apps/backpack/badge_connect_api.py | badge_connect_api.py | py | 9,147 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "mainsite.models.BadgrApp.cached.get",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "mainsite.models.BadgrApp.cached",
"line_number": 34,
"usage_type": "attribute"
},
{
"api_name": "mainsite.models.BadgrApp",
"line_number": 34,
"usage_type": "nam... |
35470707287 | from flask import Blueprint, render_template, redirect, url_for, flash
from flask_login import login_required, current_user
from app.forms import DeleteForm
from database.database import get_db_connection
from database.models import (
Board,
CodeSubmission,
QList,
Comments,
OutputGameScore,
Dr... | HBNU-SWUNIV/come-capstone23-pse | 003 Code/codepse/app/user_profile.py | user_profile.py | py | 3,923 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.Blueprint",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "database.database.get_db_connection",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "database.models.Board",
"line_number": 25,
"usage_type": "argument"
},
{
"api... |
36535452443 | import torch
import torch.nn as nn
from torch.utils.data import DataLoader
from torch.utils.tensorboard.writer import SummaryWriter
from dataset import *
from visual import *
from support_functions import *
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
board = SummaryWriter("board")
train_dat... | jatiink/Image-Colorization-Pytorch | main.py | main.py | py | 2,642 | python | en | code | 2 | 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": "torch.utils.tensorb... |
73573188667 | import json
import os
from path import Path
import pandas as pd
import requests
import tqdm
import pathos
from decimal import Decimal
from trongrid import getBlockNumByTimeStamp
from sqlalchemy import create_engine
def get_next_assign_frozen_reward(assign_json, week = 4):
"""获取下一次方法的奖励中历史冻结部分"""
frozen_assign... | dpneko/pyutil | farm.py | farm.py | py | 12,815 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "json.loads",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "decimal.Decimal",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "decimal.Decimal",
"line_num... |
5261582386 | import torch
from torch import nn
from timm.models.layers import DropPath, Mlp
from einops import rearrange
class PatchEmbed(nn.Module):
"""2D Image to Patch Embedding"""
def __init__(self, img_size=(0, 0), dim_in=1280, embed_dim=768, norm_layer=None):
super().__init__()
H, W = img_size[0], i... | cyh-0/CAVP | models/visual/attn_module.py | attn_module.py | py | 5,811 | python | en | code | 86 | github-code | 6 | [
{
"api_name": "torch.nn.Module",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "torch.nn.Linear",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_numb... |
74771940987 | import logging
import os
import pandas as pd
from google.cloud import bigquery
# This env var is set automatically; see https://cloud.google.com/functions/docs/env-var#environment_variables_set_automatically
project_id = os.environ.get('GCP_PROJECT')
def from_gcs_trigger_to_bq(data, context, allowed_exts=("csv",))... | ZaxR/gcs_triggered_google_cloud_functions | main.py | main.py | py | 2,539 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "os.environ.get",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "os.environ.get",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_nu... |
26633024441 | import requests
import json
headers = {
'Content-Type': 'application/json',
'Authorization':'token=ad9c70d5ba181c3bd1389b4ddbb6ecf6b108bf10'
}
def get_meta_data(ticker):
url = "https://api.tiingo.com/tiingo/daily/()".format(ticker)
response = requests.get(url, headers=headers)
print(response.json... | sproutzesty/Stock-Trading | trading/stocks/tiingo.py | tiingo.py | py | 502 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 16,
"usage_type": "call"
}
] |
16643079867 | from typing import Tuple
class Line:
"""A line between two points. Used to measure scarring or other deformation
in vocal cords.
end1: point
first point to calc line Endpoint with smaller x value if x1 \neq x2
end2: point
second point to calc line. Endpoint with greater x if x1 \neq x2... | SurgicalPhotonics/dlc-generic-analysis | dlc_generic_analysis/geometries.py | geometries.py | py | 2,337 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "typing.Tuple",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "typing.Tuple",
"line_number": 20,
"usage_type": "name"
}
] |
14929681680 | import logging
from typing import List
from models.json.film_json import film_json
from models.json.people_json import people_json
from utilities.json_loaders import load_all_files, load_json_from_file
from logging_utils import logging_config
logging_config.config(logging.DEBUG)
logger = logging.getLogger("app_... | NetCoder99/python_star_wars | main.py | main.py | py | 2,040 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logging_utils.logging_config.config",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "logging_utils.logging_config",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "logging.DEBUG",
"line_number": 8,
"usage_type": "attribute"
},
{
"... |
72345975867 | import json
import csv
import os
class CreateBirthdayMeal:
def __init__(self):
__location__ = os.path.realpath(os.path.join(os.getcwd(), os.path.dirname(__file__)))
self.inputFile = os.path.join(__location__, 'bdayMeal.csv')
self.outputFile = os.path.join(__location__, 'bdayMeal.js')
... | bealesd/alanBirthday | loadBirthMealToArray.py | loadBirthMealToArray.py | py | 2,458 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.path.realpath",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.getcwd",
"line_number"... |
21970514578 | from selenium import webdriver
from fastapi import FastAPI, HTTPException
from api.functions import *
import api.config as config
from fastapi.middleware.cors import CORSMiddleware
app = FastAPI()
if config.dockerized:
print('app running on guvicorn fastapi')
origins = [
"https://etsify-for-sociality.n... | dopaminista/etsify-for-sociality | backend/api/main.py | main.py | py | 1,537 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "fastapi.FastAPI",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "api.config.dockerized",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "api.config",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "fastapi.middleware... |
24184645574 | """
Function for differentiable argmax.
Note that this function takes 1-d argmax along z(temporal)-axis,
for every spatial points (x, y).
Input: 3D volume (H, W, D)
Output: 2D plane (H, W)
"""
from utils.torch import *
import torch.nn.functional as F
"""
Numpy implementation for soft-argmax for check
"""
def soft... | marikoisogawa/OpticalNLOSPose | pose/utils/soft_argmax.py | soft_argmax.py | py | 1,397 | python | en | code | 17 | github-code | 6 | [
{
"api_name": "torch.nn.functional.softmax",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "torch.nn.functional",
"line_number": 41,
"usage_type": "name"
},
{
"api_name": "torch.nn.functional.arange",
"line_number": 42,
"usage_type": "call"
},
{
"api_na... |
36010754448 | import arcpy
import datetime
from datetime import datetime, date, time
input_folder = arcpy.GetParameterAsText(0)
inputfc = arcpy.GetParameterAsText(1)
rasterCol = arcpy.GetParameterAsText(2)
#Let us set the workspace into the output folder
arcpy.env.workspace = input_folder
cpt = 0
fields = arcpy.ListFiel... | Diffouo/Python-Data-Analysis | ImageToRaster.py | ImageToRaster.py | py | 1,894 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "arcpy.GetParameterAsText",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "arcpy.GetParameterAsText",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "arcpy.GetParameterAsText",
"line_number": 7,
"usage_type": "call"
},
{
"api_name"... |
32762947908 | from pylab import *
import argparse
from scipy import signal
import csv
import time
parser = argparse.ArgumentParser()
parser.add_argument('--file1',type=str,default='./h.csv',help="Path to the first csv file")
parser.add_argument('--file2',type=str,default='./x1.csv',help="Path to the Zadoff-Chu sequence")
args = par... | SumanthRH/EE2703-Applied-Programming-Lab | Assignment_10/assignment-10-EE17B032.py | assignment-10-EE17B032.py | py | 2,776 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "scipy.signal.freqz",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "scipy.signal",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "csv.reader",
... |
3313212583 | import pytest
import time
from selenium import webdriver
from src.pages.plp_page import PlpPage
from src.pages.home_page import HomePage
from test.base_test import BaseTest
negative_st = [' \t\t', '`~!@#$%^&*()_+-=\|}]{[}";:/".><,.']
st = ['Alaciadora Babyliss placas de nano titanium', 'BABYLISS', 'Bntmgp9557... | ainim/apex-sdet | test/test_search_bar.py | test_search_bar.py | py | 2,441 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "src.pages.home_page.HomePage",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pytest.fixture",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "src.pages.plp_page.PlpPage",
"line_number": 21,
"usage_type": "call"
},
{
"api_name":... |
38182544820 | import pygame
import numpy as np
import math
from settings import *
class gun():
def __init__(self, player, current_map, env) -> None:
self.current_map = current_map
self.env = env
self.name = "gun"
self.magazine_size = 20
self.reload_time = 1
self.fire_rate = 0.1
... | SlothRoss/dungeon-crawler | gun.py | gun.py | py | 5,712 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.array",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "pygame.transform.flip",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "pygame.transform",
... |
18660937710 | import torch
from read_input import get_dataset
data = get_dataset('training_dataset.mat')
max_vel = data['max_vel']
max_range = data['max_range']
Nr = data['Nr']
Nd = data['Nd']
no_of_channels = data['no_of_channels']
range_res = data['range_res']
vel_res = data['vel_res']
x_data = data['output']
ground_target_coord... | ayu023ban/btp_project | python/configuration.py | configuration.py | py | 888 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "read_input.get_dataset",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "torch.from_numpy",
"line_number": 16,
"usage_type": "call"
}
] |
74731708668 | from app.models import Tank, FuelPump, Fill
from app.serializers import TankSerializer, FuelPumpSerializer, FillSerializer, FillWithFuelPumpAndTankSerializer
from rest_framework import viewsets
from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework import status
from ... | LuannMateus/gas-station-backend | gas_station_api/app/views.py | views.py | py | 6,305 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "rest_framework.views.APIView",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "app.models.Tank.objects.all",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "app.models.Tank.objects",
"line_number": 17,
"usage_type": "attribute"
},
{
... |
9851911249 | import azure.functions as func
from ping3 import ping
def main(req: func.HttpRequest) -> func.HttpResponse:
address = req.params.get("address")
if address:
r = ping(address, timeout=10)
if r == "None":
result = "Timeout"
elif r == "False":
result = "Cannot r... | CDCgov/prime-reportstream | operations/app/functions/admin/PingAddress/ping_address.py | ping_address.py | py | 708 | python | en | code | 62 | github-code | 6 | [
{
"api_name": "azure.functions.HttpRequest",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "azure.functions",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "ping3.ping",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "azure.funct... |
18609453795 | import hmac, os, re, logging, datetime, urllib
from datetime import timedelta
from time import mktime
from google.appengine.api import memcache
from google.appengine.api import urlfetch
from google.appengine.ext import webapp
from google.appengine.ext.webapp import template
import settings
import feedgen
logging.get... | zh/atomgen | feed.py | feed.py | py | 4,099 | python | en | code | 5 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "google.appengine.ext.webapp.RequestHandler",
"line_number": 18,
"usage_type": "attribute"
},
{
... |
40770451251 | import sys
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.animation import FuncAnimation
from lib import *
def load_solution(filename):
solution = []
with open(filename) as f:
for line in f.readlines():
solution.append([int(x) for x in line.split()])
return solution... | tinosulzer/Hashcode2015 | visualise.py | visualise.py | py | 1,911 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.zeros",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 53,
"usage_type": "name"
},
{
"api_name": "matplotlib.a... |
36808350211 | import pandas as pd
from sklearn.linear_model import SGDClassifier
from sklearn.feature_extraction.text import TfidfVectorizer
import time
import sys
sys.path.insert(0, '..')
from assignment8.my_evaluation import my_evaluation
class my_model():
def fit(self, X, y):
# do not exceed 29 mins
self.pr... | prajwal2495/Job_Posting_Fake_or_Not_Prediction | project/project_hint.py | project_hint.py | py | 1,575 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sys.path.insert",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "sklearn.feature_extraction.text.TfidfVectorizer",
"line_number": 14,
"usage_type": "call"
},
{
"api_n... |
18620394027 | import pandas as pd
from keras.models import Sequential
from keras.layers import Dense, LSTM
import tensorflow as tf
import numpy as np
import dask as d
import dask.dataframe as dd
from tensorflow import feature_column
def df_to_dataset(dataframe, shuffle=True, batch_size=32, labels=True):
dataframe = da... | MichalReka/click-fraud-redesign | click_fraud.py | click_fraud.py | py | 5,746 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "tensorflow.data.Dataset.from_tensor_slices",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "tensorflow.data",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.data.Dataset.from_tensor_slices",
"line_number": 16,
"usage_ty... |
42657254797 | import asyncio
import time
import pytest
from aioworkers.queue.timeout import TimestampQueue, UniqueQueue
@pytest.fixture
def config_yaml():
return """
q:
cls: aioworkers.queue.timeout.UniqueQueue
maxsize: 5
"""
@pytest.mark.timeout(1)
async def test_put_simple(event_loop):
async with ... | aioworkers/aioworkers | tests/test_queue_timestamp.py | test_queue_timestamp.py | py | 5,722 | python | en | code | 38 | github-code | 6 | [
{
"api_name": "pytest.fixture",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "aioworkers.queue.timeout.TimestampQueue",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "... |
36153768234 | from nltk.tokenize import sent_tokenize, word_tokenize
def preprocess(text):
sentences = sent_tokenize(text)
preprocessed = []
for sent in sentences:
preprocessed.append("\n".join(word_tokenize(sent)))
preprocessed = "\n\n".join(preprocessed)
return preprocessed
| jkausti/flask-textsapi | app/textsapi/util/preprocessor.py | preprocessor.py | py | 296 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "nltk.tokenize.sent_tokenize",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "nltk.tokenize.word_tokenize",
"line_number": 9,
"usage_type": "call"
}
] |
12864221739 | from django.http.response import JsonResponse
from rest_framework import status
from API.models import *
from API.serializers import *
from ..views import SmartHomeAuthView
from bson.json_util import ObjectId
from ..mongo import db
class ModifySchedule(SmartHomeAuthView):
def post(self, request):
"""
... | ductranprof99/SmartHomeAPI | API/Schedule/views.py | views.py | py | 3,530 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "views.SmartHomeAuthView",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "bson.json_util.ObjectId",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "django.http.response.JsonResponse",
"line_number": 18,
"usage_type": "call"
},
{
"... |
36638169975 | from django.http import HttpResponseRedirect
from django.shortcuts import redirect, render
import json
from core.forms import InformationForm
from .models import Information
#view for display json data
def show_data(request):
objs = Information.objects.filter(id__range=["1", "200"])
return render(request,"... | rhshurov64/JSON_to_Model | core/views.py | views.py | py | 1,503 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "models.Information.objects.filter",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "models.Information.objects",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "models.Information",
"line_number": 12,
"usage_type": "name"
},
{
... |
29669453402 |
# coding: utf-8
# In[84]:
import argparse
import re
fileIn = ""
fileOut = ""
reasons = {
0x800000:"Create Application",
0x400000:"Modify System Executable",
0x200000:"Modify System Config",
0x100000:"Invoke Not Trusted",
0x80000:"Invoke Kernel Access",
0x40000:"Invoke Command Interpreter",
... | quincy7386/Scripts | conferParse/conferLogParse.py | conferLogParse.py | py | 4,695 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "re.match",
"line_number": 93,
"usage_type": "call"
},
{
"api_name": "re.match",
"line_number": 98,
"usage_type": "call"
},
{
"api_name": "re.match",
"line_number... |
30887036055 | # -*- coding: utf-8 -*-
from collective.dms.scanbehavior import _
from plone.autoform.interfaces import IFormFieldProvider
from plone.indexer import indexer
from plone.supermodel import model
from Products.CMFPlone.utils import base_hasattr
from Products.PluginIndexes.common.UnIndex import _marker
from zope import sch... | collective/collective.dms.scanbehavior | src/collective/dms/scanbehavior/behaviors/behaviors.py | behaviors.py | py | 2,088 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "plone.supermodel.model.Schema",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "plone.supermodel.model",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "plone.supermodel.model.fieldset",
"line_number": 17,
"usage_type": "call"
},
... |
19364332288 | from selenium import webdriver
from selenium.webdriver.support.ui import Select
import time
path="C:/Users/OCAC/Desktop/Selenium/chromedriver.exe"
driver=webdriver.Chrome(path)
"""url="https://www.facebook.com/r.php"
driver.get(url)
month=Select(driver.find_element_by_id("month"))
all_month_options=month.options
fo... | AnkitM18-tech/Selenium | Selenium Automation/Intermediate.py | Intermediate.py | py | 767 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "time.sleep",
"line_number": 20,
"usage_type": "call"
}
] |
13486625915 | from collections import defaultdict
from doctest import OutputChecker
# a_dir = '../2021-hashcode-practice/input/a_an_example.in.txt'
# a_dir = '../2021-hashcode-practice/input/b_better_start_small.in.txt'
# a_dir = '../2021-hashcode-practice/input/c_collaboration.in.txt'
# a_dir = '../2021-hashcode-practice/input/d_d... | spes2357/2021-hashcode-practice | Joonmo/qualification2022.py | qualification2022.py | py | 4,710 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "collections.defaultdict",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "collections.OrderedDict",
"line_number": 69,
"usage_type": "call"
}
] |
12950734832 | import matplotlib.pyplot as plt
import numpy as np
import scipy as spy
import time
from . import AstroLib_Basic as AL_BF
from . import AstroLib_2BP as AL_2BP
from . import AstroLib_Ephem as AL_Eph
Cts = AL_BF.ConstantsBook() #Table of constants
class shapingMethod:
def __init__(self, mu, *args, **kwargs):
... | veronicasaz/AstrodynamicsScripts | AstroLib_ShapingMethod.py | AstroLib_ShapingMethod.py | py | 12,972 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "numpy.cos",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "numpy.log",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "numpy.arctan",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "numpy.log",
"line_number": 26,
... |
24570711730 | # ------------------------------------------------------------------------
# coding=utf-8
# ------------------------------------------------------------------------
from __future__ import absolute_import
from django.conf import settings as django_settings
from django.core.exceptions import PermissionDenied
from djang... | alexhora/feincms | feincms/module/page/modeladmins.py | modeladmins.py | py | 9,346 | python | en | code | null | github-code | 6 | [
{
"api_name": "feincms.admin.item_editor.ItemEditor",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "feincms.admin.item_editor",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "feincms.admin.tree_editor.TreeEditor",
"line_number": 23,
"usage_type... |
17585376224 | from django.test import TestCase
from django.utils import timezone
from .models import Timeline, Event
class TimelinesTestCase(TestCase):
def test_index(self):
response = self.client.get('/')
self.assertEqual(response.status_code, 200)
self.assertContains(response, "Timelines")
def... | high-rolls/timely | timelines/tests.py | tests.py | py | 2,691 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.test.TestCase",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "models.Timeline.objects.create",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "models.Timeline.objects",
"line_number": 12,
"usage_type": "attribute"
},
{
"a... |
43282728329 | import json
from django.http import JsonResponse
from django.views.decorators.http import require_POST
from django.views.decorators.csrf import csrf_exempt
from apps.account import utils as account_utils
from apps.content import utils as content_utils
from apps.contract import utils as contract_utils, contract_maps
... | joshtechnologygroup/smart-contract | apps/contract/views.py | views.py | py | 2,361 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "apps.content.utils.get_content",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "apps.content.utils",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "apps.contract.utils.get_contract",
"line_number": 17,
"usage_type": "call"
},
{
... |
20775000635 | import numpy as np
import matplotlib.pyplot as plt
from tqdm import tqdm
import fftcavity1d as fc
import efield.efields as efields
""" Defining the cavity and handler """
f = 0.200
R = 0.985
TL = 1.0-1e-3
cavity = fc.cavities.MIGACavity(
f=f, d1=f, d2=f,
R1=R, R2=R, TL=TL,
parabolic_lens=False,
)
# cavit... | remigeiger/degenerate_cavity_calculations | fft-cavity/resonance_vs_displacement2.py | resonance_vs_displacement2.py | py | 3,662 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "fftcavity1d.cavities.MIGACavity",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "fftcavity1d.cavities",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "fftcavity1d.interfaces.PhaseMask",
"line_number": 19,
"usage_type": "call"
},... |
25144951410 | import pytest
from task1.solution import strict, sum_two
@pytest.mark.parametrize(
'val1, val2, result',
[
(1, 2, 3),
(1, 2.4, TypeError),
]
)
def test_int(val1, val2, result):
"""
Test checking for int
"""
res = sum_two(val1, val2)
assert res == result
@pytest.m... | enamsaraev/tetrika-test | task1/test_task1.py | test_task1.py | py | 1,298 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "task1.solution.sum_two",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pytest.mark.parametrize",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pytest.mark",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "task1.s... |
41315905125 | import torch
from PIL import Image
from torchvision import transforms as T
from torch.utils.data import Dataset
from glob import glob
import os
import numpy as np
import matplotlib.pyplot as plt
class CustomDataset(Dataset):
def __init__(self, image_path="data/obt/image", mode="train"):
assert mode in ("t... | beishangongzi/fcn_end | dataset.py | dataset.py | py | 1,682 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "torch.utils.data.Dataset",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "glob.glob",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_n... |
11173282401 | from django.urls import path
from core.views import farm_view, home_view, post_detail
app_name = 'blog'
urlpatterns = [
path('farm/', farm_view, name='farm'),
path('', home_view, name='home'),
path('<int:year>/<int:month>/<int:day>/<slug:post>/', post_detail, name='post_detail')
] | Makhathini62/Backend | core/urls.py | urls.py | py | 295 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "core.views.farm_view",
"line_number": 7,
"usage_type": "argument"
},
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "core.views.ho... |
10186254111 | import psycopg2
def del_tables(cur): # Удаляет все таблицы
cur.execute('''
DROP TABLE phones;
DROP TABLE clients;
''')
conn.commit()
return 'Все таблицы удалены'
def create_tables(cur): # Создает таблицы
cur.execute('''
Create table if not exists clients(
id serial primary key... | kolyan994/postgres_in_python | main.py | main.py | py | 6,794 | python | ru | code | 0 | github-code | 6 | [
{
"api_name": "psycopg2.connect",
"line_number": 157,
"usage_type": "call"
}
] |
70063298428 | import tkinter as tk
from tkinter import *
from PIL import Image, ImageTk
import cv2
root = tk.Tk()
root.title("Dare Challenge")
# Create a label for the video
video_label = tk.Label(root)
video_label.pack()
# Create a label for the caption
caption_label = tk.Label(root, text="Doing a dare...")
caption_label.pack()
... | CrazyKanav/21_Dares | new/video.py | video.py | py | 1,189 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "tkinter.Tk",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "tkinter.Label",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "tkinter.Label",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "tkinter.Button",
"line_numbe... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.