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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
21688560721 | # -*- coding: utf-8 -*-
import re
import os
from threading import Lock
from wsgiauth.basic import BasicAuth
from werkzeug import url_decode
from werkzeug.exceptions import NotFound
from .libs.git_http_backend import assemble_WSGI_git_app
class DispatcherMiddleware(object):
"""Dispatch http request to flask ap... | xtao/code-vilya | vilya/middleware.py | middleware.py | py | 5,172 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "threading.Lock",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path.abspath",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "wsgiauth.basic.BasicAuth"... |
71343271039 | # -*- coding: utf-8 -*-
"""
Created on Sat Nov 3 12:06:01 2018
@author: pasca
"""
import base64
from flask import Flask, render_template
from graphviz import Graph
import os
os.environ["PATH"] += os.pathsep + 'C:/ProgramData/Miniconda3/Library/bin/graphviz'
#%%
app = Flask(__name__)
@app.route('/')
def svgtes... | pdubucq/gists | poc_flask_graphviz.py | poc_flask_graphviz.py | py | 634 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "os.environ",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "os.pathsep",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "flask.Flask",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "graphviz.Graph",
"lin... |
29729107947 | import numpy as np
from dataclasses import dataclass
from src.utils.environment import Trace, Action
@dataclass
class SelfPlayStatistics:
rewards: list[float]
avg_reward: float
milli_big_blinds_per_hand: float
elo_ratings: list[float]
avg_hand_length: float
illegal_actions_proportion: float
... | Reinforcement-Poker/PokerAgents | src/agents/alphaholdem/stats.py | stats.py | py | 4,360 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "dataclasses.dataclass",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "src.utils.environment.Trace",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "numpy.ndarray",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "n... |
29510515782 | from django import template
from django.utils.safestring import mark_safe
register = template.Library()
@register.filter
def bar_chart(parts):
maxv = max([int(x["y"]) for x in parts])
bar_width = 15
bar_space = 15
group_space = 20
width = min(1000, ((bar_space + group_space) * (len(parts) + 1))... | gpodder/mygpo | mygpo/publisher/templatetags/pcharts.py | pcharts.py | py | 872 | python | en | code | 257 | github-code | 97 | [
{
"api_name": "django.template.Library",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "django.template",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "django.utils.safestring.mark_safe",
"line_number": 28,
"usage_type": "call"
}
] |
29867333598 | import numpy as np
import time
import math
import matplotlib.pyplot as plt
from rrt_star2D import node , rrt_star
from RobotArm2D import Robot, map, pmap
iteration = 3000
map = pmap()
# map = map()
base_position = [15, 15]
link_lenths = [5, 5]
robot = Robot(base_position, link_lenths, map)
c_map = robot.construct_conf... | yeongmin01/Path-planning-with-UR5e | configuration2D/example-config2D.py | example-config2D.py | py | 2,737 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "RobotArm2D.map",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "RobotArm2D.pmap",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "RobotArm2D.Robot",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "RobotArm2D.map",
"l... |
186648319 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""# @Date : 20211008
# @Author : Donglin Han
所属分组
合约测试基线用例//01 交割合约//12 指数
用例标题
校验交割业务线指数是否正常计算
前置条件
打开了合约交割的交易界面
步骤/文本
1、通过接口获取某个品种的指数(例如BTC-USD)
2、对比指数接口两次的数据
3、校验指数是否有变化
预期结果
1)品种的指数价格有正常变化
优先级
0
用例编号
TestContractIndex_001
自动化作者
... | wenyan808/auto-test | testCase/ContractTestCase/12_Index/TestContractIndex_001.py | TestContractIndex_001.py | py | 2,961 | python | zh | code | 0 | github-code | 97 | [
{
"api_name": "allure.step",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "allure.step",
"line_number": 63,
"usage_type": "call"
},
{
"api_name": "common.ContractServiceAPI.t.contract_index",
"line_number": 64,
"usage_type": "call"
},
{
"api_name": "co... |
28940391798 | #Reference https://github.com/sooftware/attentions
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch import Tensor
import numpy as np
import math
from math import sqrt
from typing import Optional, Tuple
class ScaledDotProductAttention(nn.Module):
"""
Scale... | LEE-SEON-WOO/TSCP2_pytorch | src/models/attentions.py | attentions.py | py | 32,152 | python | en | code | 11 | github-code | 97 | [
{
"api_name": "torch.nn.Module",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "numpy.sqrt",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "torch.Tensor",
"line_num... |
25994258065 | from django.shortcuts import render,redirect
from .models import *
from .forms import *
# Create your views here.
def add_new(request):
if request.method == "POST":
form = Student1Form(request.POST)
if form.is_valid():
try:
form.save()
return redirect("/... | pkumar-234024/python_project | sessional_management/sessional_marks/views.py | views.py | py | 3,180 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "django.shortcuts.redirect",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 23,
"usage_type": "call"
},
{
"api_nam... |
35346648316 | from pyspark.sql import SparkSession
import Minsait.Constants.constants as c
from Minsait.Transform.transformations import Transformation
def main():
spark = SparkSession.builder.appName(c.APP_NAME).master(c.MODE).getOrCreate()
simsomps = spark.read.option(c.DELIMITER, "|").option(c.HEADER,c.TRUE_STRING).csv(c... | turboDeveloperD/theSimpsondata | main.py | main.py | py | 1,368 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pyspark.sql.SparkSession.builder.appName",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pyspark.sql.SparkSession.builder",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "pyspark.sql.SparkSession",
"line_number": 6,
"usage_type": "... |
73930122239 | import contextlib
import csv
import pprint
import sys
from datetime import datetime
from nesteddict import NestedDict
import pymongo
class CursorFormatter(object):
'''
Output a set of cursor elements by iterating over then.
If root is a file name output the content to that file.
'''
def __init... | jdrumgoole/pymag | pymag/cursor.py | cursor.py | py | 5,503 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pymongo.cursor",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "pymongo.command_cursor",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "sys.stdout",
"line_number": 45,
"usage_type": "attribute"
},
{
"api_name": "sys.s... |
38391553510 | from django.shortcuts import get_object_or_404, redirect, render
from django.contrib.auth.hashers import make_password
from django.contrib.auth.models import User
from django.contrib import messages
from django.contrib.auth import authenticate, login, logout
from django.contrib.auth.decorators import login_required
fro... | free20064u/schoolmanagement | course/views.py | views.py | py | 6,072 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "django.contrib.auth.authenticate",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.login",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "django.contrib.messages.success",
"line_number": 21,
"usage_type": "call"
},... |
42601274427 | """Helper functions for the quickdraw app."""
import math
import urllib.request
from datetime import datetime
from pathlib import Path
from typing import List, Optional
import numpy as np
import requests
import torch
from torch import nn
from tqdm.auto import tqdm
from transformers import EvalPrediction, Trainer, Tra... | unionai-oss/unionml | unionml/templates/quickdraw/{{cookiecutter.app_name}}/helpers.py | helpers.py | py | 5,764 | python | en | code | 317 | github-code | 97 | [
{
"api_name": "torch.utils",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "numpy.float32",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "torch.from_numpy",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "torch.stack",
... |
1257722929 | import cv2
import numpy as np
print(cv2.__version__)
PATH_TO_IMAGE = '../../resources/mainlogo.png'
image = cv2.imread(PATH_TO_IMAGE, 1)
#cv2.IMREAD_COLOR #1(default)
#cv2.IMREAD_GRAYSCALE #0
#cv2.IMREAD_UNCHANGED #-1
cv2.imshow('image', image)
cv2.waitKey(0)
cv2.destroyAllWindows()
cv2.namedWindow('name... | DenisLaptev/opencv_docs | app/src/Ch1_intoduction/lesson1_Introduction.py | lesson1_Introduction.py | py | 437 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "cv2.__version__",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "cv2.imread",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "cv2.imshow",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "cv2.waitKey",
"line_numb... |
5379647511 | import numpy as np
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
import matplotlib.lines as lines
from scipy.constants import pi
import sympy as sym
import pandas as pd
from vcsv_parser import vcsv_cols
import logging
sim_dir = "/home/zoltan/publications/vco_cmos_sf/bin/"
f_vc... | horror-vacui/mpl_examples | vco_cmos_sf_Q_TR_opt.py | vco_cmos_sf_Q_TR_opt.py | py | 5,775 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "logging.getLogger",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "logging.StreamHandler",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "logging.DE... |
72621460800 | from google.cloud import monitoring_v3
import click
import datetime
import json
import os
import sys
parent = os.path.abspath('.')
sys.path.insert(1, parent)
from capacity_planner import CapacityPlanner # noqa: E402
@click.command()
@click.option(
'--project_id', required=True, type=str,
help='GCP projec... | GoogleCloudPlatform/professional-services | tools/capacity-planner-cli/tools/dump_query_result.py | dump_query_result.py | py | 2,375 | python | en | code | 2,602 | github-code | 97 | [
{
"api_name": "os.path.abspath",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "sys.path.insert",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_num... |
8543784214 | # -*- coding: utf-8 -*-
"""
Created on Sat Jan 15 12:06:15 2022
@author: anna
"""
#!/usr/bin/env python3
import logging
import util
import yao
from abc import ABC, abstractmethod
"""IMPORT RE and PANDAS"""
import re
import pandas as pd
logging.basicConfig(format="[%(levelname)s] %(message)s",
... | anna-38/IntroToCybersec | main.py | main.py | py | 9,628 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "logging.basicConfig",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "logging.WARNING",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "abc.ABC",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "util.parse_json",
... |
30112548541 | from django.contrib.auth import get_user_model
from django.test import TestCase
from django.urls import reverse
from django_loci.tests.base.test_admin import BaseTestAdmin
from swapper import load_model
from ...tests.utils import TestAdminMixin
from .utils import TestGeoMixin
Device = load_model('config', 'Device')
L... | openwisp/openwisp-controller | openwisp_controller/geo/tests/test_admin.py | test_admin.py | py | 4,905 | python | en | code | 505 | github-code | 97 | [
{
"api_name": "swapper.load_model",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "swapper.load_model",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "swapper.load_model",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "swapper.load... |
8574584715 |
import cv2
import matplotlib.pyplot as plt
import numpy as np
import mediapipe as mp
import struct
import json
Debug = False
mp_drawing = mp.solutions.drawing_utils
mp_drawing_styles = mp.solutions.drawing_styles
mp_hands = mp.solutions.hands
stream = open(r'\\.\pipe\NPtest', 'r+b', 0)
i = 1
with mp_hands.Hands(
... | InVected/RealHand | python/main.py | main.py | py | 2,717 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "mediapipe.solutions",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "mediapipe.solutions",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "mediapipe.solutions",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_na... |
4085633772 | import random
import linecache
import PlayerClass
class Hangman:
def __init__(self):
self.a = random.randint(1, 214)
self.specLine = linecache.getline("HangmanWords.txt", self.a)
self.charList = []
self.player = PlayerClass.Player()
self.name = "Player"
self.num_gue... | RachelRebecca/MyHangman | ComputerHangman.py | ComputerHangman.py | py | 5,351 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "random.randint",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "linecache.getline",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "PlayerClass.Player",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "random.randint",
... |
74505632959 | import altair as alt
import pandas as pd
empty = ee.Array([], ee.PixelType.int8())
display(empty.mod(empty)) # []
display(ee.Array([0, 0]).mod(ee.Array([-1, 2]))) # [0,0]
# [0,0,0,0,0]
display(ee.Array([0, 1, 2, 3, 4]).mod(ee.Array([1, 1, 1, 1, 1])))
# [0,1,0,1,0]
display(ee.Array([0, 1, 2, 3, 4]).mod(ee.Array([2... | google/earthengine-community | samples/python/apidocs/ee_array_mod.py | ee_array_mod.py | py | 1,261 | python | en | code | 445 | github-code | 97 | [
{
"api_name": "pandas.DataFrame",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "altair.Chart",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "altair.X",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "altair.Y",
"line_number": ... |
22106352692 | from setuptools import find_packages, setup
from glob import glob
from os import path
package_name = 'object_classifier'
setup(
name=package_name,
version='0.0.0',
packages=find_packages(exclude=['test']),
data_files=[
('share/ament_index/resource_index/packages',
['resource/' + pa... | MateusSMenines/obstacle_classifier | object_classifier/setup.py | setup.py | py | 961 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "setuptools.setup",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "setuptools.find_packages",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path",
"... |
38857305498 | from __future__ import print_function
from zope.interface import implementer
from twisted.trial import unittest
from twisted.internet import defer, protocol, reactor
from twisted.internet.error import ConnectionRefusedError
from foolscap.api import RemoteInterface, Referenceable, flushEventualQueue, \
BananaError,... | warner/foolscap | src/foolscap/test/test_gifts.py | test_gifts.py | py | 26,866 | python | en | code | 50 | github-code | 97 | [
{
"api_name": "foolscap.api.RemoteInterface",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "foolscap.test.common.RIHelper",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "foolscap.api.Referenceable",
"line_number": 20,
"usage_type": "name"
},
{
... |
70214599678 | import torch, torchvision
from torchvision.transforms import transforms
import os, numpy
import torch.nn as nn
import torch.nn.functional as F
from torch.optim.adam import Adam
from helpers import *
import torchshow as ts
from torchvision.datasets.mnist import MNIST
from torchvision.datasets.cifar import CIFAR10
# fro... | aditya-nutakki/pfs | ddpm/ddpm.py | ddpm.py | py | 7,221 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.makedirs",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "torch.nn.Module",
"line_number": 34,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
... |
15876530539 | import re
import logging
REGISTER_RE = re.compile(r'([cCdhHi]@)?(\d+)(/[^:|]*)?([:|].*)?')
class Definitions:
def __init__(self, silent):
self.registers = {}
self.presenters = {}
self.silent = silent
def parse(self, filenames):
for filename in filenames:
if filena... | favalex/modbus-cli | modbus_cli/definitions.py | definitions.py | py | 2,156 | python | en | code | 132 | github-code | 97 | [
{
"api_name": "re.compile",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "logging.info",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "logging.warning",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "logging.warning",
"line_nu... |
33385374748 | import objects
import greenlet
class Greenlet(object):
def __init__(self, greenlet, parent):
self.greenlet = greenlet
self.parent = parent
def switch(self, args):
res = self.greenlet.switch(args)
if res is objects.null:
return objects.null
if len(res) == 1:
... | cheery/20131031-compiler | greenlet_wrapper.py | greenlet_wrapper.py | py | 1,240 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "objects.null",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "objects.null",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "objects.true",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "objects.false",... |
72457767360 | import os
import json
from functools import reduce
import jinja2
import pandas as pd
from qualipy.reports.base import BaseJinjaView, convert_to_markup
from qualipy.project import Project
from qualipy.util import get_project_data
from qualipy.reports.visualization.batch import (
plot_correlation,
numeric_batch... | baasman/qualipy | qualipy/reports/batch.py | batch.py | py | 15,946 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "qualipy.reports.base.BaseJinjaView",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "os.path.expanduser",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 35,
"usage_type": "attribute"
},
{
"api_name": "os... |
539092087 | import sys
from io import StringIO
from typing import List
class Solution:
def divide(self, dividend: int, divisor: int) -> int:
if dividend == 0:
return 0
isAnsNegative = (dividend < 0) ^ (divisor < 0)
if dividend < 0:
dividend = -dividend
if divisor < 0:
... | wf9a5m75/leetcode | divide-two-integers/solution.py | solution.py | py | 2,660 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "io.StringIO",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "sys.stdin",
"line_number": 51,
"usage_type": "attribute"
},
{
"api_name": "sys.stdout",
"line_number": 52,
"usage_type": "attribute"
},
{
"api_name": "sys.stdin",
"line_numb... |
35245299927 | import matplotlib.pyplot as plt
views = [127, 128, 254, 658, 958, 500, 999]
days = range(1,8)
#x,y
#label is required for legend
plt.plot(days, views, label='Channel Views', color='r', marker='D', markerfacecolor='b', linestyle='-.', linewidth=2)
#label
plt.xlabel('Day Number')
plt.ylabel('Views')
#legend
plt.leg... | prafful/python_jan_2020 | 39_matplotlib_02.py | 39_matplotlib_02.py | py | 404 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.xlabel",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "mat... |
7181702761 | # -*- coding:utf-8 -*-
# Author: JianPei
# @Time : 2021/07/30 14:42
import re
import time
from pymysql import connect
URL_FUNC_DICT = dict()
def route(path):
"""路由装饰器"""
def set_func(func):
# URL_FUNC_DICT['/index.py'] = index
URL_FUNC_DICT[path] = func
def call_func(*args, **kwargs... | Hello-JianPeiLi/PYTHON | web服务器/mini_web-v1.7/dynamic/mini_frame.py | mini_frame.py | py | 4,283 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pymysql.connect",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "pymysql.connect",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 84,
"usage_type": "call"
},
{
"api_name": "pymysql.connect",
"line_nu... |
44834353638 | import openai
import gradio
import pytesseract
from PIL import Image
# Set your OpenAI API key
openai.api_key = "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"
# Initial message from the system
messages = [{"role": "system", "content": "You are HR for job interview "}]
# Function to extract text fro... | 21wh1a6663/Bankathon | import openai3.py | import openai3.py | py | 2,717 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "openai.api_key",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "PIL.Image.open",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "pytesseract.image_to_stri... |
1086854127 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from advertorch.utils import batch_clamp, clamp
from advertorch.utils import replicate_input, replicate_input_withgrad
import torch as torch
from .base import Attack, La... | BorealisAI/advertorch | advertorch/attacks/deepfool.py | deepfool.py | py | 5,715 | python | en | code | 1,222 | github-code | 97 | [
{
"api_name": "base.Attack",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "base.LabelMixin",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "advertorch.utils.replicate_input_withgrad",
"line_number": 94,
"usage_type": "call"
},
{
"api_name": ... |
74137568317 | from django.urls import path
from . import views
urlpatterns = [
path('', views.tasks, name='base'),
path('edit_task/<int:id>', views.edit_task, name='edit_task'),
path('remove/<int:id>', views.remove_task, name='remove_task'),
path('new_task/', views.new_task, name='new_task'),
path('search/', vie... | Tobarra00/ToDoList | ToDoList/Base/urls.py | urls.py | py | 535 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "django.urls.path",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
20477068150 | import os
from typing import Pattern, Set
import functools
__all__ = ["is_valid_postgres_column_name", "is_reserved_postgres_keyword"]
from is_valid_postgres_column_name.constants import (
DEFAULT_PATTERN,
SUPPORTED_POSTGRESQL_VERSIONS,
)
@functools.lru_cache(maxsize=3)
def _get_keywords(v: float) -> Set[... | tomwojcik/is_valid_postgres_column_name | is_valid_postgres_column_name/main.py | main.py | py | 1,437 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "is_valid_postgres_column_name.constants.SUPPORTED_POSTGRESQL_VERSIONS",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "os.path.split",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 20,
"usage_type": "attribute... |
17486344898 | """
File: video_processor.py
Author: Adam Applegate
Description:
Uses OpenCV to edit videos based on input from the UI
"""
import numpy as np
import cv2
class VideoProcessor():
def __init__(self):
super.__init__
def filter_video(self, filter):
video = cv2.VideoCapture(self.filename)... | adamgate/Filter-Free | video_processor.py | video_processor.py | py | 1,707 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "cv2.CAP_PROP_FRAME_WIDTH",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "cv2.CAP_PROP_FRAME_HEIGHT",
"line_number": 22,
"usage_type": "attribute"
},
{
"api... |
4841187522 | import discord
from discord.commands import slash_command
from discord.ext import commands
from settings import msglist, get
import time
import datetime
time_conv = "time.strftime('%Y-%m-%d %H:%M:%S', time.localtime({}))"
with open("./db/perms/" + "modids.txt", "r") as rdf:
permissions = rdf.read().split('\n')
... | Boronide/Moderationide | cogs/moderative.py | moderative.py | py | 7,250 | python | en | code | 4 | github-code | 97 | [
{
"api_name": "settings.msglist.log_format_txt.format",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "settings.msglist.log_format_txt",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "settings.msglist",
"line_number": 17,
"usage_type": "name"
... |
74842173757 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.Create... | yrchen/CommonRepo | commonrepo/groups/migrations/0001_initial.py | 0001_initial.py | py | 1,103 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.swappable_dependency",
"line_number": 11,
"usage_type": "call... |
20367152059 | from app.models import Order, Product, OrderItem
from app.api.v1 import api_v1
from app.helpers import Messages, Responses
from app.helpers.utility import res, parse_int, get_page_from_args
from flask import jsonify, request
from app.decorators.authorisation import admin_only
from dateutil.parser import parse
import da... | RoadRunner11/Adaya | app/api/v1/admin/order_api_admin.py | order_api_admin.py | py | 4,420 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "app.helpers.utility.get_page_from_args",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "flask.request.args.get",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "flask.request.args",
"line_number": 16,
"usage_type": "attribute"
},
{
... |
74879667517 | import pickle as pkl
import time
import numpy as np
from itertools import count
from kmp3d import KMP, GMM, ReferenceTrajectoryPoint
from pyrobolearn.tools.interfaces.controllers.xbox import XboxControllerInterface
from pyrobolearn.simulators import Bullet
from pyrobolearn.worlds import BasicWorld
from pyrobolearn.r... | thejose5/rlfd-with-obstacle-avoidance | 2D_toy_problem/query_kmp3d_obstacles.py | query_kmp3d_obstacles.py | py | 3,129 | python | en | code | 5 | github-code | 97 | [
{
"api_name": "pyrobolearn.tools.interfaces.controllers.xbox.XboxControllerInterface",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pyrobolearn.simulators.Bullet",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "pyrobolearn.worlds.BasicWorld",
"line_num... |
3430287898 | import pickle
import inflection
import pandas as pd
import numpy as np
import math
import datetime
class Rossman(object):
def __init__(self):
self.home_path = ''
self.competition_distance_scaler = pickle.load(open(self.home_path + 'parameter/competition_distance_scal... | joaomj/heroku_app | rossman/Rossman.py | Rossman.py | py | 10,717 | python | pt | code | 0 | github-code | 97 | [
{
"api_name": "pickle.load",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"line_number": ... |
22034255352 | import logging
import os
from unittest import TestCase
from unittest.mock import patch
import pytest
from kubernetes.dynamic import Resource
from kubernetes.dynamic.exceptions import ResourceNotFoundError
import reconcile.utils.oc
from reconcile.utils.oc import (
GET_REPLICASET_MAX_ATTEMPTS,
LABEL_MAX_KEY_NAM... | app-sre/qontract-reconcile | reconcile/test/utils/test_oc.py | test_oc.py | py | 35,902 | python | en | code | 25 | github-code | 97 | [
{
"api_name": "unittest.TestCase",
"line_number": 34,
"usage_type": "name"
},
{
"api_name": "reconcile.utils.openshift_resource.OpenshiftResource",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "reconcile.utils.oc.OC",
"line_number": 90,
"usage_type": "call"
... |
41232973611 | import os
import slack
import time
import pickle
import pandas as pd
import numpy as np
import re
from typing import Dict, List
from pymongo import MongoClient
from parameters import *
import requests
from random import random,seed
from datetime import datetime
from math import ceil
import time
## HELPER F... | PrithiPal/slack-api | stembot/setup_functions.py | setup_functions.py | py | 5,369 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "re.sub",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 47,
"usage... |
34720505130 | import json
from tencentcloud.common import credential
from tencentcloud.common.profile.client_profile import ClientProfile
from tencentcloud.common.profile.http_profile import HttpProfile
from tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKException
from tencentcloud.tmt.v20180321 imp... | yinqinghe/spider-crawler | Scrapy/翻译/tmt_SDK.py | tmt_SDK.py | py | 1,755 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "tencentcloud.common.credential.Credential",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "tencentcloud.common.credential",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "tencentcloud.common.profile.http_profile.HttpProfile",
"line_number"... |
20794859330 | import os
import pandas as pd
from sklearn.mixture import GaussianMixture
from pele_platform.Utilities.Helpers import bestStructs, helpers
def cluster_best_structures(
be_column: int,
residue="LIG",
topology=None,
cpus=20,
n_components=10,
n_structs=1000,
directory=".",
logger=None,
):... | nostrumbiodiscovery/pele_platform | pele_platform/PPI/cluster.py | cluster.py | py | 2,252 | python | en | code | 9 | github-code | 97 | [
{
"api_name": "pele_platform.Utilities.Helpers.bestStructs.main",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pele_platform.Utilities.Helpers.bestStructs",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "pele_platform.Utilities.Helpers.helpers.parallelize"... |
16239607957 | import logManager
import configManager
import json
import random
from time import sleep
from threading import Thread
from datetime import datetime, timedelta, time, date
from functions.request import sendRequest
from functions.daylightSensor import daylightSensor
from functions.scripts import triggerScript
bridgeConfi... | diyhue/diyHue | BridgeEmulator/services/scheduler.py | scheduler.py | py | 7,251 | python | en | code | 1,443 | github-code | 97 | [
{
"api_name": "configManager.bridgeConfig",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "logManager.logger.get_logger",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "logManager.logger",
"line_number": 13,
"usage_type": "attribute"
},
{
... |
8923910858 | #Import necessary libraries
from flask import Flask, render_template, send_from_directory, Response
import cv2
#Initialize the Flask app
app = Flask(__name__,
static_url_path='',
static_folder='static',
template_folder='templates')
def init_video_stream(s: str) -> tuple[cv2.VideoCa... | nathanverrill/edgeimpulse | example-azure-iot-client/test.py | test.py | py | 1,777 | python | en | code | 3 | github-code | 97 | [
{
"api_name": "flask.Flask",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "cv2.VideoCapture",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "cv2.CAP_PROP_FRAME_WIDTH",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "cv2.CAP_PRO... |
16095515417 | # _____ _____ _____ _________ _____ ____ ____ _ _________ ________ ______ _______ ________ ______ ______
# |_ _||_ _|_ _|| _ _ |_ _|_ \ / _| / \ | _ _ |_ __ .' ____ \|_ __ |_ __ |.' ___ .' ____ \
# | | | | | | |_/ | | \_| | | | \/ | / _ \ |_/ |... | Endless077/LapMiner | sources/UltimateSpecs.py | UltimateSpecs.py | py | 10,837 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "Interface.Source.Source",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "utils.request",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "re.search",
... |
40718457350 | from future.utils import iteritems
from builtins import str
from builtins import bytes
import baidubce.protocol
import baidubce.region
from baidubce.retry.retry_policy import BackOffRetryPolicy
from baidubce import compat
class BceClientConfiguration(object):
"""Configuration of Bce client."""
def __init__(s... | baidubce/bce-sdk-python | baidubce/bce_client_configuration.py | bce_client_configuration.py | py | 1,922 | python | en | code | 24 | github-code | 97 | [
{
"api_name": "baidubce.compat.convert_to_bytes",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "baidubce.compat",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "baidubce.retry.retry_policy.BackOffRetryPolicy",
"line_number": 31,
"usage_type": "call"... |
73903853119 | from collections import deque
def cut(n):
a1 = n.popleft()
a2 = n.popleft()
a3 = n.popleft()
a4 = n.popleft()
a5 = n.popleft()
a6 = n.popleft()
a7 = n.popleft()
a8 = n.popleft()
return a1+a2, a3+a4, a5+a6, a7+a8
def solution(serial):
result = deque(serial)
select = {
... | chh4031/Python_Study | 코딩테스트/Coding_Test_EXAM003.py | Coding_Test_EXAM003.py | py | 943 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "collections.deque",
"line_number": 15,
"usage_type": "call"
}
] |
5371262862 | import datetime
import sys
import time
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from termcolor import cprint
from time import sleep
class AirlineManager4Bot:
# config
fuelPriceThreshold = 550
co2PriceThreshold = 125
# constants
f = open("creds", "r")
... | LouisJeanneau/Airline-Manager-4-Bot | python/am4.py | am4.py | py | 9,877 | python | en | code | 2 | github-code | 97 | [
{
"api_name": "selenium.webdriver.chrome.options.Options",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 61,
"usage_type": "name"
},
{... |
74998432639 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import logging
import torch
import torch.nn as nn
import numpy as np
logger = logging.getLogger(__name__)
class HeatmapLoss(nn.Module):
def __init__(self):
super().__init__()
def forward(se... | BoySong777/limb-DEKR | lib/core/loss.py | loss.py | py | 8,133 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "logging.getLogger",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "torch.nn.Module",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "torch.nn.Module",
... |
15965884266 | from typing import Any, Optional, Unpack
from typedhtml.attributes import a_attr
from typedhtml.globals import GLOBAL_ATTR
from typedhtml.tags import a, div
from typedhtml.uikit.util import add_val
def scroll(*args: Any, **kwargs: Unpack[a_attr]) -> a:
"""Scroll smoothly when jumping to different sections on a p... | Takin-Profit/typedhtml | typedhtml/uikit/scroll.py | scroll.py | py | 1,233 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "typing.Any",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "typing.Unpack",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "typedhtml.attributes.a_attr",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "typedhtml.uikit.uti... |
40748539615 | import os
import json
import pathlib
import logging
from airflow.models import Variable
log = logging.getLogger(__name__)
OUTPUT_DIR = os.environ.get("AV_OUTPUT_DIR", default='/opt/output')
VIDEO_LIST = os.path.join(OUTPUT_DIR, 'videofiles.json')
def create_directories():
if not os.path.exists(VIDEO_LIST):
... | BlinkenOSA/workflows | airflow/dags/av_tasks/create_directories.py | create_directories.py | py | 1,124 | python | en | code | 4 | github-code | 97 | [
{
"api_name": "logging.getLogger",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.environ.get",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"l... |
18467826413 | #coding=utf-8
#python die_visual.py
from die import Die
import pygal
die_1 = Die()
die_2 = Die(10)
#save in a list
results = []
for roll_num in range(10000):
result = die_1.roll() + die_2.roll()
results.append(result)
frequencies = []
max_result = die_1.num_sides + die_2.num_sides
for value in range(2, max_result+... | wkmikw/useful-python | die_visual.py | die_visual.py | py | 719 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "die.Die",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "die.Die",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pygal.Bar",
"line_number": 21,
"usage_type": "call"
}
] |
42476062959 | import requests
from bs4 import BeautifulSoup
import pandas as pd
# fucntions that find player stat
def findBio(opName):
url = "https://rainbowsix.fandom.com/wiki/" + opName
page = requests.get(url)
soup = BeautifulSoup(page.content, 'html.parser')
realInfos = soup.find('aside')
divInfos ... | Hama101/DiscordBot | R6bio.py | R6bio.py | py | 1,134 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "requests.get",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 32,
"usage_type": "call"
}
] |
43649077845 | import json
import requests
from requests.api import head
import random
jsonstring = {
"co2": {
"value": str(random.randint(1000, 6000)),
"unit": "ppm"
},
"humidity": {
"value": str(random.uniform(0, 100)),
"unit": "%"
},
"temperature": {
"value": str(random.... | marcelheim/jo-co2 | dataclient/datagenerator.py | datagenerator.py | py | 552 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "random.randint",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "random.uniform",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "random.uniform",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line... |
17828873442 | import pandas as pd
import pymongo
# 连接数据库
client = pymongo.MongoClient('mongodb://{0}:{1}@{2}:{3}'.format("admin", "admin123", '118.25.94.130', 27017))
db = client['Tieba']
table = db['tieba_2']
# 读取数据
data = pd.DataFrame(list(table.find()))
# 选择需要显示的字段
data = data[['title', 'author']]
# 打印输出
print(data)
| blackjibert/pythoncode | Scrapy_Distributed/operate_mongodb/ReadMongo_usePandas.py | ReadMongo_usePandas.py | py | 354 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pymongo.MongoClient",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 10,
"usage_type": "call"
}
] |
10479801474 | from discord.ext import commands
from bot_config.tok import TOKEN
from bot_config.checks import check_owner
import os,json,discord
description = '''Beep Beep boop boop'''
startup_extensions = ['basic','info']
default_prefix = '!'
#retrieves server specific prefixes or gives default !
def get_prefix(bot,message):
... | liamjbryant/discordpy-lotus | lotus.py | lotus.py | py | 7,109 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "json.load",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "discord.ext.commands.when_mentioned_or",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "discord.ext.commands",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": ... |
494085692 | import time
from colorama import Fore, init
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.common.by import By
from os import system, get_terminal_size
init()
system("mode 800")
system("title Zefoy TikTok Automator | Vex Services")
def color(str... | vex-ss/zefoy-tiktok-automator | main.py | main.py | py | 16,938 | python | en | code | 21 | github-code | 97 | [
{
"api_name": "colorama.init",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.system",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.system",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "colorama.Fore.WHITE",
"line_numbe... |
35200094473 | # originaly made with fbchat Version 1.3.9
from sys import path
from random import choice
from pathlib import Path
import sqlite3
from fbchat import Client
from fbchat.models import *
path.append(str(Path().cwd().parent.parent))
from pokerlib import sqlmeths, timemeths
from pokerlib.handparser import HandParser
from p... | noname72/PokerLogic | apps/pokermessinger/pokermessinger.py | pokermessinger.py | py | 19,907 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "sys.path.append",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "pathlib.Path",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_number... |
8290523453 | import dtcc_builder
import dtcc_io
import dtcc_model
import dtcc_wrangler
import dtcc_viewer
from shapely.geometry import Point, LineString, Polygon, MultiLineString
from shapely.affinity import translate
from itertools import groupby
from shapely.ops import nearest_points
from itertools import combinations
import alp... | dtcc-platform/dtcc-wrangler | sandbox/simplify/test.py | test.py | py | 6,305 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "dtcc_io.load_city",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "shapely.geometry.LineString",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "itertools.combinations",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "... |
70222497919 | import matplotlib.pyplot as plt
rewards = [-7.95, -8.0, -8.0, -7.7, -7.05, -5.1, 5.25, 6.15, 5.8, 6.0]
training_iterations = [0, 25, 50, 75, 100, 125, 150, 175, 200, 225]
plt.plot(training_iterations, rewards)
plt.title("Average Reward over 20 Games")
plt.xlabel("Training Steps (Thousands)")
plt.ylabel("Average Rewar... | tediris/aa228-dqn | plot_reward.py | plot_reward.py | py | 336 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.title",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "matplot... |
73056536960 | from fastapi import FastAPI, WebSocket, WebSocketDisconnect
from fastapi.middleware.cors import CORSMiddleware
import uvicorn
import logging
from .services import chatbot_service
api = FastAPI()
origins = [
"http://localhost:4200"
]
logger = logging.getLogger("uvicorn.info")
api.add_middleware(
CORSMiddlew... | Daniel-Cas/wewy-chatbot-backend | api/main.py | main.py | py | 884 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "fastapi.FastAPI",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "fastapi.middleware.cors.CORSMiddleware",
"line_number": 17,
"usage_type": "argument"
},
{
"api_n... |
72840745598 | import pandas as pd
from scipy import stats
import math
import matplotlib as mat
import matplotlib.pyplot as plt
import numpy as np
from sklearn.cluster import KMeans
from sklearn.preprocessing import StandardScaler
from sklearn.metrics import silhouette_score
import geopandas as gpd
import os
import plotly.express a... | Pals0405/Pals0405-CorrelationAnalysisRangeland | Ecozone/KMeansPlot.py | KMeansPlot.py | py | 4,617 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pandas.read_csv",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
... |
72481701759 | import requests
import re
import time
import subprocess
netspeed_log = {'time':[],
'speed':[],
'ping':{'baidu.com':[],
'ustc.edu.cn':[]},
}
def get_teach_ustc_edu_cn(newhtml):
teach_url = 'https://www.teach.ustc.edu.cn/'
#更新教务处通知
prin... | fyr233/web-wallpaper-on-win10-forUSTC | getdata.py | getdata.py | py | 3,118 | python | en | code | 4 | github-code | 97 | [
{
"api_name": "requests.get",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "re.findall",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 22,
"u... |
28691752409 | """Basic Processing for fMRI volumes."""
import os
import nibabel as nib
import numpy as np
import scipy as sp
from nipype.interfaces.base import (
SimpleInterface,
BaseInterfaceInputSpec,
File,
TraitedSpec,
traits,
isdefined,
)
from skimage.morphology import convex_hull_image
from skimage.fil... | paquiteau/retino-pypeline | src/retino_pypeline/interfaces/tools.py | tools.py | py | 3,679 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "nipype.interfaces.base.BaseInterfaceInputSpec",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "nipype.interfaces.base.File",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "nipype.interfaces.base.traits.Bool",
"line_number": 30,
"usage_... |
33885956794 | # image selector = #islrg > div.islrc > div:nth-child(2) > a.wXeWr.islib.nfEiy > div.bRMDJf.islir > img
# search XPATH = /html/body/div[1]/div[3]/form/div[1]/div[1]/div[1]/div/div[2]/input
from selenium.webdriver.common.keys import Keys
import time
from selenium import webdriver
from webdriver_manager.chrome import Ch... | Jeff-Pyo/PythonProjects | croll/crawlling.py | crawlling.py | py | 1,719 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "selenium.webdriver.ChromeOptions",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 13,
"usage_type": "call"
},
{
"api... |
22819275363 | import streamlit
import pandas
import requests
import snowflake.connector
streamlit.title('My parents new Diner Menu')
streamlit.header('Breakfast Menu')
streamlit.text('🥣 Omega 3 Blue Berry Oatmeal')
streamlit.text('🥗 Spinach Kale Smoothi')
streamlit.text('🐔 Hard-boile Egg')
streamlit.text('🥑 Avocado Toast')
strea... | renukadevib/first_streamlit_app | streamlit_app.py | streamlit_app.py | py | 1,430 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "streamlit.title",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "streamlit.header",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "streamlit.text",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "streamlit.text",
"li... |
34728093623 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
An incomplete sample script.
This is not a complete bot; rather, it is a template from which simple
bots can be made. You can rename it to mybot.py, then edit it in
whatever way you want.
Use global -simulate option for test purposes. No changes to live wiki
will be done.... | masti01/pcms | m-checkWD.py | m-checkWD.py | py | 6,522 | python | en | code | 4 | github-code | 97 | [
{
"api_name": "pywikibot.pagegenerators.parameterHelp",
"line_number": 47,
"usage_type": "attribute"
},
{
"api_name": "pywikibot.pagegenerators",
"line_number": 47,
"usage_type": "name"
},
{
"api_name": "pywikibot.bot.SingleSiteBot",
"line_number": 52,
"usage_type": "name... |
4623647302 | import requests
import random
from bs4 import BeautifulSoup as bs
import telebot
URL = 'https://www.anekdot.ru/last/good'
TOKEN = '5988543394:AAH2GbufnTsIfxxRJqPZA2Ru4MA_8DhwC7A'
def parsing(url):
r = requests.get(url)
soup = bs(r.text, 'html.parser')
anekdot = soup.find_all('div', class_='text')
re... | KrotovSergey/Base-Python | Telega2.0_anekdot/main.py | main.py | py | 937 | python | ru | code | 0 | github-code | 97 | [
{
"api_name": "requests.get",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "random.shuffle",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "telebot.TeleBot",
"... |
41253092076 | #####
# From 'Problem Solving with Algorithms and Data Structures, Release 3.0'
# Self check activity from chapter 2.2.1
#
'''
Write two Python functions to find the minimum number in a list. The first function should
compare each number to every other number on the list. O(n**2). The second function should be
linear O... | lorenzo-sall/DSA-review | algorithm_analysis/min_in_array.py | min_in_array.py | py | 2,403 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "time.time",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 43,
... |
2221471882 | import googlemaps
from datetime import datetime
import polyline
import google_streetview.api
import google_streetview.helpers
from math import sqrt
import numpy as np
import folium
maxdis = 0.0002
def euclid(s1,s2):
square = pow((s1[0] - s2[0]),2) + pow((s1[1]-s2[1]),2)
return sqrt(square)
gmaps = googlemaps.Clie... | saurabhgis/DNN-for-city-mapping | workspace/Google street view/gsvfoliumsample.py | gsvfoliumsample.py | py | 1,686 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "math.sqrt",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "googlemaps.Client",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",... |
30660848630 | import argparse
import json
import zstandard as zstd
from datetime import datetime
from collections import defaultdict
CHUNK_SIZE = 16384
def extract_comments(zst_file):
# A dictionary to keep track of comments per year
comments_per_year = defaultdict(lambda: defaultdict(list))
first_year = None
last... | sgoettel/zstsidescripts | archivesampler.py | archivesampler.py | py | 2,832 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "collections.defaultdict",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "zstandard.ZstdDecompressor",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "datetim... |
35604113595 | import os
import napari
from napari.layers import Image
from napari.layers import Labels
import napari.utils.misc as misc
import numpy as np
import tifffile
from PyQt5.QtWidgets import QGridLayout, QPushButton, QWidget
from PyQt5.QtWidgets import QLineEdit, QLabel
from PyQt5.QtWidgets import QFileDialog, QHBoxLayout... | cwood1967/napari-paint-mask | napari_label/label_plugin.py | label_plugin.py | py | 3,226 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "PyQt5.QtWidgets.QWidget",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "os.getcwd",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtWidgets.QGridLayout",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "PyQt5.Q... |
6266069841 | from qiskit import Aer, IBMQ, QuantumCircuit, ClassicalRegister, QuantumRegister, execute
from qiskit.tools.monitor import job_monitor
import numpy as np
imageDir = "images/4x4/"
imageNames = ["00","01","02","03","10","11","12","13","20","21","22","23","30","31","32","33"]
imageExt = ".jpg"
result = []
data = np.loadt... | CleverCracker/Quantum_Image_Based_Search_Engine | SearchEngineParallel_4x4_3_Images.py | SearchEngineParallel_4x4_3_Images.py | py | 3,295 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "numpy.loadtxt",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.complex128",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "qiskit.QuantumRegister",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "qiskit.Quant... |
29966521891 | import numpy as np
import argparse
import sys
import time
import cv2 as cv
import torch
import pykitti
# modules in this project
import datasets
import psm
import yolov5
import opencv_sgbm
def parseCmdline():
parser = argparse.ArgumentParser('stereo_tracker')
parser.add_argument('--base_dir',
... | manoj-rajagopalan/stanford_cs231a_project | main.py | main.py | py | 15,981 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "torch.cuda.is_available",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 43,
"usage_type": "attribute"
},
{
"api_name": "numpy... |
27431522382 | import threading
import concurrent.futures
import os
from decouple import config
from linear_regression import LinearRegressionModel
from neural_network import NeuralNetworkModel
from get_data import DataGetter
from write_data import DataWritter
# Test cases:
def check_linear_regression():
"""Test linear regress... | MarcosLonegroGurfinkel/stock-price-predictor | automated_tests.py | automated_tests.py | py | 4,603 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "get_data.DataGetter",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "decouple.config",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "linear_regression.LinearRegressionModel",
"line_number": 22,
"usage_type": "call"
},
{
"api_n... |
74789279999 | import board
import busio
import time
import sys
import getopt
import adafruit_si5351
import sounddevice as sd
import matplotlib.pyplot as plt
import numpy as np
from fractions import Fraction
import config as cfg
# Setting up Runtime tracker
tic = time.clock()
# Setting up sounddevice defaults
# Soundcard is clippin... | gregbridge/WWU_RPZ_VNA | Python/sigRecTest.py | sigRecTest.py | py | 4,293 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "time.clock",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sounddevice.default",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "config.fs",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "sounddevice.defaul... |
73191345599 | from __future__ import print_function
from __future__ import division
import logging
import loggly.handlers
import anyconfig
credentials = anyconfig.load("private_config.json")['credentials']
logger = logging.getLogger('')
logger.setLevel(logging.DEBUG)
formatter = logging.Formatter('%(asctime)s - %(name)s - %(le... | arangaswamy/evchargers | gui/display.py | display.py | py | 4,638 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "anyconfig.load",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "logging.Formatter"... |
73226478400 | import os
import sys
from PIL import Image
def pad_to_power_of_2(image_path):
img = Image.open(image_path)
width, height = img.size
new_width = 2 ** (width - 1).bit_length()
new_height = 2 ** (height - 1).bit_length()
if width == new_width and height == new_height:
return # Image is alre... | fani-kiran/PowerOf2ImageResizer | resize_images.py | resize_images.py | py | 1,362 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "PIL.Image.open",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "PIL.Image.new",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 2... |
2506098129 | from scrapy.item import Field
from scrapy.item import Item
from scrapy.spiders import CrawlSpider, Rule
from scrapy.selector import Selector
from scrapy.loader.processors import MapCompose
from scrapy.linkextractors import LinkExtractor
from scrapy.loader import ItemLoader
class Articulo(Item):
titulo = Field()
... | alderetebrian/Scrapy-Practice | mercadolibre.py | mercadolibre.py | py | 1,947 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "scrapy.item.Item",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "scrapy.item.Field",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "scrapy.item.Field",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "scrapy.item.Field... |
23356616224 | from django.db import models
from django.contrib.auth import get_user_model
User = get_user_model()
# Create your models here.
class Manufacturer(models.Model):
vendor_name = models.CharField("厂商名称", max_length=32, db_index=True, help_text="厂商名称")
tel = models.CharField("联系电话", null=True, max_... | zem12345678/cloud_devops_backend | apps/resources/models.py | models.py | py | 8,822 | python | en | code | 3 | github-code | 97 | [
{
"api_name": "django.contrib.auth.get_user_model",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "django.db.models.Model",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 7,
"usage_type": "name"
},
{
"api_... |
38577427169 | import logging
from typing import Tuple
import numpy as np
import pandas as pd
import xarray as xr
from disdrodb.utils.logger import log_error, log_info, log_warning
logger = logging.getLogger(__name__)
####---------------------------------------------------------------------------.
def _sort_datasets_by_dim(list_... | ltelab/disdrodb | disdrodb/utils/netcdf.py | netcdf.py | py | 15,457 | python | en | code | 13 | github-code | 97 | [
{
"api_name": "logging.getLogger",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.argsort",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "typing.Tuple",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "numpy.concatenate",
... |
36734136870 | ################################################################################
# Alpacas & Fences - fD
# Authors: 470386390, 470354850, 470203101
# In order to run this file alone:
# $ python fD.py
# This script looks into the CV problem of finger detection.
#######################################################... | sandy-smiles/Alpacas_and_Fences | fD.py | fD.py | py | 3,172 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "cv2.imread",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2GRAY",
"line_number": 37,
"usage_type": "attribute"
},
{
"api_name": "cv2.GaussianBlur",
... |
34951105387 | import mne
from pathlib import Path
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
def getInput(file):
all_epochs = mne.read_epochs(Path('out_data') / file )
idx_asd = all_epochs.events[:, 2] == all_epochs.event_id['asd']
idx_td = all_epochs.events[:, 2] == all_epochs.ev... | htil/resting-asdnet | preprocess.py | preprocess.py | py | 1,417 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "mne.read_epochs",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.empty",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.empty",
"line_number... |
24537066283 | from typing import List
def canReach(arr: List[int], start: int) -> bool:
"""Return true iff you can reach any index in 'arr' with value 0,
starting from the specified 'start' index."""
visited = set()
leftBound = 0
rightBound = len(arr) - 1
def canReachViaDFS(curr: int) -> bool:
"""A... | ansonmiu0214/dsa-worked-solutions | solutions/jump_game_iii/solution.py | solution.py | py | 900 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "typing.List",
"line_number": 3,
"usage_type": "name"
}
] |
32105373248 | # -*- coding: utf-8 -*-
"""
This file is used for the regression experiments on synthetic test functions.
"""
#%%
# Libs
import os
import random
from collections import OrderedDict
from datetime import datetime
import pickle
import numpy as np
from math import floor
# ------------------------------------------------... | marketdesignresearch/NOMU | regression/simulation_synthetic_functions.py | simulation_synthetic_functions.py | py | 23,400 | python | en | code | 9 | github-code | 97 | [
{
"api_name": "tensorflow.compat.v1.disable_eager_execution",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "tensorflow.compat",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "data_generation.function_library.function_library",
"line_number": 48,
... |
15140673011 | from django.shortcuts import render, HttpResponse, redirect
from .models import Person
# Create your views here.
def indexPageView(request):
return render(request, 'traffickingapp/index.html')
def victimsPageView(request):
try:
fName = request.GET['first_name']
people = Person.objects.filt... | reedstew/IS303-Team9 | traffickingproject/traffickingapp/views.py | views.py | py | 2,024 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "django.shortcuts.render",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "models.Person.objects.filter",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "models.Person.objects",
"line_number": 15,
"usage_type": "attribute"
},
{
"ap... |
18072504048 |
#! /usr/bin/python3
###################################################################################################################################
#
#
#
#Program to count the number of occurences of word "Embedded" in a input file, and wirte the count to an output file using CLA and argparse
#
#
#
#############... | anishetty11/SOIS_assignments | Python Assignments/Part B/Python/14-argparse.py | 14-argparse.py | py | 1,135 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "re.findall",
"line_number": 35,
"usage_type": "call"
}
] |
20435335452 | from rest_framework import serializers, validators, fields
from .models import Distributor, State, District, Due, Subscription, Package, Product, Quantity as Qty, Type, PaymentMode, PaymentMethod
from logs.models import Quantity
from django.utils import timezone
from salesman.models import Salesman, Inventory
from reta... | chetanjrao/instantkhata | distributors/serializers.py | serializers.py | py | 11,281 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "rest_framework.serializers.ModelSerializer",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.serializers",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "models.Distributor",
"line_number": 14,
"usage_type": "name"
... |
40093043075 | import unittest
from selenium import webdriver
class Test(unittest.TestCase):
def testName(self):
driver = webdriver.Chrome()
driver.get("https://www.google.com/")
titleOfWebPage = driver.title
# self.assertTrue(titleOfWebPage == "Google") # True
self.assertFalse(title... | MikailSonmez/PythonSelenium | assertionTest2.py | assertionTest2.py | py | 408 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "unittest.TestCase",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "unit... |
978264133 | import requests
import pickle
import json
def make_call(location):
apikey = 'e1f10a1e78da46f5b10a1e78da96f525'
URL = 'https://api.weather.com/v2/pws/observations/current?apiKey={0}&stationId={1}&numericPrecision=decimal&format=json&units=e'.format(apikey, location)
headers = {
"User-Agent"... | johnny22/Weather_app | wu_current_json.py | wu_current_json.py | py | 2,499 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "requests.get",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 24,
"usage_type": "call"
}
] |
73352869760 | from urllib.parse import quote_plus
from rdflib.namespace import OWL, RDF, RDFS, XSD
from rdflib import Graph, Literal, Namespace, URIRef
from rdflib.plugins.sparql import prepareQuery
from rdflib.term import BNode
import xmi_new_keys_parse
import sqlite3
def to_camel_case(text):
s = text.replace("-", " ").repla... | AnneGoebels/ASB-ING_Ontology | conversionScripts/keys/old_new_keys_connect copy.py | old_new_keys_connect copy.py | py | 4,584 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "sqlite3.connect",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "xmi_new_keys_parse.getXmiData",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "rdflib.Graph",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "rdflib.Nam... |
11267185945 | import requests
from time import sleep
from datetime import datetime
from dateutil.relativedelta import relativedelta
from ..model import IntaFile
class FetchList(object):
def __init__(self, user_id=None):
self.id_done = False
self.user_id = user_id
def convert_created_time(self, created_time... | zeuxisoo/my-scripts | python-download-inta-file/inta/fetch/list.py | list.py | py | 2,694 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "datetime.datetime.now",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "dateutil.relativedelta.relativedelta",
"line_number": 20,
"usage_type": "call"
},
{
"api_... |
73740511998 | from ftplib import FTP
from urllib.parse import urlparse
import argparse
import hashlib
import os.path
import msgpack
import requests
from pathlib import Path
import sys
LFC_WGET_LIST = 'http://www.linuxfromscratch.org/lfs/view/development/wget-list'
#LFC_WGET_LIST = 'http://nuc/wget-list'
if sys.platform == 'win32':... | bjowi/lfsbuild | filegetter.py | filegetter.py | py | 4,340 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "sys.platform",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "os.path.path.join",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path.path",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "os.path",
"... |
831002815 | import argparse
import pandas as pd
from pathlib import Path
class Processor:
def __init__(self, column: str, counter: str, unit: str, shift: bool):
self.column = column
self.counter = counter
self.unit = unit
self.shift=shift
def count(self, df: pd.DataFrame, cutoffs=[6, 17],... | usc-sail/tiles-2019-dataset | src/LAC_info/process_census_data.py | process_census_data.py | py | 4,472 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pandas.DataFrame",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "pandas.DataFrame",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pandas.Timedelta",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pandas.Timede... |
8872031517 | """Web controller for motorized screen"""
import asyncio
import logging
import redis
from quart import Quart, request, jsonify, render_template
from quart_minify.minify import Minify
from screen import MotorizedScreen
app = Quart(__name__)
Minify(app=app)
logging.basicConfig(format="[%(asctime)s] %(message)s", level... | alexnorell/screen | src/controller/controller.py | controller.py | py | 1,971 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "quart.Quart",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "quart_minify.minify.Minify",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "logging.basicConfig",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "logging.IN... |
36859835191 | import numpy as np
import math
import matplotlib.pyplot as plt
# Load the data:
X = np.load('data/q3x.npy')
y = np.load('data/q3y.npy')
n = X.shape[0]
X = np.append(np.ones((n, 1)), np.reshape(X, (n, 1)), axis = 1)
print(X, X.shape)
########################## i ###########################
# Use normal equation to ge... | yiruigao98/EECS545-WN2020 | assignments/HW1/Q3.py | Q3.py | py | 1,706 | python | en | code | 3 | github-code | 97 | [
{
"api_name": "numpy.load",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "numpy.load",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.append",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.ones",
"line_number": 10,
... |
42554054090 | #! /usr/bin/env python
## Trying something new:
"""
This script contains all the code for plotting figure 1 of Ammon's BayesBattleBots paper
For questions, contact Ammon Perkes (perkes.ammon@gmail.com)
"""
import numpy as np
from matplotlib import pyplot as plt
import copy
from tqdm import tqdm
from fish import Fis... | aperkes/BayesBattleBots | figure5c_intensity.py | figure5c_intensity.py | py | 2,554 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "simulation.Simulation",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "params.Params",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "params.outcome_params",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "params... |
7628202453 | from flask import Flask
from src.config.env import Env
from werkzeug.utils import import_string
api_blueprints = ["hook_bp"]
def create_app():
app = Flask(__name__)
# Register blueprints
for bp_name in api_blueprints:
print("Registering bp: %s" % bp_name)
bp = import_string("src.routes... | DroidZed/disco-hooker | app.py | app.py | py | 474 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "flask.Flask",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "werkzeug.utils.import_string",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "src.config.env.Env",
"line_number": 25,
"usage_type": "call"
}
] |
11655097483 | import numpy as np
#from air_characteristics import air
import CoolProp.CoolProp as cp
from models.gas_jet import Gas_Jet
import pandas as pd
air = Gas_Jet()
import plotly.express as px
#mass volumique kg/m3 et chaleur specifique W/m.K
def air_rho_cp(T, P):
return cp.PropsSI('D', 'T', T, 'P', P, 'Air'), cp.PropsSI... | ThomasXIONG151215/HabitatPower | models/heat_transfer_models.py | heat_transfer_models.py | py | 10,389 | python | en | code | 2 | github-code | 97 | [
{
"api_name": "models.gas_jet.Gas_Jet",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "CoolProp.CoolProp.PropsSI",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "CoolProp.CoolProp",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "num... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.