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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
245936115 | #!/usr/bin/python
import threading
import numpy as np
import cv2
import rospy
from viman_utility.msg import CamZ
"""
Common class where calibrated CV image matrix is stored and accessed
"""
class Output:
# dummy image
img = np.zeros((640,480,3), np.uint8)
lock = threading.Condition()
def __init__(self):
p... | ProjectViman/viman | viman_control/scripts/slam_Z/process_vision.py | process_vision.py | py | 4,123 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "numpy.zeros",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.uint8",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "threading.Condition",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "threading.Thread",
... |
31716326895 | """
游戏主程序
1. 封装 主游戏类
2. 创建 游戏对象
3. 启动游戏
"""
import sys
import pygame
import background
from plane_sprites import SCREEN_RECT, FRAME_PER_SEC
from enemy import *
from plane_sprites import *
from hero import *
class PlaneGame:
"""用于配置及初始化游戏内容"""
def __init__(self):
"""初始化"""
print("游戏... | NekoSilverFox/EasyQQ | plane_main.py | plane_main.py | py | 3,988 | python | zh | code | 1 | github-code | 1 | [
{
"api_name": "pygame.init",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "plane_sprites... |
34707631023 | from pathlib import Path
from util.util import get_data_path
from .base_loader import BaseLoader
class JSONLoader(BaseLoader):
def __init__(self, path: str, params: dict, index=None):
super().__init__(
name="JSONLoader",
path=path,
params=params,
data_load... | SherifNeamatalla/jarvis | src/loaders/json_loader.py | json_loader.py | py | 663 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "base_loader.BaseLoader",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "pathlib.Path",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "util.util.get_data_path",
"line_number": 21,
"usage_type": "call"
}
] |
35805629848 | #!/usr/bin/env python
import networkx as nx
import matplotlib.pyplot as plt
#create empty grapgh
G = nx.Graph()
print(G.nodes())
print(G.edges())
print(type(G.nodes()))
print(type(G.edges()))
#adding just one node:
G.add_node("a")
# a list of nodes:
G.add_nodes_from(["b","c"])
#add edges
G.add_edge(1,2)
edge = ("... | StoneNLD/python-projects | graph/graph_from_links.py | graph_from_links.py | py | 683 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "networkx.Graph",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "networkx.draw",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.show",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot"... |
42936198452 | from primitives.base_market_agent import BaseMarketAgent
from high_frequency_trading.hft.trader import ELOInvestor
from utility import MockWSMessage
from discrete_event_emitter import RandomOrderEmitter
import draw
from db import db
import logging
log = logging.getLogger(__name__)
# this is a passive agent
# given a ... | hademircii/financial_market_simulator | agents/pacemaker_agent.py | pacemaker_agent.py | py | 2,013 | python | en | code | 4 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "primitives.base_market_agent.BaseMarketAgent",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "utility.MockWSMessage",
"line_number": 22,
"usage_type": "name"
},
{
... |
70040530274 | import numpy as np
import cv2
lineThickness = 3
url = "http:/localhost:8082/?action=stream"
# initialize USB webcam video capture.
# unable to capture directly from /dev/video0, but by using mjpg-streamer in another terminal,
# capture here works from URL instead.
cap = cv2.VideoCapture(url)
# limiting this to '1' m... | elicorrales/Fort.Laud.Robotics.Meetup.Group | Meetup.5/loopFaceEyeDetect.py | loopFaceEyeDetect.py | py | 1,847 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "cv2.CAP_PROP_BUFFERSIZE",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "cv2.CascadeClassifier",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "c... |
11687840437 | #!/usr/bin/python
# This file is used for extracting images from one or more bag files.
# Before run this file, remember to create a folder to store the images and 2 txt files which will store the
# image name with its corresponding omega.
# Then change the folder name to the one you created in line 52 & 53.
# In thi... | OpenPPAT/ai-course-2019 | 08-imitation-learning/bag2txt.py | bag2txt.py | py | 3,216 | python | en | code | 4 | github-code | 1 | [
{
"api_name": "cv_bridge.CvBridge",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "rosbag.Bag",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "numpy.fromstring",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "numpy.uint8",
"lin... |
11190749780 | from __future__ import annotations
import contextlib
import difflib
import hashlib
import os
import pathlib
import random
import string
from typing import Callable, Protocol
from xml.dom import minidom
from xml.etree import ElementTree
import numpy as np
import pytest
from click.testing import CliRunner
from PIL impo... | abey79/vpype | tests/conftest.py | conftest.py | py | 8,656 | python | en | code | 618 | github-code | 1 | [
{
"api_name": "numpy.random.rand",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "numpy.ndarray",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "click.testing.... |
2359487852 | """NATS implementation of messenger."""
from dataclasses import asdict
import json
from typing import Callable, Dict, Optional
from logzero import logger
from pynats import NATSClient, NATSMessage
from blackcap.configs.base import BaseConfig
from blackcap.messenger.base import BaseMessenger
from blackcap.schemas.mes... | EBI-Metagenomics/orchestra | blackcap/src/blackcap/messenger/nats_messenger.py | nats_messenger.py | py | 2,908 | python | en | code | 4 | github-code | 1 | [
{
"api_name": "blackcap.messenger.base.BaseMessenger",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "blackcap.configs.base.BaseConfig",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "pynats.NATSClient",
"line_number": 32,
"usage_type": "call"
},
... |
43467567605 | from bs4 import BeautifulSoup
excluidos = ['Adamo',
'Todos',
'Agrale',
'Ariel',
'Asia',
'Avallone',
'Bianco',
'BRM',
'Caterham',
'CBT',
'Chamonix',
'Chana',
'Changan',
'Cross Lander',
'Daewoo',
'Daihatsu',
'DeLorean',
'Effa',
'Engesa',
'Enseada',
'Envemo',
'Farus',
'Geely',
'Gurgel',
'Hafei',
'Hennessey',
'Hofstetter'... | Sankhay/Estudos | Python/selenium/getFabri.py | getFabri.py | py | 1,005 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "bs4.BeautifulSoup",
"line_number": 58,
"usage_type": "call"
}
] |
42470067186 | import torch
import numpy as np
import math
import random
from skimage.metrics import structural_similarity as SSIM
from skimage.metrics import peak_signal_noise_ratio as PSNR
def proto_with_quality(output, target, output_proto, target_proto, criterion, acc_proto, images, num_cluster):
# InfoNCE loss
loss = cri... | leafliber/myPCL | scripts/loss.py | loss.py | py | 2,230 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "torch.split",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "torch.squeeze",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "torch.split",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "torch.squeeze",
"line_numbe... |
9175181375 | from datetime import datetime
import json
import logging
from bs4 import BeautifulSoup
from db.models import Victim
from net.proxy import Proxy
from .sitecrawler import SiteCrawler
class Ragnar(SiteCrawler):
actor = "Ragnar"
def scrape_victims(self):
with Proxy() as p:
r = p.get(f"{self... | captainGeech42/ransomwatch | src/sites/ragnar.py | ragnar.py | py | 2,485 | python | en | code | 294 | github-code | 1 | [
{
"api_name": "sitecrawler.SiteCrawler",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "net.proxy.Proxy",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "json.loads"... |
23495538946 | from youtube_transcript_api import YouTubeTranscriptApi
from yt_concate.pipeline.steps.step import Step
class DownloadCaptions(Step):
def process(self, data, inputs, utils):
for yt in data:
url = yt.url
video_id = yt.id
captions_dir = yt.captions_dir
if uti... | NoelTW/yt-concate | yt_concate/pipeline/steps/download_caption.py | download_caption.py | py | 819 | python | en | code | 4 | github-code | 1 | [
{
"api_name": "yt_concate.pipeline.steps.step.Step",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "youtube_transcript_api.YouTubeTranscriptApi.get_transcript",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "youtube_transcript_api.YouTubeTranscriptApi",
"... |
23719298346 | import databaseConnectivity as db
import os
import shutil
import datetime
import re
import sys
# Should be uncommented with Python 2.7
reload(sys)
sys.setdefaultencoding('utf8')
from botocore.errorfactory import ClientError
# Empty list to store S3obectKeys, documentIds, customerIds and source paths
documentIds = []
S... | viratY/doc-management-utilities | document-extraction/src/utilityMethods.py | utilityMethods.py | py | 5,701 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sys.setdefaultencoding",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path.abspath",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 45,
"usage_type": "attribute"
},
{
"api_name": "shutil.copy",
... |
73898604835 | """
Dataloader building logic.
Author: JiaWei Jiang
This file contains the basic logic of building dataloaders for training
and evaluation processes.
"""
from typing import Any, Union
import numpy as np
import pandas as pd
from omegaconf.dictconfig import DictConfig
from torch.utils.data import DataLoader
from .data... | JiangJiaWei1103/Competitive-DS-Made-Easy | data/build.py | build.py | py | 1,217 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "typing.Union",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "pandas.DataFrame",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "numpy.ndarray",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "omegaconf.dictc... |
30896395982 | from torchvision import transforms
from torchvision.datasets import MNIST
import torch
from PIL import Image
import numpy as np
from tqdm import tqdm
class MNISTInvase(MNIST):
def __init__(self, *args, **kwargs):
super(MNISTInvase, self).__init__(*args, **kwargs)
def __getitem__(self, index):
... | choheeee22/invase-pytorch | data/mnist.py | mnist.py | py | 2,173 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "torchvision.datasets.MNIST",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "PIL.Image.fromarray",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "torch.zeros",... |
31324875227 | ##read the markers from file and search in Graingenes.Each one seek for five times.
#If one makrer hasn't been found even by five times,it will be recorded in the file.
import re
import requests
def get_marker(url):
r = requests.get(url, timeout=20)
t = r.text
seq_compiles = re.compile("PCR primers.+?\n")
... | Jiny000/BIOinformatics | python/requests.py | requests.py | py | 2,124 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "requests.get",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "re.findall",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 12,
"... |
13037432263 | import stripe
import json
from django.conf import settings
from django.shortcuts import redirect
from rest_framework.decorators import api_view,permission_classes
from rest_framework.response import Response
from rest_framework import status
from rest_framework.permissions import IsAuthenticated
from .m... | DevDhira/tubemize | backend/payment/views.py | views.py | py | 3,955 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.conf.settings.SUBSCRIPTION_SUCCESS_URL",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "django.conf.settings",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "django.conf.settings.SUBSCRIPTION_FAILED_URL",
"line_number": 17,
... |
20714729925 | import datetime
import json
import random
from datetime import datetime
from django.contrib import messages
from django.contrib.auth import authenticate, login, logout, update_session_auth_hash
from django.contrib.auth.decorators import login_required
from django.shortcuts import render, redirect, get_object_or_404
f... | Szaneron/Battlewind | Website/views.py | views.py | py | 50,644 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.shortcuts.render",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "forms.CreateUserForm",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "... |
70735088674 | import os
import traceback
from functools import partial
from typing import Union, Any
import h5pyd
from Prop3D.common.featurizer import ProteinFeaturizer
from Prop3D.util import safe_remove
from Prop3D.generate_data.data_stores import data_stores
from toil.job import Job
from toil.realtimeLogger import RealtimeLogg... | bouralab/Prop3D | Prop3D/generate_data/calculate_features_hsds.py | calculate_features_hsds.py | py | 8,865 | python | en | code | 16 | github-code | 1 | [
{
"api_name": "toil.job.Job",
"line_number": 35,
"usage_type": "name"
},
{
"api_name": "typing.Union",
"line_number": 35,
"usage_type": "name"
},
{
"api_name": "typing.Any",
"line_number": 35,
"usage_type": "name"
},
{
"api_name": "os.path.basename",
"line_num... |
29359771140 | from pathlib import Path
from typing import List
import numpy as np
import pandas as pd
from sklearn.model_selection import train_test_split
DATASET = 'dataset_7_classes_v3.xlsx'
TEST_SIZE = 0.15
VALIDATION_SIZE = 0.2
FAILURE_MECHANISMS = ['NF', 'RM', 'DPF', 'NPF', 'DWF', 'NWF']
BINARY_LABELS = ['No_Failure', 'Failu... | cristian-castro-a/slope-stability-surrogate-model | 04_multiclass_multilabel_classification_model/04_01_data_split/run_multiclass_data_split.py | run_multiclass_data_split.py | py | 7,464 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pandas.DataFrame",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "pathlib.Path",
"line_number": 35,
"usage_type": "name"
},
{
"api_name": "pandas.read_excel",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "numpy.cos",
... |
17871789895 | from optparse import OptionParser
from bigdl.dataset import mnist
from bigdl.dataset.transformer import *
from bigdl.nn.layer import *
from bigdl.nn.criterion import *
from bigdl.optim.optimizer import *
from bigdl.util.common import *
def build_model(class_num):
model = Sequential()
model.add(Reshape([1, 28,... | PacktPublishing/Learning-Generative-Adversarial-Networks | Chapter05/Code/BigDL/BigDL-MNIST.py | BigDL-MNIST.py | py | 3,403 | python | en | code | 33 | github-code | 1 | [
{
"api_name": "bigdl.dataset.mnist.read_data_sets",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "bigdl.dataset.mnist",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "optparse.OptionParser",
"line_number": 39,
"usage_type": "call"
},
{
"api_... |
8511838057 | from typing import List, Tuple, Dict
from math import sqrt
import torch
from torch import Tensor
import torch.nn as nn
from torch_geometric.nn import MessagePassing
from graph.detectors.models.common_model import GNNPool
import numpy as np
EPS = 1e-15
class ExplainerBase(nn.Module):
def __init__(self, model:... | for-just-we/VulDetectArtifact | graph/explainers/approaches/common.py | common.py | py | 10,334 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "torch.nn.Module",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "torch.nn.Module",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"li... |
257427796 | import datetime
import django_filters
from django import forms
from .choices import EXPERIENCIES, HIERARCHIES, MODALITIES, PERIOD_CHOICES
from .models import Job
class JobFilter(django_filters.FilterSet):
q = django_filters.CharFilter(field_name='title', lookup_expr='icontains')
modality = django_filters.Mu... | Ricardo-Jackson-Ferrari/jobfinder | apps/job/filters.py | filters.py | py | 1,761 | python | en | code | 5 | github-code | 1 | [
{
"api_name": "django_filters.FilterSet",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "django_filters.CharFilter",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "django_filters.MultipleChoiceFilter",
"line_number": 12,
"usage_type": "call"
}... |
20292781823 | from datetime import datetime
from lorem_text import lorem as lorem_func
import pyotp
from flask import abort, Blueprint, make_response, redirect, \
render_template, Response, send_file, send_from_directory, url_for, request, session
from flask_login import login_user, current_user
# noinspection PyPackageRequirement... | mattl1598/open-amdram-portal | webapp/routes.py | routes.py | py | 17,614 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "flask.Blueprint",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "webapp.models.Show.query.filter",
"line_number": 64,
"usage_type": "call"
},
{
"api_name": "webapp.models.Show.query",
"line_number": 64,
"usage_type": "attribute"
},
{
"api... |
31637033591 | import os
import json
import time
from S3utility.s3_notification_info import parse_activity_data
from provider import digest_provider, download_helper, email_provider, utils
from activity.objects import Activity
class activity_ValidateDigestInput(Activity):
"ValidateDigestInput activity"
def __init__(self, s... | elifesciences/elife-bot | activity/activity_ValidateDigestInput.py | activity_ValidateDigestInput.py | py | 4,401 | python | en | code | 19 | github-code | 1 | [
{
"api_name": "activity.objects.Activity",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "os.path.join",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 34,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
... |
33288174422 | import store
import os
import FTP_Cryptography
import bson
from bson.binary import Binary
import mongodb
from cryptography.fernet import Fernet
files = mongodb.db.files
FILE_DATA = store.FILE_DATA
INFO_FILE = store.INFO_FILE
def check_file_name(file_name):
return os.path.exists(file_name)
def send_file(socket... | boom-chill/Chat-app-MMT-DA | file.py | file.py | py | 3,796 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "mongodb.db",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "store.FILE_DATA",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "store.INFO_FILE",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "os.path.exis... |
10451723483 | import os
import maya.cmds as cmds
from functools import partial
import Core
reload(Core)
class UIContainer():
frozen = False
def build(parent,
imagesPath,
iconSize=25,
height=20,
marginSize=5):
"""
build widget
@param parent : parent layout in maya
@image... | darkuress/animBuddy | animBuddy/ViewportRefresh/Widget.py | Widget.py | py | 1,205 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "maya.cmds.rowLayout",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "maya.cmds",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "maya.cmds.iconTextButton",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "maya.cmds",
... |
25136656838 | import time
from bs4 import BeautifulSoup
import requests
from requests import Session
from Extractor.extractor import EbayKleinanzeigenExtractor
import json
from print_dict import pd
class Cookies:
def __init__(self, filename: str = "default.json", log: bool = True,
cookies: dict = None, save=F... | zakir0101/ebay-kleineanzeigen-api | Cookies/cookies.py | cookies.py | py | 6,574 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "json.load",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 80,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 92,
"usage_type": "call"
},
{
"api_name": "requests.Session",
"line_number": ... |
41543948505 | from flask import Blueprint, request, jsonify, json
from db import db, app, ma
from flask import Flask, redirect, request, jsonify, json, session, render_template
from model.turnos import turnos, turnosSchema
routes_turnos = Blueprint("routes_turnos", __name__)
turno_schema = turnosSchema()
turnos_schema = turnosSc... | winsignares/lavadocarro | CARW/api/turno.py | turno.py | py | 1,332 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "flask.Blueprint",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "model.turnos.turnosSchema",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "model.turnos.turnosSchema",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "mode... |
14346415777 | from random import randint
import math
from PIL import Image, ImageDraw, ImageFont
# Did you know that calculating the correct font size
# is NP-Hard? This function is for when they will solve
# P = NP?
def calculate_font_size(string, image_width):
global FONT_SIZE
return FONT_SIZE
def pad_string(text, how_m... | mrkct/cool-experiments | inrainbows-album-art/generate.py | generate.py | py | 2,495 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "random.randint",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "random.randint",
"li... |
14990079057 | from datetime import datetime
import cv2 as cv
import matplotlib.pyplot as plt
def perform_sift_performant(query, train):
start = datetime.now()
img1 = cv.imread(query, cv.IMREAD_GRAYSCALE) # queryImage
img2 = cv.imread(train, cv.IMREAD_GRAYSCALE) # trainImage
# Initiate SIFT detector
sift = c... | Mini-Sylar/Fingerprint-Matching-System | Algorithms/SIFT/Performant_SIFT.py | Performant_SIFT.py | py | 1,399 | python | en | code | 7 | github-code | 1 | [
{
"api_name": "datetime.datetime.now",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "cv2.imread",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "cv2.IMREAD_GRAYSCALE"... |
9269156525 | import os
import json
import requests
class app_info_mode():
def __init__(self):
self.path = os.path.abspath(os.path.dirname(__file__))
self.mode = "translate"
self.print_format = "t_mode"
self.version = "v2.0"
self.fromlang = 'en'
self.tolang = 'zh'
#get th... | ZZP-DMU/tub | init.py | init.py | py | 3,115 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "os.path.abspath",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_numbe... |
14386114791 | '''
47. 이진 트리 직렬화 & 역직렬화
이진트리를 배열로 직렬화하고, 반대로 역직렬화하는 기능을 구현하라.
https://leetcode.com/problems/serialize-and-deserialize-binary-tree/
'''
from collections import deque
# Definition for a binary tree node.
class TreeNode(object):
def __init__(self, x):
self.val = x
self.left = None
self.right ... | hyo-eun-kim/algorithm-study | ch14/hyoeun/ch14_6_hyoeun.py | ch14_6_hyoeun.py | py | 1,870 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "collections.deque",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "collections.deque",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "collections.deque",
"line_number": 39,
"usage_type": "call"
}
] |
2440120696 | # Polinomial Linear Regression
# 1) Importing Libraries
import numpy as np # Mathematics fucntopns
import matplotlib.pyplot as plt # Plot and Charts
import pandas as pd #Data Set management and import them
import seaborn as sns # Covariance Matrix
# 2) importing Datas... | awaisajaz1/Machine-Learning-Learning-Path | Machine Learning A-Z/Part 2 - Regression/Section 6 - Polynomial Regression/POLINOMIAL_LINEAR_REGRESSION.py | POLINOMIAL_LINEAR_REGRESSION.py | py | 4,396 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pandas.read_csv",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.Imputer",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "sklearn.cross_validation.train_test_split",
"line_number": 52,
"usage_type": "call"
},
... |
25140299013 | import inspect
import logging
import ssl
import signal
from pathlib import Path
from queue import Queue
from threading import Event, Lock, Thread, current_thread
from time import sleep
from typing import (
Any,
Callable,
List,
Optional,
Tuple,
Union,
no_type_check,
Generic,
TypeVar,
... | nishidage/-1 | telegram/ext/_updater.py | _updater.py | py | 24,967 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "typing.TYPE_CHECKING",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "typing.TypeVar",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "typing.Union",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "telegram.ext.Dispatc... |
25346439097 | from sys import exit
from kojak import cli
from kojak.exceptions import KojakException
from kojak.models import Analyze
from kojak.reports import Report
from pbr.version import VersionInfo
def main():
args = cli.argparser().parse_args()
version = VersionInfo("kojak")
if args.version:
print("koja... | openuado/kojak | kojak/__main__.py | __main__.py | py | 845 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "kojak.cli.argparser",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "kojak.cli",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "pbr.version.VersionInfo",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "kojak.models.An... |
4622716657 | import os
from shutil import copyfile
from typing import List, TYPE_CHECKING
import jinja2
from ..checks.issues import Issues
from ..checks.file_size import FileSizeCheck
from .utils import create_parent_directory
from ..checks.base import Check
if TYPE_CHECKING:
from combine.core import ContentDirectory
class ... | dropseed/combine | combine/files/core.py | core.py | py | 2,317 | python | en | code | 10 | github-code | 1 | [
{
"api_name": "typing.TYPE_CHECKING",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "os.path.relpath",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_... |
23525174675 | from selenium.webdriver.common.by import By
from lib import Lib
from time import sleep
import pyautogui
class TestsPage(Lib):
'Coloquem os localizadores dos elementos aqui, vai facilitar!'
URL = 'https://undbclassroom.undb.edu.br'
__LOGIN_DIRETO_URL = 'https://undbclassroom.undb.edu.br/login/index.php#'
... | soniaelisabeth/classroom_automation | tests_page.py | tests_page.py | py | 17,791 | python | pt | code | 0 | github-code | 1 | [
{
"api_name": "lib.Lib",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "selenium.webdriver.common.by.By.ID",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "selenium.webdriver.common.by.By",
"line_number": 11,
"usage_type": "name"
},
{
"ap... |
26714113006 | import os
import sys
import math
import argparse
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
import matplotlib
matplotlib.use('Agg')
import numpy as np
from models import *
import datasets as dsets
from datasets import PairwiseDataset
models = {
'cyclegan': CycleGAN,
'unit': UNIT
}
def load_data(data_type):
... | tatsy/keras-generative | train_im2im.py | train_im2im.py | py | 2,392 | python | en | code | 123 | github-code | 1 | [
{
"api_name": "os.environ",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.use",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "datasets.mnist.load_data",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "datasets.mnist"... |
72153324834 | """Tests for pydent.base.py."""
import copy
import pytest
from pydent import AqSession
from pydent import ModelBase
from pydent import ModelRegistry
from pydent.exceptions import NoSessionError
from pydent.marshaller import add_schema
from pydent.marshaller import exceptions
from pydent.marshaller import fields
from ... | aquariumbio/pydent | tests/test_pydent/test_base.py | test_base.py | py | 8,013 | python | en | code | 6 | github-code | 1 | [
{
"api_name": "pydent.marshaller.SchemaRegistry.schemas",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "pydent.marshaller.SchemaRegistry",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "pydent.ModelRegistry.models",
"line_number": 26,
"usage_ty... |
21030594928 | import time
import random
import datetime
import sys
import numpy as np
from utils.parameters import parse_command_line
from utils.bayesian_optimization import *
from utils.default_params import *
np.set_printoptions(precision = 4, suppress = True)
np.set_printoptions(threshold=sys.maxsize)
###### TRAIN PARAMETERS #... | simonetibaldi/BATQuO | src/main_pulser.py | main_pulser.py | py | 1,272 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "numpy.set_printoptions",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.set_printoptions",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sys.maxsize",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "utils.... |
41035420324 | """Test the TextClause and related constructs."""
from sqlalchemy import and_
from sqlalchemy import asc
from sqlalchemy import bindparam
from sqlalchemy import Column
from sqlalchemy import desc
from sqlalchemy import exc
from sqlalchemy import extract
from sqlalchemy import Float
from sqlalchemy import func
from sql... | sqlalchemy/sqlalchemy | test/sql/test_text.py | test_text.py | py | 38,430 | python | en | code | 8,024 | github-code | 1 | [
{
"api_name": "sqlalchemy.sql.table",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.sql.column",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Integer",
"line_number": 40,
"usage_type": "argument"
},
{
"api_name": "sql... |
71918011235 | import datetime
import re
def regex_replace(s, find, replace):
"""Find and replace using regular expressions
Args:
s (string): The string containing the text whose be replaced
find (string): The regex pattern
replace (string): The string whose replace the pattern
Returns:
... | GrindLabs/lsmakeupstudio | lsmakeupstudio/utils/template.py | template.py | py | 1,679 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "re.sub",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "datetime.datetime... |
31982254831 | from django.shortcuts import render, redirect
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from .models import (
Persona,
CallesIndependencia,
)
from .forms import (
PersonaForm,
PersonaVerificacionForm
)
# AUTOCOMPLETADO CALLES
from django.http import ... | independencia-datalake/datalake | datalake/core/views.py | views.py | py | 3,396 | python | es | code | 0 | github-code | 1 | [
{
"api_name": "forms.PersonaVerificacionForm",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "forms.PersonaVerificacionForm",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "models.Persona.objects.filter",
"line_number": 43,
"usage_type": "call"
},
... |
32961592369 | import base64
import json
import re
from datetime import datetime, timezone, timedelta
from typing import Optional, Any
from .log import Log
def lowercase(string): return str(string).lower()
def uppercase(string): return str(string).upper()
def snakecase(string):
string = re.sub(r"[\-\.\s]", '_', str(string)... | ServiceStack/servicestack-python | servicestack/utils.py | utils.py | py | 7,623 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "re.sub",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 27,
"usage_type"... |
73034166753 | # -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Jayesh Kariya <jayeshk@saltstack.com>`
'''
# Import Python Libs
from __future__ import absolute_import
# Import Salt Testing Libs
from salttesting import TestCase, skipIf
from salttesting.mock import (
NO_MOCK,
NO_MOCK_REASON
)
from salttesting.helpers imp... | shineforever/ops | salt/tests/unit/modules/win_disk_test.py | win_disk_test.py | py | 1,683 | python | en | code | 9 | github-code | 1 | [
{
"api_name": "salttesting.helpers.ensure_in_syspath",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "salt.modules.win_disk.ctypes",
"line_number": 54,
"usage_type": "attribute"
},
{
"api_name": "salt.modules.win_disk",
"line_number": 54,
"usage_type": "name"
... |
275881198 | from git import Repo
import datetime
import time
from datetime import date, timedelta
import json
import requests
now = datetime.datetime.now()
clean_now = now.strftime("%Y-%b-%d, %A %I:%M:%S")
message = "Commit made on: "
full = message + clean_now
working_tree_dir = '/home/ec2-user/crontGit/ltserge.github.io'
file... | LtSerge/ltserge.github.io | ltserge.py | ltserge.py | py | 2,098 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "datetime.datetime.now",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "time.time",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "datetime.date.to... |
28144934766 | from ignite.metrics import Metric
from ignite.metrics.metric import sync_all_reduce, reinit__is_reduced
import torch
EPSILON_FP16 = 1e-5
class MultiClassAccuracy(Metric):
def __init__(self, threshold=0.5, num_classes=1000, output_transform=lambda x: x):
self.correct = None
self.total = None
... | ryanwongsa/ECCV22_Chalearn-MSSL | metrics/multiclassaccuracy.py | multiclassaccuracy.py | py | 1,276 | python | en | code | 4 | github-code | 1 | [
{
"api_name": "ignite.metrics.Metric",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "torch.zeros",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "torch.zeros",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "ignite.metrics.metric.re... |
32029297558 | from PIL import Image
import numpy as np
from tqdm import tqdm
import pickle
def load_data(file):
try:
with open(file, 'rb') as fo:
data = pickle.load(fo)
return data
except:
with open(file, 'rb') as f:
u = pickle._Unpickler(f)
u.encoding = 'latin1'
... | OscarcarLi/meta-analysis-classification | datasets/filelists/FC100/process.py | process.py | py | 974 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "pickle.load",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pickle._Unpickler",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "tqdm.tqdm",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "PIL.Image.fromarray",
"lin... |
5558903910 | import os, re, json
import xml.etree.ElementTree as ET
FACULTIES = {"Факультет інформатики", "Факультет економічних наук"}
# these are hardcoded, but idk how to figure them out from the file
DOCSPECS = {"Факультет економічних наук": {
"ек": "Економіка",
"мар": "Маркетинг",
"мен": "Менеджмент",
"фін": ... | Doodlinka/FidoTask | scheduleParser.py | scheduleParser.py | py | 8,036 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "re.match",
"line_number": 75,
"usage_type": "call"
},
{
"api_name": "xml.etree.ElementTree.XMLPullParser",
"line_number": 161,
"usage_type": "call"
},
{
"api_name": "xml.etree.ElementTree",
"line_number": 161,
"usage_type": "name"
},
{
"api_name": "... |
27155993930 | import ast
import json
from http.server import BaseHTTPRequestHandler
from it.inspector import Inspector
from it.session import Session
from it.utils import Group, logger
class InspectorServer(BaseHTTPRequestHandler):
def do_GET(self, *args, **kwargs):
self.respond(200, message="use post method")
de... | three-headed-giant/it | it/server/handler.py | handler.py | py | 2,035 | python | en | code | 79 | github-code | 1 | [
{
"api_name": "http.server.BaseHTTPRequestHandler",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "it.utils.logger.info",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "it.utils.logger",
"line_number": 17,
"usage_type": "name"
},
{
"api_name"... |
25597986377 |
# coding: utf-8
# In[2]:
import argparse
import pandas as pd
import numpy as np
def main():
# Parse arguments from command line
parser = argparse.ArgumentParser()
# Set up required arguments this script
parser.add_argument('function', type=str, help='function to call')
parser.add_argument('start... | jayacl5/bigdatafed | getCommodityPrice.py | getCommodityPrice.py | py | 1,201 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "numpy.var",
... |
35042213128 | from django.contrib import admin
from .forms import CustomUserCreationForm, AdminUserChangeForm
from .models import CustomUser
from django.contrib.auth.admin import UserAdmin
# Register your models here.
class CustomUserAdmin(UserAdmin):
add_form = CustomUserCreationForm
form = AdminUserChangeForm
model ... | kjaymiller/diversity-orgs-django | accounts/admin.py | admin.py | py | 716 | python | en | code | 7 | github-code | 1 | [
{
"api_name": "django.contrib.auth.admin.UserAdmin",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "forms.CustomUserCreationForm",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "forms.AdminUserChangeForm",
"line_number": 11,
"usage_type": "name"
},
... |
33159388072 | # -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: https://docs.scrapy.org/en/latest/topics/item-pipeline.html
import os
import fitz
import img2pdf
class WqxtPipeline(object):
def process_item(self, item, spider):
return ... | ithomia/wenquan_scrapy | wqxt/pipelines.py | pipelines.py | py | 1,713 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "img2pdf.convert",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "fitz.open",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number":... |
71704829473 | from __future__ import print_function
import sys
import re
import argparse
p = argparse.ArgumentParser( description="Read ascii index "
"and output a list of registers and descriptions." )
p.add_argument("-i",required=True, help="input file",dest='inxfile')
p.add_argument("-o", help="output file name", dest='outf'... | ashima/embedded-STM32F-lib | readDocs/scripts/regsOfindex.py | regsOfindex.py | py | 1,939 | python | en | code | 13 | github-code | 1 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "re.MULTILINE",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "re.DOTALL",
"... |
14935617233 | #!/usr/bin/env python3
import sys
import curses
import argparse
import debugoutput
import keyinput
import mapgenfuncs
from gameworld import GameWorld, GameMap
from screenpanels import MessagePanel, ListMenu
def draw_screen(stdscr, gameworld, gamewindow, panellist, show_debug_text=False):
"""Display the current g... | DeepwaterCreations/rockslike | rockslike.py | rockslike.py | py | 3,731 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "gameworld.get_view",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "debugoutput.flush_debug_text",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "curses.COLS",
"line_number": 37,
"usage_type": "attribute"
},
{
"api_name": "curs... |
34636894694 | from enum import Enum
class Level(Enum):
SMALL = 0
MEDIUM = 1
LARGE = 2
class Fuzz():
def __init__(self):
pass
class Fuzzifier():
@staticmethod
def to_level(s, m, l):
return Level([s, m, l].index(max([s, m, l])))
@staticmethod
def fl(input_):
f = Fuzzifier(... | ysam12345/ci_hw1 | src/fuzz.py | fuzz.py | py | 2,344 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "enum.Enum",
"line_number": 4,
"usage_type": "name"
}
] |
20426891679 | from typing import Iterable, Any
def is_present(substring: str, iterable: Iterable[str]):
for string in iterable:
if string is not None and substring in string:
return True
return False
def set_to_empty(iterable: list[Any]) -> list[Any]:
if iterable == ['']:
iterable = []
... | BilakshanP/SketchX | Main/core/helpers/misc_helper.py | misc_helper.py | py | 340 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "typing.Iterable",
"line_number": 3,
"usage_type": "name"
},
{
"api_name": "typing.Any",
"line_number": 10,
"usage_type": "name"
}
] |
22745833081 | from django.urls import path
from .views import new_post,post_update,post_delete,post_detail,AddCommentVİew
urlpatterns = [
path('newpost/', new_post, name='post_create' ),
path('detail/<int:id>', post_detail, name='post_detail' ),
path('detail/<int:id>/comment', AddCommentVİew.as_view(), name='add_commen... | aemingenc/blogApp-django | blog/urls.py | urls.py | py | 464 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.urls.path",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "views.new_post",
"line_number": 5,
"usage_type": "argument"
},
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "views.post_detail",... |
72895055393 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | CiscoSystems/avos | openstack_dashboard/dashboards/project/data_processing/data_plugins/tests.py | tests.py | py | 1,916 | python | en | code | 47 | github-code | 1 | [
{
"api_name": "django.core.urlresolvers.reverse",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "django.core.urlresolvers.reverse",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "openstack_dashboard.test.helpers.TestCase",
"line_number": 28,
"usage_t... |
28420576380 | # -*- coding: utf-8 -*-
'''
作业2
'''
# @Time : 2021/4/5 18:40
# @Author : LINYANZHEN
# @File : pytorch2_2.py
import numpy as np
import pandas as pd
import random
import matplotlib.pyplot as plt
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import datetime
import time
#... | AWSDJIKL/Artificial-Intelligence-and-Neural-Network | pytorch2/pytorch2_2.py | pytorch2_2.py | py | 3,039 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "numpy.loadtxt",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "torch.nn.Module",
"line_num... |
6668106671 | import json
from flask import Flask, request, Response
import language_tool_python
app = Flask(__name__)
my_tool = language_tool_python.LanguageTool('en-US')
class ResponseData(object):
def __init__(self):
self.json_data = {
"errno": 0,
"message": "success",
"data": [],
... | robert1ridley/writing_error_correction | application_v2.py | application_v2.py | py | 3,050 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "flask.Flask",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "language_tool_python.LanguageTool",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "language_tool_python.utils.correct",
"line_number": 42,
"usage_type": "call"
},
{
"ap... |
8650838427 | import nltk
import numpy as np
import pandas as pd
df = pd.DataFrame(columns=['Original_Name','Fixed_Name','UniqueID','SourceID',
'Type','Text','SentimentScore','EffectScore','SourceType','Text','Stemmed_Text',
'Lowercased','WithoutStopwords', 'WordNgrams','trigram... | OmarMeriwani/Fake-Financial-News-Detection | Sentiments/preproc.py | preproc.py | py | 936 | python | en | code | 4 | github-code | 1 | [
{
"api_name": "pandas.DataFrame",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
... |
3505597412 | import os
import socket
import json
import requests
import datetime
import threading
from urllib import parse
from flask import Flask,request,redirect,url_for,render_template
from Core import Request
from Classifier import Classifier
from Configuration import Configuration
from Log import LogController
class Transpare... | Scentedtea0210/Web-Application-Firewall | WAF/TransparentProxy.py | TransparentProxy.py | py | 8,066 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "Configuration.Configuration",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "Core.Request",
"line_number": 22,
"usage_type": "argument"
},
{
"api_name": "Classifier.Classifier",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "ur... |
5407069729 | # coding: utf-8
"""
This module contains all data objects getted from forum and wiki API. These API provides JSON data, and this module enhances data model by mirroring data attributes to data model. Here is an exemple :
.. code-block:: python
from campbot import CampBot
bot = CampBot(use_demo=True)
... | c2corg/CampBot | campbot/objects.py | objects.py | py | 11,732 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "re.search",
"line_number": 264,
"usage_type": "call"
},
{
"api_name": "differ.get_diff_report",
"line_number": 269,
"usage_type": "call"
},
{
"api_name": "logging.info",
"line_number": 293,
"usage_type": "call"
}
] |
24877168673 | """Submit proposal content."""
import os
from typing import Optional
import httpx
from starlette.datastructures import UploadFile
from saltapi.auth.token import create_token
from saltapi.repository.user_repository import User
import logging
logger = logging.getLogger(__name__)
proposal_submission_url = f"{os.enviro... | saltastroops/salt-api-old | saltapi/submission/submit.py | submit.py | py | 2,842 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "starlette.datastructures.UploadFile",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": ... |
74771536672 | from typing import List
from RLEnv.EnvLayer.PCBRoutingEnv import PCBRoutingEnv
from scipy.spatial.distance import cityblock
import numpy as np
class rl_env(PCBRoutingEnv):
def __init__(
self,
resolution: float,
pcb_folder: str,
pcb_names: List[str],
connect_coef: float=2... | PCBench/PCBench | Baselines/RL/rl_env.py | rl_env.py | py | 871 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "RLEnv.EnvLayer.PCBRoutingEnv.PCBRoutingEnv",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "numpy.array_equal",
"line_number": 22,
"usage_type": "call"
},
{
"api_name"... |
5498440877 | from struct import unpack
import json
import hid
from math import cos, atan
USB_VID = 0x04d8
USB_PID = 0xef7e
def hid_multiread(dev):
data = dev.read(128, timeout_ms=10)
res = data
while len(data) > 0:
data = dev.read(128, timeout_ms=10)
res.extend(data)
return res
def hid_query(d... | murez/looking_glass_py | get_cal.py | get_cal.py | py | 2,837 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "math.cos",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "math.atan",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "hid.enumerate",
"line_number": 68,
"usage_type": "call"
},
{
"api_name": "hid.device",
"line_number": 73,
... |
74415935072 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('sponsorships', '0003_sponsorship_event'),
]
operations = [
migrations.CreateModel(
name='SponsorshipLevel',
... | dco5/tendenci-sponsorships | sponsorships/migrations/0004_auto_20180110_2357.py | 0004_auto_20180110_2357.py | py | 1,169 | python | en | code | 1 | 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.CreateModel",
"line_number": 14,
"usage_type": "call"
},
... |
73767637792 | from __future__ import print_function
import logging
import sys
from argh import *
from vcloudtools.api import VCloudAPIClient
log = logging.getLogger(__name__)
parser = ArghParser()
@arg('path', help='Path to fetch', default='/')
def browse(args):
"""
Browse the vCloud API using the built-in hypermedia lin... | alphagov/vcloudtools | vcloudtools/command/browse.py | browse.py | py | 648 | python | en | code | 4 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "vcloudtools.api.VCloudAPIClient",
"line_number": 17,
"usage_type": "call"
}
] |
30693236327 | import json
with open ("city.json") as file:
data = json.load(file)
list_data = []
for i in data:
#print (i['name'])
list_data.append({"id":i['id'], "text":i["name"]})
data = {"results":list_data}
with open("city_name.json", "w") as f:
json.dump(list_data, f)
| pbrlionocde/mini_weather_portal | app/static/json/j.py | j.py | py | 271 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "json.load",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": 16,
"usage_type": "call"
}
] |
23665017015 | from django.shortcuts import render, redirect, reverse
from django.contrib.auth import logout
from django.contrib.auth.views import LoginView, LogoutView, login_required
@login_required(login_url='accounts:login')
def logoutview(request):
logout(request)
return redirect('accounts:login')
@login_required(log... | georgeballasdev/chat_app | ChatApp/accounts/views.py | views.py | py | 589 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.contrib.auth.logout",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.redirect",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.views.login_required",
"line_number": 7,
"usage_type": "call"
}... |
24543006030 | import h5py
import json
import numpy as np
from os.path import splitext, basename, join as pjoin
from pipeline_utils import print_and_call
from pipeline_config import MAPPING_PATH
from graphslam_config import GRAPHSLAM_EVAL_DIR, GRAPHSLAM_MAPS_DIR, MATCH_JSON_DATA
from sklearn.neighbors import NearestNeighbors
import m... | sameeptandon/sail-car-log | mapping/sandbox/graphslam/scripts/eval_maps.py | eval_maps.py | py | 4,146 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "graphslam_config.MATCH_JSON_DATA",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "os.path.join",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "graphslam_config.GRAPHSLAM_MAPS_DIR",
"line_number": 27,
"usage_type": "argument"
},
{
... |
38105066131 | import numpy as np
import matplotlib.pyplot as plt
np.random.seed(0)
def marginal_distribution(mu, sigma2, indeces):
mu_U = mu[indeces]
sigma2_U = sigma2[indeces][:,indeces].reshape(-1,len(indeces))
return mu_U, sigma2_U
def conditional_distribution(X, mu, sigma2, indeces):
mu_U, sigma2_U = marginal_d... | hongxin-y/EECS545-Homeworks | HW4/prob5.py | prob5.py | py | 2,419 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "numpy.random.seed",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "numpy.dot",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.linalg.pinv",
"... |
1758676352 | import functools
print("******* Recursive and Memoization *******")
@functools.lru_cache(maxsize=None)
def grid_traveller(m,n):
if (m == 1 and n == 1):
return 1
elif (m == 0 or n==0 ):
return 0
else:
return (grid_traveller(m-1,n)+grid_traveller(m,n-1))
print(grid_trave... | ahmetsoguksu/Dynamic-Programming-Python | 2-grid_traveller.py | 2-grid_traveller.py | py | 1,171 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "functools.lru_cache",
"line_number": 5,
"usage_type": "call"
}
] |
75045505952 | import time
import os, json
import wiotp.sdk.application
client = None
def commandCallback(event):
if event.eventId == "doorStatus":
# Received event 'doorStatus'
payload = json.loads(event.payload)
# Get the status and time
status = payload['status']
time = payload['time'... | iSagnik/Intro-to-IOT | hw4/laptop/laptop.py | laptop.py | py | 975 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "json.loads",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "wiotp.sdk.application.sdk.application.parseConfigFile",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "wiotp.sdk.application.sdk",
"line_number": 20,
"usage_type": "attribute"... |
23724759222 | import pathlib
import pygubu
PROJECT_PATH = pathlib.Path(__file__).parent
PROJECT_UI = PROJECT_PATH / "snakegame.ui"
import tkinter as tk
from tkinter import *
from PIL import ImageTk, Image
import random, os
import numpy as np
from operator import itemgetter
import pickle
# - GAMEPLAN DATA SETUP
GAMEPLAN_SIZE =... | mwsse/raw_nn | snakeAI.py | snakeAI.py | py | 12,755 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pathlib.Path",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "pygubu.Builder",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "PIL.ImageTk.PhotoImage",
"... |
72153323874 | from uuid import uuid4
import pytest
from pydent.marshaller.base import add_schema
from pydent.marshaller.base import ModelRegistry
from pydent.marshaller.fields import Alias
from pydent.marshaller.fields import Callback
from pydent.marshaller.fields import Field
from pydent.marshaller.fields import Nested
from pyden... | aquariumbio/pydent | tests/test_marshaller/test_fields/test_marshalling.py | test_marshalling.py | py | 19,065 | python | en | code | 6 | github-code | 1 | [
{
"api_name": "pydent.marshaller.base.add_schema",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "pydent.marshaller.base.add_schema",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "pydent.marshaller.base.add_schema",
"line_number": 39,
"usage_type": ... |
10428105366 | import errno
import linecache
import mimetypes
import os
import signal
import sys
from datetime import datetime
from functools import wraps
from urllib.parse import urlparse
import pandas as pd
import requests
from bs4 import BeautifulSoup
from validator_collection import checkers
EN_KEY_WORDS = ["debt", "statistical... | dmatekenya/UNSIAP-Python-Oct-2019 | src/python-for-data-science/case_study_web_scraping.py | case_study_web_scraping.py | py | 11,265 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.strerror",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "errno.ETIME",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "signal.signal",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "signal.SIGALRM",
"line... |
1133256822 | #Libray
import csv
import math
import matplotlib.pyplot as plt
from sklearn import tree
from sklearn.model_selection import KFold
#Variables
X = []
y = []
Y_series = [] #used to save real values and respective predictions
dtr_MADscores = []
dtr_RMSEscores = []
features = ('X','Y','month','day','FFMC','DMC','DC','ISI',... | hyin8/CS4210_project | src/forest_fires_dt.py | forest_fires_dt.py | py | 3,966 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "csv.reader",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "math.log",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.KFold",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "sklearn.tree.Decisi... |
6386175748 | from statistics import median_low as mdl, median_high as mdh, median as md
from copy import deepcopy as dc
num = int(input())
floors = list(map(int, input().split()))
newfloor = dc(floors)
newfloor.sort()
if len(floors)%2==0:
medl = mdl(newfloor)
medh = mdh(newfloor)
midmed = md(newfloor)
ind = min([fl... | oneku16/CompetitiveProgramming | ICPC/ICPC2021/warmup/k.py | k.py | py | 544 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "copy.deepcopy",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "statistics.median_low",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "statistics.median_high",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "statistics.m... |
74732864354 | import tkinter as tk
from tkinter import ttk
import datetime as dt
import mysql.connector
from tkinter import messagebox
import configparser
class NuovoLottoCucina(tk.Toplevel):
def __init__(self):
super(NuovoLottoCucina, self).__init__()
self.title("Nuovo Lotto Cucina")
self.geometry("+0+... | AleLuzzi/GestioneLaboratorio | Laboratorio/nuovo_lotto_cucina.py | nuovo_lotto_cucina.py | py | 12,794 | python | it | code | 1 | github-code | 1 | [
{
"api_name": "tkinter.Toplevel",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "datetime.date.today",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "mysql.con... |
75201405152 | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
# Created on 2017/12/1
__author__ = "Sky Jin "
"""
Description:
练习 1 : 去掉页面动态窗: 这里举一个新世界教育官网首页的例子
由于alert弹窗不美观,现在大多数网站都会使用自定义弹窗,
使用Selenium自带的方法就驾驭不了了,此时就要搬出JS大法
driver.execute_script(js_monitor
"""
from selenium import webdriver... | skyaiolos/SeleniumWithPython | demomore/training_JS_find/training1_dis_alertdlg.py | training1_dis_alertdlg.py | py | 977 | python | zh | code | 1 | github-code | 1 | [
{
"api_name": "selenium.webdriver.ChromeOptions",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 20,
"usage_type": "call"
},
{
"api... |
18276850000 | from datetime import datetime
import schedule
from telebot import types
from rf_bank_api import get_banks_currency
from keyboards import kb_banks, kb_currencies, kb_configure
from database_work import add_banks, add_currencies, get_currencies, get_banks, form_gist
from data import banks, currencies, rus_to_en_banks, ... | SuDarina/currency_bot | controller.py | controller.py | py | 6,195 | python | ru | code | 0 | github-code | 1 | [
{
"api_name": "database_work.form_gist",
"line_number": 16,
"usage_type": "argument"
},
{
"api_name": "schedule.every",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "schedule.run_pending",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "teleb... |
5603964278 | #!/usr/bin/env python3
from itertools import product, permutations, combinations, combinations_with_replacement
import heapq
from collections import deque, defaultdict, Counter
from bisect import bisect
import sys
def input(): return sys.stdin.readline().rstrip()
def list_int(): return list(map(int, input().split())... | yuu246/Atcoder_ABC | practice/recommendation/ABC218_D.py | ABC218_D.py | py | 1,194 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sys.stdin.readline",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sys.stdin",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "sys.setrecursionlimit",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "collections.d... |
39184132558 | from django.db import models
from django.core.validators import MinValueValidator, MaxValueValidator
from users.models import User
class BaseModel(models.Model):
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=True)
class Meta:
abstract = True
cl... | MrBerserk/semestrovka | web/models.py | models.py | py | 3,801 | 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... |
27439167711 | from __future__ import absolute_import
from threading import Thread, Lock, Event, Condition
import ctypes
import os
import sys
import traceback
import shutil
from time import time
import hashlib
from tempfile import mkstemp
from functools import wraps, partial
from six.moves import xrange
from past.builtins import exec... | thiagoralves/OpenPLC_Editor | editor/runtime/PLCObject.py | PLCObject.py | py | 28,013 | python | en | code | 307 | github-code | 1 | [
{
"api_name": "os.name",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "_ctypes.LoadLibrary",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "_ctypes.FreeLibrary",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "os.nam... |
20059168851 | """
Gridsearch implementation
"""
from hops import hdfs, tensorboard, devices
from hops.experiment_impl.util import experiment_utils
from hops.experiment import Direction
import threading
import six
import time
import os
def _run(sc, train_fn, run_id, args_dict, direction=Direction.MAX, local_logdir=False, name="no... | logicalclocks/hops-util-py | hops/experiment_impl/parallel/grid_search.py | grid_search.py | py | 4,463 | python | en | code | 26 | github-code | 1 | [
{
"api_name": "hops.experiment.Direction.MAX",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "hops.experiment.Direction",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "hops.experiment.Direction.MAX",
"line_number": 33,
"usage_type": "attribute"... |
8946929415 | # -*- coding: utf-8 -*-
import numpy as np
from scipy.stats import linregress
def _area_of_triangles(this_bin, pre_point, next_point):
"""Area of a triangle from duples of vertex coordinates
Uses implicit numpy boradcasting along first axis of this_bin"""
bin_pre = this_bin - pre_point
pre_bin = pre_p... | FarisYang/LTTB-LTD-py | down_sample/ltd.py | ltd.py | py | 5,287 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "numpy.array_split",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_num... |
71223066915 | # coding=utf-8
import os.path
import tornado.httpserver
import tornado.ioloop
import tornado.web
import tornado.escape
from settings import urls
import tornado.options
import logging.config
from tornado.log import app_log as weblog
from settings.logConfig import logConfig
import warnings
warnings.filterwarnings("ignor... | FYPYTHON/PathOfStudy | python/service/imageserver/imageserver_app.py | imageserver_app.py | py | 2,078 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "tornado.options.define",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "logging.config.config.dictConfig",
"line_number": 18,
"usage_type": "call"
},
{
"a... |
26786218549 | from gi.repository import Gtk
class Controls(Gtk.Box):
def __init__(self, *args, **kwargs):
super().__init__(spacing=10.0, *args, **kwargs)
self.reset_btn = Gtk.Button(label="Reset")
angle_control_box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
angle_control_label = Gtk.Labe... | sgorawski/InformatykaUWr | Kurs_rozszerzony_jezyka_Python/l07/controls.py | controls.py | py | 1,346 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "gi.repository.Gtk.Box",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "gi.repository.Gtk",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "gi.repository.Gtk.Button",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "gi... |
12804462040 | from django.shortcuts import render
from django.views.generic import ListView, DetailView
from django.views.generic.edit import CreateView, UpdateView, DeleteView
from django.urls import reverse, reverse_lazy
from django.utils.translation import ugettext_lazy
from .models import Post
class BlogListView(ListView):
... | Nahid-Hassan/fullstack-software-development | courses/backend/Learn Django by Creating Projects/projects/blog/blog/views.py | views.py | py | 1,337 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.views.generic.ListView",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "models.Post",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "django.views.generic.DetailView",
"line_number": 14,
"usage_type": "name"
},
{
"api_name... |
12078108329 | # Created by Yuanbiao Wang
# Implements a simple contrastive learning pretrain learner
# MoCo: Momentum Contrast for Unsupervised Visual Representation Learning
# https://github.com/facebookresearch/moco
import jittor as jt
import jittor.nn as nn
from advance.ssl_utils import *
import matplotlib.pyplot as plt
from tq... | THU-CVlab/JMedSeg | advance/ssl.py | ssl.py | py | 5,168 | python | en | code | 56 | github-code | 1 | [
{
"api_name": "matplotlib.pyplot.switch_backend",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "jittor.nn.Module",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name... |
26235363048 | from flask import Flask, request, abort
import linebot
import os
from linebot import (
LineBotApi, WebhookHandler
)
from linebot.exceptions import (
InvalidSignatureError
)
from linebot.models import *
#======這裡是呼叫的檔案內容=====
from message import *
from new import *
from Function import *
#===... | morrischen0/-DEMO | linebot_mo2/app.py | app.py | py | 5,943 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "flask.Flask",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_num... |
11737097023 | import os
from werkzeug.utils import secure_filename
class Upload:
app = None
def __init__(self, app):
self.app = app
def upload(self, destination, ext_conf, files):
if type(files) is list:
file_names = []
for _file in files:
filename = self.upload... | johndoe-dev/Ecodroid | app/flask_helpers/upload.py | upload.py | py | 1,164 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "werkzeug.utils.secure_filename",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 28,
"usage_type": "attribute"
}
] |
1163086234 | from cv2 import *
import cv2
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
# initialize the camera
cam = VideoCapture(0) # 0 -> index of camera
s, img = cam.read()
#imwrite("image.jpg",img) #save image
#img = cv2.imread("image.jpg")
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
p... | kgfathur/selfly | campy/crackImages.py | crackImages.py | py | 824 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "cv2.cvtColor",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2RGB",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot.show",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "matplotlib... |
21086711197 | import pygame
import globalVariables
class EnemyProjectile(pygame.sprite.Sprite):
def __init__(self, direction, enemy, window):
pygame.sprite.Sprite.__init__(self)
self.image = pygame.image.load("images/sprites/bone.png").convert_alpha()
self.size = self.image.get_size()
self.image ... | NaoufelMaazouzi/jeu-python | enemyProjectile.py | enemyProjectile.py | py | 1,145 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pygame.sprite",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "pygame.sprite.Sprite.__init__",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pygame.sprite",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "pyga... |
31518888968 | import os
import gzip
import shutil
from inspect import isawaitable
from typing import Optional, Union, Dict, Tuple, Iterable, Iterator, List, Coroutine, NamedTuple, Callable, Generator
from logging import Logger
from pandas import read_csv, DataFrame, isna, Series, concat
import numpy as np
from pathlib import Path
fr... | NatureGeorge/pdb-profiling | pdb_profiling/utils.py | utils.py | py | 34,681 | python | en | code | 9 | github-code | 1 | [
{
"api_name": "asyncio.sleep",
"line_number": 102,
"usage_type": "call"
},
{
"api_name": "asyncio.Semaphore",
"line_number": 103,
"usage_type": "call"
},
{
"api_name": "unsync.unsync",
"line_number": 97,
"usage_type": "name"
},
{
"api_name": "unsync.Unfuture",
... |
9943778853 | import argparse
import torchvision.transforms as transforms
import torchvision
import torch
import torch.nn as nn
import torch.optim as optim
from torchvision import datasets
from cutout import Cutout
from models.resnet import *
from models.resnet import Bottleneck
from utils import CrossEntropy
device = torch.device... | leejeongho3214/KD | train.py | train.py | py | 6,804 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "torch.device",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "torch.cuda.is_available",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "argparse.Argumen... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.