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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
28013727593 | # -*- coding:utf-8 -*-
import urllib
import requests
import re
import lxml.html.soupparser as soupparser
import lxml.etree as etree
from pyquery import PyQuery as pq
__demoUrl__ = "http://mp.weixin.qq.com/s?__biz=OTE4MzAyODYx&mid=400183897&idx=1&sn=56e62f1bf0c15669e67264494485c1a0&3rd=MzA3MDU4NTYzMw==&scene=6#rd"
class... | yfjelley/remark | api/origin.py | origin.py | py | 1,053 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "urllib.urlopen",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "lxml.html.soupparser.fromstring",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "lxml.html.soupparser",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "l... |
24472189365 | #!/usr/bin/env python3
from selectolax.parser import HTMLParser
import locale
import requests
import re
locale.setlocale(locale.LC_ALL, 'en_US.UTF8')
html = requests.get("https://en.wikipedia.org/wiki/List_of_largest_cities").text
html_data = HTMLParser(html)
objs = html_data.css("table.wikitable")
table = objs[0]
ro... | pushshift/parse_wiki_tables | parseWorldCities.py | parseWorldCities.py | py | 1,813 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "locale.setlocale",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "locale.LC_ALL",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "requests.get",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "selectolax.parser.HTMLP... |
8182393851 | import unittest
import sys
from io import StringIO
from main import *
class UserDefinedFunctionsTests(unittest.TestCase):
def test_main(self):
# Make sure there is no return statement.
self.assertIsNone(say_hello())
def test_function_name(self):
# Make sure that the function has the co... | freeCodeCamp/python-coding-challenges | challenges/8.2.User_Defined_Functions/lesson_tests.py | lesson_tests.py | py | 879 | python | en | code | 153 | github-code | 18 | [
{
"api_name": "unittest.TestCase",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "sys.stdout",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "io.StringIO",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "sys.stdout",
"l... |
13601041078 | # -*- coding:utf-8 -*-
# 分布式进程通信 ——> master管理者
import random, time, queue
from multiprocessing.managers import BaseManager
from multiprocessing import freeze_support
# 发送任务的队列:
task_queue = queue.Queue()
# 接受结果队列
result_queue = queue.Queue()
# 从BaseManger继承QueueManger
class QueueManager(BaseManager):
pass
## win... | xzxldl55/PyO | task_master.py | task_master.py | py | 1,604 | python | zh | code | 0 | github-code | 18 | [
{
"api_name": "queue.Queue",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "queue.Queue",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "multiprocessing.managers.BaseManager",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "random.r... |
36171994490 | import cv2
def main():
# Địa chỉ IP của camera
IP_ADDRESS = '192.168.0.96'
# Tạo đối tượng VideoCapture để kết nối và đọc frame từ camera
cap = cv2.VideoCapture('rtsp://' + IP_ADDRESS + '/live/ch00_1')
# Kiểm tra xem kết nối đã được thiết lập thành công hay chưa
if not cap.isOpened():... | TuanKiet24/Positioning-drone | test.py | test.py | py | 1,082 | python | vi | code | 0 | github-code | 18 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "cv2.imshow",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "cv2.waitKey",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "cv2.destroyAllWindows",
"l... |
11034826980 |
import logging
logging.basicConfig(format='%(levelname)s:%(message)s', level=logging.WARN)
class Space:
left_trans = dict(N="W", E="N", S="E", W="S")
move_xy = dict(N=(0, 1), E=(1, 0), S=(0, -1), W=(-1, 0))
def to_left(self, dir):
return self.left_trans[dir]
def to_back(self, dir):
... | fkarg/uni-stuff | semester_one/infoI/sheet11/hw_roborally.py | hw_roborally.py | py | 26,125 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "logging.basicConfig",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "logging.WARN",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "logging.info",
"line_number": 106,
"usage_type": "call"
},
{
"api_name": "logging.info",
... |
8017281653 | import io
import pytest
from fastapi import status
from zipfile import ZipFile
from jsonschema import validate
from app.test.schema.schema_giver import (
schema_fetch_product_ids,
schema_fetch_product_origins,
schema_fetch_product_origins_headers,
schema_fetch_product,
schema_fetch_product_headers,... | terib0l/genicons | fastapi/app/test/test_giver.py | test_giver.py | py | 2,326 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "fastapi.status.HTTP_200_OK",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "fastapi.status",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "jsonschema.validate",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "ap... |
628715222 | from PySide6.QtCore import Qt, QItemSelectionModel
from PySide6.QtWidgets import (
QCheckBox, QComboBox, QHBoxLayout, QHeaderView, QSizePolicy,
QTableWidgetItem, QWidget
)
from hexrdgui.constants import OverlayType
from hexrdgui.hexrd_config import HexrdConfig
from hexrdgui.overlay_editor import OverlayEditor
... | HEXRD/hexrdgui | hexrdgui/overlay_manager.py | overlay_manager.py | py | 10,234 | python | en | code | 22 | github-code | 18 | [
{
"api_name": "hexrdgui.ui_loader.UiLoader",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "hexrdgui.overlay_editor.OverlayEditor",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "PySide6.QtCore.Qt.Tool",
"line_number": 33,
"usage_type": "attribute"
... |
33367387120 | import argparse
import glob
import os
import sys
import psycopg2
import pandas as pd
from pathlib import Path
from dotenv import load_dotenv
from loguru import logger
load_dotenv()
# This function takes an input directory and an ingest directory as input. The input directory is used to search for geom
# station file... | RENCI/apsviz-timeseriesdb-stations | run/ingestTasks.py | ingestTasks.py | py | 3,474 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "dotenv.load_dotenv",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "glob.glob",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "psycopg2.connect",
"lin... |
20612348544 | '''
Given a random network, this plugin will rearrange the network neatly on the screen.
Version 1.0.3: Author: Carmen Perena Cortes, Herbert M. Sauro, Jin Xu, 2022
Based on THOMAS M. J. FRUCHTERMAN AND EDWARD M. REINGOLD's Graph Drawing by Force-directed Placement
SOFTWARE - PRACTICE AND EXPERIENCE, VOL. 21(1 1), 112... | evilnose/PyRKViewer | rkviewer_plugins/networkX.py | networkX.py | py | 16,442 | python | en | code | 6 | github-code | 18 | [
{
"api_name": "rkviewer.plugin.classes.WindowedPlugin",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "rkviewer.plugin.classes.PluginMetadata",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "rkviewer.plugin.classes.PluginCategory.VISUALIZATION",
"line_nu... |
1342253854 | from pydriller import Commit
import random
from src.mining.CodeMiners.BaseMiner import BaseMiner
class VulFixMinerMiner(BaseMiner):
def __init__(self, results_dir, valid_extensions, extensions_to_ignore):
super().__init__(None)
self.checkpoints_directory = results_dir
self.valid_extensions... | NewWwest/masters-project | src/mining/CodeMiners/VulFixMinerMiner.py | VulFixMinerMiner.py | py | 1,583 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "src.mining.CodeMiners.BaseMiner.BaseMiner",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "pydriller.Commit",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "random.sample",
"line_number": 19,
"usage_type": "call"
}
] |
23969245348 | import pdfminer
import argparse
from pdfminer.high_level import extract_text
import json
import requests
from hashlib import md5
import random
import time
def read_config(config_path):
config_fr = open(config_path, encoding="utf-8")
config = json.load(config_fr)
config_fr.close()
return config["appid"... | dongfonkey/ToolScript | src/pdf_translate.py | pdf_translate.py | py | 2,513 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "json.load",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "hashlib.md5",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number"... |
28959023281 | # -*- coding: utf-8 -*-
import pycurl
from pyload.core.network.browser import Browser
from pyload.core.network.http.http_request import HTTPRequest
from ..base.addon import BaseAddon
class UserAgentSwitcher(BaseAddon):
__name__ = "UserAgentSwitcher"
__type__ = "addon"
__version__ = "0.18"
__status__... | pyload/pyload | src/pyload/plugins/addons/UserAgentSwitcher.py | UserAgentSwitcher.py | py | 1,832 | python | en | code | 3,038 | github-code | 18 | [
{
"api_name": "base.addon.BaseAddon",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "pyload.core.network.http.http_request.HTTPRequest",
"line_number": 33,
"usage_type": "argument"
},
{
"api_name": "pyload.core.network.browser.Browser",
"line_number": 34,
"usag... |
39508727055 | import os
import ctypes
import pickle
import logging
from sys import exit
from argparse import ArgumentParser, Namespace
def init_argparse() -> ArgumentParser:
parser = ArgumentParser(
description=(
"Allows for command line configuration of the Dark Blue generator and"
" scoring en... | DarkBlueCTT/Dark-Blue | back-end/src/main.py | main.py | py | 7,972 | python | en | code | 11 | github-code | 18 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "argparse.Namespace",
"line_number": 95,
"usage_type": "name"
},
{
"api_name": "uti... |
31598383937 | from typing import Any
import contextlib
import itertools
from object_trace.object_trace import Tracer
def trace(x: Any, labe: str = "") -> Any:
"""Start tracing the object `x`, if tracing is active."""
if Tracer.ACTIVE_TRACER is not None:
Tracer.ACTIVE_TRACER.add_object(x, labe)
return x
@cont... | verinov/object-trace | object_trace/__init__.py | __init__.py | py | 583 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "typing.Any",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "object_trace.object_trace.Tracer.ACTIVE_TRACER",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "object_trace.object_trace.Tracer",
"line_number": 10,
"usage_type": "name"
... |
1722426271 | #!/usr/bin/env python3
# echo "aaa" | zerofill.py 4
# 0aaa
# Created by f-tommy, 2018/09/04
import fileinput
import argparse
# Obtain argument
parser = argparse.ArgumentParser()
parser.add_argument("td",type=int)
parser.add_argument("files",metavar='FILE', nargs='*')
args = parser.parse_args()
# Process line input
f... | f-tommy/Other-tools | zeropad.py | zeropad.py | py | 540 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "fileinput.input",
"line_number": 15,
"usage_type": "call"
}
] |
17687495476 | from django.db import connection
from django.shortcuts import render, redirect
from SMS_MYSQL import models
from SMS_MYSQL.utils.bootstrap import BootStrapModelForm
from SMS_MYSQL.utils.raw import custom_sql_get_dict
from SMS_MYSQL.models import TeachingPlan
# Create your views here.
# 采用modelform
from django impo... | rtzs-cell/SMS | SMS_MYSQL/views/student_expel.py | student_expel.py | py | 3,008 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "SMS_MYSQL.utils.raw.custom_sql_get_dict",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 68,
"usage_type": "call"
}
] |
41739581642 | # -*- coding: utf-8 -*-
"""
Created on Wed Nov 14 21:45:36 2018
@author: Ahmet
"""
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
data = pd.read_csv("sales.csv")
months = data[["Months"]]
sales = data[["Sales"]]
#train and test
from sklearn.cross_validation import train_test_... | ahmetbozaci/MachineLearning | 2-Linear_regresyon.py | 2-Linear_regresyon.py | py | 1,152 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "pandas.read_csv",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sklearn.cross_validation.train_test_split",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.StandardScaler",
"line_number": 23,
"usage_type": "call"
... |
73489167720 | """
Reproduces the sensitivity example from
https://github.com/casadi/casadi/blob/develop/docs/examples/python/nlp_sensitivities.py
"""
import time
from typing import Tuple
import casadi as cs
import matplotlib.pyplot as plt
import numpy as np
from numpy.polynomial import Polynomial
from csnlp import Nlp, wrappers
f... | FilippoAiraldi/casadi-nlp | examples/sensitivity-comparison.py | sensitivity-comparison.py | py | 5,133 | python | en | code | 3 | github-code | 18 | [
{
"api_name": "matplotlib.pyplot.style.use",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.style",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 17,
"usage_type": "name"
},
{
"api_na... |
74952226601 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""The main program of HMM.
This script serves as the main program to implement HMM by calling other
modules.
"""
import BaumWelch
import Viterbi
import AEMatrices
import Sequences
import argparse
import sys
import os
def viterbiAlgorithm(seq, a, e):
"""Run the Viterbi alg... | VampiroHuelva/HiddenMarkowModels | MainProgram.py | MainProgram.py | py | 6,260 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "AEMatrices.init",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "Sequences.readSeq",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "Viterbi.viterbi",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "Viterbi.writePathMa... |
8945294159 | import numpy as np
import matplotlib
import matplotlib.pyplot as plt
from matplotlib import cm
from mpl_toolkits.mplot3d import Axes3D
import time
import restthru
host = 'http://127.0.0.1:4950'
restthru.http_init()
distances = '/group/laserpose'
tamCel = 50
numCelX = 80
numCelY = 80
precisao = 50
passo = 1*np.pi/18... | davifcs/ia368w | tarefa_1.py | tarefa_1.py | py | 3,039 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "restthru.http_init",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.pi",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "numpy.array",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.linspace",
"li... |
14731909086 | from sys import stdin
from itertools import combinations
stdin = open("15686.txt")
input = stdin.readline
n, m = map(int, input().split())
data = []
for _ in range(n):
data.append(list(map(int, input().split())))
chicken = []
house = []
for i in range(n):
for j in range(n):
if data[i][j] == 2:
... | talentceffort/python-algorithm | baekjoon/15000/15686.py | 15686.py | py | 780 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "sys.stdin",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "sys.stdin.readline",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "sys.stdin",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "itertools.combinations",
... |
29608868100 | import torch.nn as nn
import torch.nn.functional as F
import torch
import numpy as np
from torch.nn import init
from torch.autograd import Function
#torch.manual_seed(42)
from models import transformer
class dummyhgru(Function):
@staticmethod
def forward(ctx, state_2nd_last, last_state, *args):
ctx.sa... | pathtracker-code/pathtracker-models | models/ffhgru_hierarchy.py | ffhgru_hierarchy.py | py | 23,471 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "torch.autograd.Function",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "torch.norm",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "torch.autograd.grad",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "torch.autograd... |
37299128704 | from collections import Counter
class Solution:
def countGood(self, nums: List[int], k: int) -> int:
n = len(nums)
curr = 0
ctr = Counter()
i = 0
res = 0
for j in range(n):
curr += ctr[nums[j]]
ctr[nums[j]] += 1
while curr - ctr[nu... | theabbie/leetcode | count-the-number-of-good-subarrays.py | count-the-number-of-good-subarrays.py | py | 508 | python | en | code | 11 | github-code | 18 | [
{
"api_name": "collections.Counter",
"line_number": 7,
"usage_type": "call"
}
] |
71426749800 | import numpy as np
import pandas as pd
import xgboost as xgb
from sklearn.cross_validation import train_test_split
from sklearn.metrics import roc_auc_score
from sklearn.cross_validation import KFold
from sklearn.grid_search import GridSearchCV
from sklearn import cross_validation, metrics
from sklearn.metrics import c... | aorursy/new-nb-3 | ganliu_xgb-resample.py | ganliu_xgb-resample.py | py | 2,910 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pandas.read_csv",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.array_equal",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "numpy.random.seed",... |
12162760125 | """
"""
import random
import itertools
import colorsys
import numpy as np
from skimage.measure import find_contours
import matplotlib.pyplot as plt
import matplotlib.patches as patches
import matplotlib.lines as lines
from matplotlib.patches import Polygon
import IPython.display
import mrcnn_utils
import visualize
... | anilgavade/NucleiSegmentationAndMarkerIDentification | MaskRCNN/additional_visualize.py | additional_visualize.py | py | 2,436 | python | en | code | null | github-code | 18 | [
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 37,
"usage_type": "name"
},
{
"api_name": "visualize.random_colors",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "... |
15027260419 | from config import celery_app
from django.core.mail import EmailMessage
@celery_app.task()
def send_email(mail_subject, message, to, html=False):
"""
Send email to user.
:param str mail_subject: The subject of the email
:param str message: The body of the email
:param list(str) to: List of email ... | Orfium/drf-playground | drf_playground/common/tasks.py | tasks.py | py | 521 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "django.core.mail.EmailMessage",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "config.celery_app.task",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "config.celery_app",
"line_number": 5,
"usage_type": "name"
}
] |
8649671135 |
import nnabla as nn
import nnabla.functions as F
import nnabla.parametric_functions as PF
import nnabla.initializer as I
import numpy as np
from typing import Optional
def token_embedding(x: nn.Variable, vocab_size: int, embedding_size: int) -> nn.Variable:
mask = get_mask(x)
h = time_distributed(PF.embed)(x... | minatosato/nlp-nnabla | transformer/functions.py | functions.py | py | 7,085 | python | en | code | 9 | github-code | 18 | [
{
"api_name": "nnabla.Variable",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "nnabla.parametric_functions.embed",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "nnabla.parametric_functions",
"line_number": 12,
"usage_type": "name"
},
... |
26953633569 | from pathlib import Path
import pytest
from pydra.tasks.nipype1.utils import Nipype1Task
from clinica.pydra.interfaces import (
CAPSFileDataGrabber,
CAPSGroupDataGrabber,
caps_reader,
)
from clinica.pydra.query import BIDSQuery, CAPSFileQuery, CAPSGroupQuery
from clinica.utils.testing_utils import build_b... | aramis-lab/clinica | test/unittests/pydra/test_interfaces.py | test_interfaces.py | py | 4,127 | python | en | code | 196 | github-code | 18 | [
{
"api_name": "clinica.pydra.interfaces.bids_reader",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "clinica.pydra.query.BIDSQuery",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "pydra.engine.task.FunctionTask",
"line_number": 21,
"usage_type": "arg... |
894783209 | from .models import Post, Profile, Comment, Technology, MyIntroduction, InterestingCorner
from django.shortcuts import render, redirect, get_object_or_404
from django.contrib.auth import authenticate, login, logout
from django.contrib.auth.decorators import login_required
from django.views.generic import DetailView, Li... | Sonali-Learntoshine/My-blog | Blog_app/views.py | views.py | py | 5,457 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "forms.SignupForm",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.redirect",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "forms.SignupForm",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "django.co... |
25503919941 | import unittest
from rdkit import Chem
from scoring.component_parameters import ComponentParameters
from scoring.score_components import QedScore
from unittest_reinvent.scoring_tests.scoring_components import ScoringTest
from utils.enums.scoring_function_component_enum import ScoringFunctionComponentNameEnum
import n... | m-mokaya/RIOP_DrIOP | unittest_reinvent/scoring_tests/scoring_components/test_qed_score.py | test_qed_score.py | py | 1,835 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "unittest_reinvent.scoring_tests.scoring_components.ScoringTest",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "unittest.TestCase",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "utils.enums.scoring_function_component_enum.ScoringFunction... |
2057285447 | import sys
import os
from abc import ABC, abstractmethod
import math
import torch
import torch.nn as nn
import copy
import argparse
import numpy as np
import math
from itertools import product
import tqdm
import matplotlib.pyplot as plt
from ..mlmc_mimc import MIMC
from ..nn.priors import Gaussian, MixtureGaussians
... | msabvid/MLMC-MIMC-SGD | torch_masga/langevin_masga/bayesian_inference.py | bayesian_inference.py | py | 11,855 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "mlmc_mimc.MIMC",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "torch.Tensor",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "torch.ones_like",
"line_number": 85,
"usage_type": "call"
},
{
"api_name": "torch.isnan",
"l... |
37379487075 | import os
import json
import time
from datetime import datetime
import boto3
from botocore.exceptions import ClientError
import route53_utils
import logging
bucket_name = os.environ.get("S3_BUCKET_NAME", None)
aws_region = os.environ.get("REGION", "eu-west-2")
s3 = boto3.client('s3')
route53 = boto3.client('route53')
... | dlundgren/terraform-aws-route53-backup-restore | code/backup_route53.py | backup_route53.py | py | 2,300 | python | en | code | null | github-code | 18 | [
{
"api_name": "os.environ.get",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "os.environ.get",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_... |
8629762372 | import requests
BASE = "http://127.0.0.1:5000/"
response = requests.put(BASE + "travel/1", {"rating": 10, "city": "London", "restaurant": "McDonalds"})
print(response.json())
# testing_get = input()
response = requests.get(BASE + "travel/1")
print(response.json()) | mattdistell/flask-api-restaurants | test.py | test.py | py | 270 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "requests.put",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 12,
"usage_type": "call"
}
] |
4591763018 | from queue import Queue
from threading import Thread
import requests
import json
api = ""
url = ""
threads = 10 # 线程数
librarys = 500 # 媒体库数
base_url = url + "/Library/VirtualFolders/{0}?api_key=" + api
"""
获取媒体库
"""
def query(limit=50):
url = base_url.format("Query")
if limit != None:
url += f"&... | Nolovenodie/emby-library-delect | main.py | main.py | py | 1,768 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "requests.get",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "requests.delete",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "queue.Queue",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "threading.Thread",
"line... |
29145800570 | import importlib
import time
def create_loggers_helper(logger):
import logging
# create console handler and set level to debug
ch = logging.StreamHandler()
ch.setLevel(logging.DEBUG)
# create formatter
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
# ... | dykra/Complexity | Complexity/executionHelpers.py | executionHelpers.py | py | 1,543 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "logging.StreamHandler",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "logging.Formatter",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "logging.getL... |
23550466070 | import argparse
import matplotlib.pyplot as plt
import networkx as nx
from networkx.drawing.nx_agraph import graphviz_layout
def draw_graph(adjacency_list_file, ax=None):
T = nx.DiGraph()
with open(adjacency_list_file, 'r') as f:
for line in f:
# Ignore lines starting with '#'
... | schmidt73/fastBE | scripts/plots/clone_tree.py | clone_tree.py | py | 1,384 | python | en | code | 3 | github-code | 18 | [
{
"api_name": "networkx.DiGraph",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "networkx.drawing.nx_agraph.graphviz_layout",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "networkx.draw",
"line_number": 27,
"usage_type": "call"
},
{
"api_name... |
72525384041 | # ---------------------- PROBLEM 03 (RANDOM) ----------------------------------#
# Given two strings, write a function to determine if the second string is an
# anagram of the first. An anagram is a word, aphrase, or a name formed by rearranging
# the letters of another, such as cinema formed from iceman
# Assumption:... | CodeInDna/Algo_with_Python | 04_Random/03_Frequency_Counter_Anagrams/Anagrams.py | Anagrams.py | py | 1,613 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "collections.Counter",
"line_number": 54,
"usage_type": "call"
}
] |
18414239332 | """
Example from: http://www.walkingrandomly.com/?p=5215
The author (Mike Croucher) makes initial guess of p1=1 and p2=0.2 in eqn:
p1*cos(p2*x) + p2*sin(p1*x)
and then gets:
p1 = 1.88184732
p2 = 0.70022901
with sum of squared residuals = 0.053812696547933969
1) run script and get virtually identical results
(Note... | sonofeft/XYmath | xymath/examples/walking_randomly.py | walking_randomly.py | py | 1,615 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "numpy.array",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "xymath.dataset.DataSet",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "xymath.nonlinfit.NonLi... |
21580460710 | import argparse
import sys
import random
from datetime import datetime
import torch
import torch.nn as nn
import torch.optim as optim
from torch.optim.lr_scheduler import ReduceLROnPlateau
# logging
from tensorboardX import SummaryWriter
#BartBase
from transformers import BartTokenizer, BartForConditionalGeneration
... | amazon-science/aws-dialogue-qa-pair-generation | Trainers/Trainer.py | Trainer.py | py | 5,753 | python | en | code | 4 | github-code | 18 | [
{
"api_name": "torch.cuda.is_available",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "transformers.BartTokenizer.from_pretrained",
"line_number": 30,
"usage_type": "call"
},
{
... |
13333867592 |
import numpy as np
import keras.backend as K
import tensorflow as tf
from keras.layers import *
from keras.models import *
class NALU(Layer):
def __init__(self, units, kernel_initializer='glorot_uniform',
**kwargs):
if 'input_shape' not in kwargs and 'input_dim' in kwargs:
kwa... | sinAshish/NALU-Keras | nalu.py | nalu.py | py | 2,413 | python | en | code | 14 | github-code | 18 | [
{
"api_name": "keras.backend.tanh",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "keras.backend",
"line_number": 36,
"usage_type": "name"
},
{
"api_name": "keras.backend.sigmoid",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "keras.backend.... |
24163993375 | from Bio.PDB.Vector import Vector
import numpy as np
""" pixelate each residue and its neighbors """
""" atom name """
ATOMS_NAME = ['P', 'OP1', 'OP2', 'O5\'', 'C5\'', 'C4\'', 'C3\'', 'O3\'',
'O4\'', 'C1\'', 'C2\'', 'O2\'', 'N9', 'C8', 'N7', 'C5', 'C6',
'O6', 'N1', 'C2', 'N2', 'N3', 'C4', ... | lijunRNA/RNA3DCNN | PixelateResidue.py | PixelateResidue.py | py | 12,190 | python | en | code | 11 | github-code | 18 | [
{
"api_name": "Bio.PDB.Vector.Vector",
"line_number": 274,
"usage_type": "call"
},
{
"api_name": "Bio.PDB.Vector.Vector",
"line_number": 275,
"usage_type": "call"
},
{
"api_name": "Bio.PDB.Vector.Vector",
"line_number": 276,
"usage_type": "call"
},
{
"api_name": "... |
4701716847 | import xml.etree.ElementTree as ET
from xml.dom import minidom
debug_level = 2
function_uid = 1342649436
def debug_print(text, level = 1):
global debug_level
if (debug_level >= level):
print(text)
def printItems(self):
print(self.items)
class Snixception(RuntimeError):
def __init__(s... | krista-koivisto/snix | snixel/sbswriter.py | sbswriter.py | py | 17,102 | python | en | code | 8 | github-code | 18 | [
{
"api_name": "xml.etree.ElementTree.SubElement",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "xml.etree.ElementTree",
"line_number": 40,
"usage_type": "name"
},
{
"api_name": "xml.etree.ElementTree.SubElement",
"line_number": 43,
"usage_type": "call"
},
... |
27737943414 | from flask import Flask, jsonify, render_template, request
import numpy as np
import os
import tensorflow as tf
from db import DataStore
from mnist import model
db = DataStore()
x = tf.placeholder("float", [None, 784])
sess = tf.Session()
# restore trained data
with tf.variable_scope("perceptron"):
y_percep... | Shivakishore14/MNIST-Draw-Detect-Tensorflow | app.py | app.py | py | 2,160 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "db.DataStore",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "tensorflow.placeholder",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "tensorflow.Session",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "tensorflow.var... |
2474630804 | from espnff import League
import pandas as pd
from requests import get
from bs4 import BeautifulSoup
from datetime import datetime, timedelta
import numpy as np
# Helper
def clean_owner(owner):
if owner == 'Arturo Arturo':
return 'Jose Chayet'
elif owner == 'Adam Willis':
return 'Adam Sloane'
... | abulow/ff_bot | get_data.py | get_data.py | py | 11,472 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "espnff.League",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 107,
"usage_type": "call"
},
{
"api_name": "datetime.dateti... |
31484874010 | import os
import mujoco_py
from gym_kuka_mujoco import kuka_asset_dir
def create_sim(collision = False):
if collision:
model_filename = 'full_kuka_mesh_collision.xml'
else:
model_filename = 'full_kuka_no_collision.xml'
model_path = os.path.join(kuka_asset_dir(), model_filename)
model = ... | HarvardAgileRoboticsLab/gym-kuka-mujoco | gym_kuka_mujoco/controllers/test/common.py | common.py | py | 411 | python | en | code | 33 | github-code | 18 | [
{
"api_name": "os.path.join",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "gym_kuka_mujoco.kuka_asset_dir",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "mujoco_py.lo... |
11943861374 | from datetime import datetime, timezone, timedelta
from itsdangerous import json
from sqlalchemy import and_, false, or_, text
from app.controller.util import convertPesquisa
from ..model.Funcionario import Funcionario, funcionario_schema, funcionarios_schema
from flask import request, jsonify
from werkzeug.sec... | ogabrielfelipe/SGOM-Repository | app/controller/funcionarioController.py | funcionarioController.py | py | 7,899 | python | pt | code | 6 | github-code | 18 | [
{
"api_name": "flask.request.get_json",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "flask.request",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "werkzeug.security.generate_password_hash",
"line_number": 23,
"usage_type": "call"
},
{
"api... |
24003029150 |
import pymysql
import redis
import mysql_settings
############################ mysql 处理类######################################################
class HandleMysql(object):
def __init__(self):
try:
self.db = pymysql.connect(**mysql_settings.setting)
except Exception as e:
raise e
else:
pri... | jasondzy/Python | tornado/project/Ihome/models.py | models.py | py | 2,264 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pymysql.connect",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "mysql_settings.setting",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "mysql_settings.table1",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name":... |
23930321052 | from typing import Optional, Union
import random
from collections import namedtuple
from abc import ABC, abstractmethod
import logging
import numpy as np
import torch
from torch.nn import functional as F
from torch.utils.tensorboard import SummaryWriter
from tictac_rl.nn.transforms import board_state2batch, board_sta... | KernelA/made-rl-2 | tictac_rl/q_learning/q_learning.py | q_learning.py | py | 16,802 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "collections.namedtuple",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "abc.ABC",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "env.TicTacToe",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "policies.BasePolicy",
... |
18890756779 | import tkinter
from tkinter import ttk
import time
from json.encoder import INFINITY as inf
graphe = {}
graphe_arc = {}
def d_sommet(x0, y0):
rayon = 15
id_sommet = zone_d.create_oval(
x0 - rayon, y0 - rayon, x0 + rayon, y0 + rayon, fill="white", activefill="blue"
)
zone_d.creat... | Fahazavana/Bellman-kalaba | bellman_kalaba.py | bellman_kalaba.py | py | 4,143 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "json.encoder.INFINITY",
"line_number": 45,
"usage_type": "name"
},
{
"api_name": "tkinter.Tk",
"line_number": 112,
"usage_type": "call"
},
{
"api_name": "tkinter.LabelFrame",
"line_number": 114,
"usage_type": "call"
},
{
"api_name": "tkinter.Canvas"... |
7716074450 | #修改了原SGC的forward,增加了relu
import torch
import torch.nn as nn
from torch.nn import Module
import torch.nn.functional as F
import math
from torch_geometric.nn import GCNConv
class SGC(nn.Module):
"""
A Simple PyTorch Implementation of Logistic Regression.
Assuming the features have been preprocessed with k-st... | COMP576group29/cluster-sgc | clustersgc/models.py | models.py | py | 4,603 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "torch.nn.Module",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "torch.nn.Linear",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_numb... |
70407254441 | from datetime import date, timedelta
from rest_framework.permissions import IsAdminUser
from rest_framework.response import Response
from rest_framework.views import APIView
from meiduo_admin.serialziers.statistical import *
from users.models import User
class UserCountView(APIView):
"""
用户总量统计
"""
... | RyanLin1995/python | django/meiduo_admin/meiduo_admin/meiduo_mall/apps/meiduo_admin/views/statistical.py | statistical.py | py | 3,468 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "rest_framework.views.APIView",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "rest_framework.permissions.IsAdminUser",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "datetime.date.today",
"line_number": 20,
"usage_type": "call"
},
... |
73647122919 | #by Bhuris Mun
from pymodbus.client.sync import ModbusSerialClient as ModbusClient
import time, json, math
from pymodbus.register_read_message import *
client = ModbusClient(method='rtu', port='/dev/ttyUSB0', timeout=0.3, baudrate=9600, stopbit=1, bytesize=8, parity='N')
client.connect()
#print(client.connect())
def ... | bhuris/modbusreadpzem016 | readmodbus.py | readmodbus.py | py | 1,526 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "pymodbus.client.sync.ModbusSerialClient",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "math.acos",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "math.cos",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "math.sin",
... |
16088188352 | import csv
import random
import config
import utils
import rules
from rules import df_type
from rules import dm_type
from rules import conn_type
from rules import rec_def_type
from utils import ulogger as logger
import numpy as np
num_conn_types = len(conn_type)
num_rec_def_types = len(rec_def_type)
# this is not th... | EliEhrman/logic | els.py | els.py | py | 13,508 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "rules.conn_type",
"line_number": 14,
"usage_type": "argument"
},
{
"api_name": "rules.rec_def_type",
"line_number": 15,
"usage_type": "argument"
},
{
"api_name": "utils.get_avg_min_cd",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "utils... |
71426820520 | import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
train = pd.read_csv("../input/widsdatathon2020/training_v2.csv")
test = pd.read_csv("../input/widsdatathon2020/unlabeled.csv")
train.shape, test.shape
train.head()
test.head()
train.describe()
test.describe()
train.isnull()... | aorursy/new-nb-3 | ggxgboostgg_wids2020-lgbm-starter.py | ggxgboostgg_wids2020-lgbm-starter.py | py | 7,309 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pandas.read_csv",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "matplotlib.... |
11171721081 | import logging
from django.utils import timezone
from dojo.models import Finding, Risk_Acceptance
from .importer import SonarQubeApiImporter
import dojo.risk_acceptance.helper as ra_helper
logger = logging.getLogger(__name__)
class SonarQubeApiUpdaterFromSource(object):
"""
The responsibility of this class... | DefectDojo/django-DefectDojo | dojo/tools/api_sonarqube/updater_from_source.py | updater_from_source.py | py | 4,291 | python | en | code | 3,128 | github-code | 18 | [
{
"api_name": "logging.getLogger",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "dojo.models.Finding.objects.filter",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "dojo.models.Finding.objects",
"line_number": 22,
"usage_type": "attribute"
},
{
... |
28473765942 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import collections
from logging import info
from util.global_def import DIR_DELIM
def get_temp_dir():
import tempfile
return tempfile.gettempdir()
TMP_DIR = "%(tmp_dir)s%(delim)s" % {'tmp_dir': get_temp_dir(), 'delim': DIR_DELIM}
DEFAULT_NAME = "BUFF... | r-kan/BUFFY | media/base.py | base.py | py | 5,563 | python | en | code | 19 | github-code | 18 | [
{
"api_name": "tempfile.gettempdir",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "util.global_def.DIR_DELIM",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "os.makedirs",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "errno.EEXIS... |
23613888202 | #!/usr/bin/python
# coding=utf-8
import requests
import unittest
import json
from common.public import *
import time
import random
class ICEM_MA_Interface(unittest.TestCase):
@classmethod
def setUpClass(self):
self.headers = headers
self.host = host
self.path = "/api/icem-resource/coup... | EmmySmith/autoInterfaceTest | test_interface/CEM/loyaltyManagement/couponManagement/createCoupon_test.py | createCoupon_test.py | py | 1,717 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "unittest.TestCase",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "random.randint",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "json.dumps",
... |
134656370 | from flask import Flask, redirect, url_for, request
app = Flask(__name__)
@app.route('/hello/<stdName>')
def hello(stdName):
return 'Welcome %s!' %stdName
# login.html의 http://localhost:5000/login 은 login 함수로 mapping 됨
@app.route('/login', methods = ['POST', 'GET'])
def login():
if request.method == 'POST':
... | Soyoung-Yang/se | Flask/software_engineering/venv/exercise0/ex12.py | ex12.py | py | 2,520 | python | ko | code | 0 | github-code | 18 | [
{
"api_name": "flask.Flask",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "flask.request.method",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "flask.request.form... |
37511014625 | "Runs the shocktube test problem with the Fortran Roe solver."
def test_shocktube():
"Shock tube test (1D MHD with Roe solver)"
import numpy as np
import os
from . import shocktube
from clawpack.riemann.mhd_1D_constants import B_2, B_3
claw = shocktube.setup(kernel_language='Fortran')
claw... | clawpack/pyclaw | examples/mhd_1d/test_shocktube.py | test_shocktube.py | py | 863 | python | en | code | 148 | github-code | 18 | [
{
"api_name": "os.path.dirname",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "numpy.loadtxt",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_n... |
22052553192 | import random
import re
from sys import get_coroutine_origin_tracking_depth
from sys import exit
random.seed(101)
import matplotlib.pyplot as plt
import math
import matplotlib.patches as mpatches
#from scipy.linalg import svd
import itertools
import torch
import time
import numpy as np
from tqdm import tqdm
from evalua... | LehengTHU/AdvInfoNCE | main.py | main.py | py | 38,999 | python | en | code | 5 | github-code | 18 | [
{
"api_name": "random.seed",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "model.stat... |
13931795484 | import copy
from functools import partial
from collections import OrderedDict
import torch
from torch import nn
from efficientnetv2 import get_efficientnet_v2_structure
from efficientnetv2 import load_from_zoo
class ConvBNAct(nn.Sequential):
"""Convolution-Normalization-Activation Module"""
def __init__(sel... | hankyul2/EfficientNetV2-pytorch | efficientnetv2/efficientnet_v2.py | efficientnet_v2.py | py | 8,152 | python | en | code | 41 | github-code | 18 | [
{
"api_name": "torch.nn.Sequential",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "torch.nn.Conv2d",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
... |
14014717429 | from django.shortcuts import render,redirect
from django.contrib import messages
from django.db import connection
from django.views.decorators.cache import cache_control
from django.contrib.auth import logout
from django.http import JsonResponse
conn = connection
cursor = conn.cursor()
def login_page(request):
... | GaneshKutwal/Blog_Management_System | blog/views.py | views.py | py | 8,435 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "django.db.connection",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "django.contrib.messages.error",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "django.contrib.messages",
"line_number": 34,
"usage_type": "name"
},
{
"api_na... |
24052272126 | from hw03_pendulum.train import ActorA2C
import torch
import torch.nn as nn
if __name__ == '__main__':
model = torch.load(__file__[:-13] + "/agent.pkl")
model.eval()
model2 = nn.Sequential(
model.input,
nn.ReLU(),
model.hidden,
nn.ReLU(),
model.mu_output,
)
t... | StanislavSychev/RL-Course-homework | hw03_pendulum/transform.py | transform.py | py | 351 | python | en | code | null | github-code | 18 | [
{
"api_name": "torch.load",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "torch.nn.Sequential",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "torch.nn.ReLU",
"line_number... |
10544996721 | """
МОДУЛЬ 3
Программа "Личный счет"
Описание работы программы:
Пользователь запускает программу у него на счету 0
Программа предлагает следующие варианты действий
1. пополнить счет
2. покупка
3. история покупок
4. выход
1. пополнение счета
при выборе этого пункта пользователю предлагается ввести сумму на сколько попо... | Paul-Roger/Lesson5_FCM | myconto.py | myconto.py | py | 5,446 | python | ru | code | 0 | github-code | 18 | [
{
"api_name": "pickle.dump",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 46,
"usage_type": "attribute"
},
{
"api_name": "pickle.load",
"line_numbe... |
23974248839 | from __future__ import print_function
import os
import logging
import torch
from torch import nn, optim
from torch.autograd import Variable
from torchvision import datasets, transforms
import matplotlib.pyplot as plt
from args import args, device
from model import Generator, DiscriminatorAndQ
from dataloader import m... | jxcodetw/NCTU_HW | Deep_Learning/lab4/infoGAN/eval.py | eval.py | py | 1,985 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "args.args.summary_path",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "args.args",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "os.path.join",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path",
"lin... |
43056699867 | import json
import re
import random
from time import sleep
import yaml
from filelock import FileLock
from requests import request
import pytest
from api.util import Util
import requests
from api.baseapi import BaseApi
class Weworlk(BaseApi):
def __init__(self):
self.token = Util().get_token()
... | xwl65/apiobject-backup | untitled4/api/wework.py | wework.py | py | 3,783 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "api.baseapi.BaseApi",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "api.util.Util",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "yaml.safe_load",
"line_number": 59,
"usage_type": "call"
}
] |
3047912921 | import datetime
import logging
from tinkoff.invest import Client, Quotation, StopOrderDirection, StopOrderExpirationType, StopOrderType, StopOrder
from invest_api.invest_error_decorators import invest_error_logging, invest_api_retry
__all__ = ("StopOrderService")
logger = logging.getLogger(__name__)
class StopOrd... | WISEPLAT/python-code | invest-robot-contest_invest-bot-main/invest_api/services/stop_orders_service.py | stop_orders_service.py | py | 2,101 | python | en | code | 73 | github-code | 18 | [
{
"api_name": "logging.getLogger",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "tinkoff.invest.Quotation",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "tinkoff.invest.Quotation",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "t... |
28959090531 | # -*- coding: utf-8 -*-
import re
import time
from datetime import timedelta
from pyload.core.utils.purge import chars as remove_chars
from pyload.core.utils.purge import uniquify
from .account import BaseAccount
class MultiAccount(BaseAccount):
__name__ = "MultiAccount"
__type__ = "account"
__version_... | pyload/pyload | src/pyload/plugins/base/multi_account.py | multi_account.py | py | 14,871 | python | en | code | 3,038 | github-code | 18 | [
{
"api_name": "account.BaseAccount",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "re.compile",
"line_number": 111,
"usage_type": "call"
},
{
"api_name": "re.I",
"line_number": 111,
"usage_type": "attribute"
},
{
"api_name": "re.U",
"line_number": ... |
12789355103 | import numpy as np
import pandas as pd
import scipy.io
from sklearn.impute import SimpleImputer
train = pd.read_csv("../../DataSet/arrhythmia.csv", header=None)
imputer = SimpleImputer(strategy="mean")
train = pd.DataFrame(imputer.fit_transform(train))
label = np.array(train[279])
value = np.delete(np.array(train), 27... | dydekdnlt/FS | Sklearn_FS+other_FS/SOGFS/SOGFS_arrhythmia.py | SOGFS_arrhythmia.py | py | 640 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pandas.read_csv",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sklearn.impute.SimpleImputer",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.arra... |
41431807978 | import sys, socket, platform, subprocess, urllib3, json
def get_current_ip(ipv6 : bool):
ip, result, platform_name = "", "", platform.system()
if not ipv6:
if platform_name == "Linux":
result = subprocess.run(["dig", "+short" , "txt", "chaos", "whoami.cloudflare", "@1.1.1.1"], stdout=subpr... | KingsFourze/ddns-cloudflare | ddns_cloudflare.py | ddns_cloudflare.py | py | 4,689 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "platform.system",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "subprocess.run",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "subprocess.PIPE",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "subprocess.run",
... |
2687234953 | ##Luke Meyers 4/14/22
#Piecewise function test
#the usual
import matplotlib as mpl
from matplotlib import pyplot as plt
import numpy as np
'''
xData = []
yData = []
xData = [1,2,3,4] #Test Data
yData = [2,4,6,8]
'''
def pieceWise(x1,y1,x2,y2,x3=0,y3=0):#inputs need to be cooridinates
'''creates a peicewi... | lqmeyers/Bac_Media_Sim | Scripts/4_14_22_Piecewise_Plot_Test.py | 4_14_22_Piecewise_Plot_Test.py | py | 968 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 40,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.show",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "m... |
22794877520 | import glob
import os
import requests
import streamlit as st
import pandas as pd
import matplotlib.pyplot as plt
from mpl_toolkits.basemap import Basemap
import numpy as np
import pydeck as pdk
from geopy import distance
from tools3.ws_utilities import call_word2dict
INPUT_DIR = '../../data/processed/memo_loc'
#i... | Nicolaihs/nernet | nernet/visualization/st_location.py | st_location.py | py | 6,080 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "os.path.join",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "glob.glob",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "os.path.basename",
"line_numb... |
40526604320 | from django.conf.urls import patterns, url
from views import *
urlpatterns = patterns('myapp.views',
url(r'^note/(?P<pk>\d+)$',
NoteDetailView.as_view(),
name='note_detail'),
# url(r'^search',
# ... | lxdiyun/haystack_demo | myapp/urls.py | urls.py | py | 413 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "django.conf.urls.patterns",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 5,
"usage_type": "call"
}
] |
70820035879 | from __future__ import print_function
import pandas as pd
import numpy as np
import os
import time
import h5py
from sklearn.externals import joblib
from sklearn.linear_model import BayesianRidge
from keras.layers import Input, Dense, Activation, LeakyReLU, BatchNormalization, GRUCell, Flatten
from keras.layers import D... | killeRNight/statistical-arbitrage-trading-model | fit_fn.py | fit_fn.py | py | 74,130 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "numpy.random.seed",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.set_random_seed",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "pandas... |
16175190852 | import sys
import inspect
import nbformat
from IPython.lib.kernel import get_connection_file
from jupyter_client import BlockingKernelClient
def logical_xor(a, b): return bool(a) ^ bool(b)
def run_cell(notebook_path, cell_number=None, cell_tag=None):
assert logical_xor((True if cell_number is not None else False)... | cmrfrd/self2face | notebooks/FaceGeneration/util.py | util.py | py | 1,825 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "nbformat.read",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "jupyter_client.BlockingKernelClient",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "IPython.lib.kernel.get_connection_file",
"line_number": 42,
"usage_type": "call"
}
] |
71464972199 | #
from PIL import Image, ImageDraw
image = Image.open('figimage.jpg')
draw = ImageDraw.Draw(image)
# change this when the calibration vs. when you're making hte thesis figure
r = 1450/2
x = 1936
y = 1296
draw.ellipse((x-r, y-r, x+r, y+r))
image.save('maxradius.png')
image.show()
| fsbr/unh-startracker | analysisAndPlots/astro/image/centerPixelCircle.py | centerPixelCircle.py | py | 281 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "PIL.Image.open",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 3,
"usage_type": "name"
},
{
"api_name": "PIL.ImageDraw.Draw",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "PIL.ImageDraw",
"line_nu... |
41227602181 | from env import model_configs
from app import api, app, nlp
from flask_restful import Resource, reqparse
from tqdm import tqdm
from flask_pymongo import PyMongo
import uuid
import time
import json
import os
from data_generator import vi_tokenize
from infer import infer_coliee_task3, list_split, init_state
from utils... | anhquan075/CS336-legal-text-retrieval | web/backend/run.py | run.py | py | 7,907 | python | en | code | 6 | github-code | 18 | [
{
"api_name": "utils_api.parser.get_config",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "app.app.config",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "app.app",
... |
9398274022 | import numpy as np
import matplotlib.pyplot as plt
from astropy.io import ascii
from scipy.optimize import curve_fit
from uncertainties.unumpy import (nominal_values as noms,
std_devs as stds)
import uncertainties.unumpy as unp
from uncertainties import ufloat
from scipy.constants impo... | KarlSchiller/2018-SS-FP | V61-HeNe/python/tem00.py | tem00.py | py | 1,306 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "numpy.exp",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.genfromtxt",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.linspace",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "scipy.optimize.curve_fit",
... |
16623761971 | # coding: utf-8
# Standard libraries
from typing import Tuple, Union
# https://github.com/usnistgov/DataModelDict
from DataModelDict import DataModelDict as DM
# https://scipy.org/
from scipy.special import comb
# Local imports
from . import PotentialLAMMPSBuilder
from ...tools import aslist
class PairBuilder(Poten... | usnistgov/potentials | potentials/buildrecord/potential_LAMMPS/PairBuilder.py | PairBuilder.py | py | 12,869 | python | en | code | 9 | github-code | 18 | [
{
"api_name": "typing.Union",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "tools.aslist",
"line_number": 105,
"usage_type": "call"
},
{
"api_name": "typing.Tuple",
"line_number": 115,
"usage_type": "name"
},
{
"api_name": "typing.Union",
"line_num... |
72006771881 |
import socket_server as socketServer
import os
import sys
import json
import websockets
import asyncio
import time
import protocol
from datetime import datetime
import redis
redisClient = redis.Redis(host='localhost', port=6379, db=0, password="admin")
t = time.localtime()
current_time = time.strftime("%H:%M:%S", t... | ducan3007/network-programming | websocket.py | websocket.py | py | 3,465 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "redis.Redis",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "time.localtime",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "time.strftime",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
... |
25002856328 | import torch as th
import torch.nn as nn
import torch.nn.functional as F
def onehot_encode(tensor, target_dim):
y_onehot = tensor.new(*tensor.shape[:-1], target_dim).zero_()
y_onehot.scatter_(-1, tensor.long(), 1)
return y_onehot.float()
class IACritic(nn.Module):
def __init__(self, scheme, args):
... | hahayonghuming/VDACs | src/modules/critics/iac_critic.py | iac_critic.py | py | 1,796 | python | en | code | 33 | github-code | 18 | [
{
"api_name": "torch.nn.Module",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "torch.nn.Linear",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_nu... |
25980542203 | from fileinput import filename
import numpy as np
import os
from PIL import Image
import pandas as pd
import argparse
import shutil
from yaml.loader import SafeLoader
import yaml
import ast
from glob import glob
# This script will create a consolidated file with a "best alignment" column that will contain the best para... | aics-int/multiplex_immuno_processing | old_workflow/create_merged_aligned_params.py | create_merged_aligned_params.py | py | 6,096 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path.basename",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "pandas.read_csv... |
74144736681 | import requests as rq
from lxml import html
import json
class Head:
def __init__(self):
self.name = ""
self.b64 = ""
self.tags = []
self.ingredients = {}
def from_url(self, url):
resp = rq.get(url)
if resp.status_code != 200:
raise rq.exceptions.Req... | xImAnton/HeadCraft | crawler/crawl.py | crawl.py | py | 1,283 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "requests.get",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "requests.exceptions.RequestException",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "requests.exceptions",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_na... |
6290516924 | import hashlib
import os
import os.path as osp
import cv2
import mmcv
import numpy as np
import pyassimp
import pyassimp.postprocess
# import optimesh
import scipy
from meshplex import MeshTri
from plyfile import PlyData, PlyElement
from scipy.spatial.distance import pdist
from skimage import measure
from tqdm import... | shanice-l/gdrnpp_bop2022 | lib/render_vispy/model3d.py | model3d.py | py | 21,087 | python | en | code | 145 | github-code | 18 | [
{
"api_name": "numpy.bincount",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "numpy.average",
"line_number": 76,
"usage_type": "call"
},
{
"api_name": "numpy.average",
"line_number": 77,
"usage_type": "call"
},
{
"api_name": "numpy.average",
"line_... |
2116427882 | import csv
import sqlite3
from sqlite3 import Error
def sql_connection():
try:
con = sqlite3.connect('titanic.db')
return con
except Error:
print(Error)
def sql_table(con):
cursorObj = con.cursor()
cursorObj.execute("CREATE TABLE IF NOT EXISTS employees(i... | fiharet34/titanic | titanik.py | titanik.py | py | 569 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "sqlite3.connect",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sqlite3.Error",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "sqlite3.Error",
"line_number": 12,
"usage_type": "argument"
},
{
"api_name": "csv.reader",
"line... |
35799545163 | from typing import List
from webdnn.backend.code_generator.allocator import MemoryLayout
from webdnn.backend.code_generator.injectors.buffer_injector import BufferInjector
from webdnn.backend.code_generator.injectors.kernel_name_injector import KernelNameInjector
from webdnn.backend.webgpu.generator import WebGPUDescr... | LinXueyuanStdio/hash2face | webdnn/src/graph_transpiler/webdnn/backend/webgpu/kernels/embedding.py | embedding.py | py | 2,655 | python | en | code | 4 | github-code | 18 | [
{
"api_name": "webdnn.graph.operators.embedding.Embedding",
"line_number": 42,
"usage_type": "name"
},
{
"api_name": "webdnn.backend.code_generator.allocator.MemoryLayout",
"line_number": 42,
"usage_type": "name"
},
{
"api_name": "webdnn.graph.order.OrderNT",
"line_number": 4... |
42341727461 | #!/usr/bin/env python
import rospy
from sensor_msgs.msg import LaserScan
from gazebo_msgs.srv import GetModelState
from nav_msgs.msg import OccupancyGrid
from nav_msgs.msg import Odometry
import random
from geometry_msgs.msg import Twist
from tf.transformations import euler_from_quaternion, quaternion_from_euler
import... | ShravanSingh2/SLAM-with-ros-Robot | robot_assignment_ws/a.py | a.py | py | 8,930 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "numpy.array",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.asarray",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "numpy.int8",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "tf.transformations.euler_fr... |
101171251 | import os
from cryptography.fernet import Fernet
from pathlib import Path
from getpass import getpass
import sys
password = getpass()
pasta = ""
#pasta = "C:\Temp\BACKUP\Pasta"
# endereco = "C:\\Users\\rodol\\Dropbox\\Pasta"
if pasta == "":
os.chdir(".")
else:
os.chdir(pasta)
keyFile = "thekey.key"
if pas... | rodolforomao/ransonware | ransonware.py | ransonware.py | py | 2,119 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "getpass.getpass",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.chdir",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.chdir",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 28... |
20177147059 | import numpy as np
from collections import defaultdict, OrderedDict
# returns signed clockwise angular difference
def angle_between(p1, p2):
ang1 = np.arctan2(*p1)
ang2 = np.arctan2(*p2)
return np.rad2deg((ang1 - ang2) % (2 * np.pi))
def distance_between(p1, p2):
return np.sqrt((p2[0] - p1[0])**2 + (p... | MatejBabis/AdventOfCode2k19 | day10.py | day10.py | py | 2,627 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "numpy.arctan2",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "numpy.arctan2",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.rad2deg",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.pi",
"line_number": ... |
22282182181 | import random
import logging
from mysql.connector import Error
from database.users import *
import MySQLdb.cursors
get_all_active_games_by_both_user_id = None
class Games:
def add_game(dbCur, user_one, user_two):
try:
logging.debug("Adding game into db")
dbCur.execute("INSERT into ... | bdougla4/ISA681_project | database/games.py | games.py | py | 7,364 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "logging.debug",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "logging.info",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "mysql.connector.Error",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "logging.error",
... |
32268322986 | from enum import IntFlag
from itertools import product
from prettytable import PrettyTable
import sys
import os
from typing import List
from omegaconf import OmegaConf
import omegaconf.dictconfig
import omegaconf.listconfig
import time
import logging
import pynvml
import subprocess
from subprocess import PIPE,Popen
imp... | RichealYoung/BRIEF_PyTorch | utils/TasksManager.py | TasksManager.py | py | 13,187 | python | en | code | 5 | github-code | 18 | [
{
"api_name": "pynvml.nvmlInit",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "sys.platform",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "typing.List",
"line_number": 54,
"usage_type": "name"
},
{
"api_name": "subprocess.Popen",
... |
70152713960 | import cv2
ix, iy = -1, -1
# mouse callback function
def getxy(event, x, y, flags, param):
global ix, iy
if event == cv2.EVENT_LBUTTONDOWN:
#ix, iy = x, y
#print(x, y)
color = list(img[y][x])
color = color[::-1]
print("Color in (r,g,b) at ", (x,y) ,":",color... | LeelaSravaniAtmakuri/CiphenseInc_SmartMirror | RGB values on mouse click.py | RGB values on mouse click.py | py | 511 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "cv2.EVENT_LBUTTONDOWN",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "cv2.imread",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "cv2.namedWindow",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "cv2.setMouseCall... |
12120172042 | import datetime
import pytz
import requests
import lxml.html
from tv_schedule import schedule, dateutil
def need_channel_code():
return False
_URL = 'http://kanalukraina.tv/ru/schedule/single/schedule/%d-%m-%Y/'
_source_tz = pytz.timezone('Europe/Kiev')
_daydelta = datetime.timedelta(1)
_parser = lxml.html.HTMLP... | eugene-a/TvSchedule | tv_schedule/source/ukraina.py | ukraina.py | py | 2,132 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pytz.timezone",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "datetime.timedelta",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "lxml.html.html.HTMLParser",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "lxml.html.... |
19258393703 | """
.. module:: contacts.validation
:synopsis: locations validation module
*contacts* application validation module.
"""
from __future__ import absolute_import
from django.core.exceptions import ValidationError
from django.utils.translation import ugettext_lazy as _
def contact_validation(contact):
"""Val... | ajaniv/django-contacts | contacts/validation.py | validation.py | py | 1,886 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "django.core.exceptions.ValidationError",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "django.utils.translation.ugettext_lazy",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "django.core.exceptions.ValidationError",
"line_number": 26,
... |
8455315948 | # -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: https://doc.scrapy.org/en/latest/topics/item-pipeline.html
from scrapy.exceptions import DropItem
class DuplicateURLsPipeline(object):
def __init__(self):
self.urls_seen ... | activatedgeek/winemag-dataset | winemag/pipelines.py | pipelines.py | py | 572 | python | en | code | 7 | github-code | 18 | [
{
"api_name": "scrapy.exceptions.DropItem",
"line_number": 18,
"usage_type": "call"
}
] |
71006581479 | """
This module implement a Rotate filter.
"""
from PIL import Image
from .interface import ImagineFilterInterface
class RotateFilter(ImagineFilterInterface):
"""
Rotate filter
"""
angle = None
def __init__(self, **kwargs):
"""
:param kwargs: dict
"""
if 'angle' in... | FlaskGuys/Flask-Imagine | flask_imagine/filters/rotate.py | rotate.py | py | 935 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "interface.ImagineFilterInterface",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "PIL.Image.Image",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "PIL.Image",
"line_number": 29,
"usage_type": "name"
}
] |
28112633439 | # https://wsvincent.com/official-django-rest-framework-tutorial-beginners-guide/
from .models import MqttAcl, MqttAccount
from rest_framework import generics
from .serializers import MqttAccountSerializer, MqttAclSerializer
from django.views.decorators.csrf import csrf_exempt
from django.http import JsonResponse
# http... | wmhass/Heater-Controller-mqtt_access_control_api | authorizationapi/views.py | views.py | py | 5,020 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "hashlib.md5",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "models.MqttAccount.objects.get",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "models.MqttAccount.objects",
"line_number": 33,
"usage_type": "attribute"
},
{
"api_na... |
23923359255 | from typing import Any
import urwid
from .browser import Browser
from . import gcnodes
def haslen(value) -> bool:
if isinstance(value, (list, set, dict, tuple, str, bytes)):
return True
return False
class TypeInfoNode(urwid.TreeNode):
def __init__(self, browser: Browser, **kwargs):
supe... | rohanpm/cobrowser | cobrowser/_impl/info.py | info.py | py | 3,354 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "urwid.TreeNode",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "browser.Browser",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "urwid.TreeNode",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "browser.Brows... |
11830483253 | # coding: utf-8
"""
NiFi Rest API
The Rest API provides programmatic access to command and control a NiFi instance in real time. Start and stop processors, monitor queues, query provenance data, and more. Each endpoint below includes a description, ... | Chaffelson/nipyapi | nipyapi/nifi/models/verify_config_request_dto.py | verify_config_request_dto.py | py | 14,017 | python | en | code | 228 | github-code | 18 | [
{
"api_name": "six.iteritems",
"line_number": 416,
"usage_type": "call"
},
{
"api_name": "pprint.pformat",
"line_number": 440,
"usage_type": "call"
}
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.