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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
8179851843 | """Data structures for the tables domain.
We represent denotations with various Python data structures.
Possible denotation types include:
- Unary = set of Things
| InfiniteSet
- ScopedBinary = dict {Object: Unary, ...} (the domain must be finite)
- Relation = string (Used when the relation is mentioned befor... | microsoft/ContextualSP | lemon/executor/strongsup/tables/structure.py | structure.py | py | 13,807 | python | en | code | 348 | github-code | 21 | [
{
"api_name": "collections.Container",
"line_number": 166,
"usage_type": "name"
}
] |
17766140363 | from django.shortcuts import render
from .models import *
#여기까지 장고
from datetime import datetime
import pytz
import requests
from bs4 import BeautifulSoup
from .models import lunch_log
def what_now_time():
fmt = "%Y-%m-%d %H:%M:%S"
fmt2 = "%Y.%m.%d"
KST = datetime.now(pytz.timezone('Asia/Seoul'))
re... | heegong/semyeong_lunch_django | lunch/views.py | views.py | py | 1,916 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "datetime.datetime.now",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "pytz.timezone",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "requests.get",
... |
18947335420 | import os
import random
from datetime import datetime
from random import shuffle
from tkinter import *
from tkinter import ttk
def shuffle_lines_in_file(filepath: str):
random.seed(datetime.now().__str__())
with open(filepath, 'r') as file:
lines = file.readlines()
if lines[-1][-1] != '\n':
... | IvaRude/Tkinter-Example | main.py | main.py | py | 2,268 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "random.seed",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "random.shuffle",
... |
26915551373 | from datetime import datetime
import requests
class FiwareApi:
HEADERS = {'fiware-service': "openiot", 'fiware-servicepath': "/"}
def post(self, buffer):
data = buffer[buffer.find('#') + 1: buffer.find('\\')]
buffer = buffer[2:buffer.find('#')]
try:
r = requests.post(buffe... | niconunez96/fiware-client-interoperabilidad | application/fiwareAPI.py | fiwareAPI.py | py | 1,385 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "requests.post",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "datetime.dateti... |
25743792756 | # 04
# Medium
# Given an array of positive and negative integers, find a subarray whose sum equals X.
# For example: Input = [2,4,-2,1,-3,5,-3], X = 5 --> Result = [2,4,-2,1]
# -----------------------------------------------------
# Time complexity: O(n) time
# Space complexity: O(n) space
def subarray_sum(ints:... | dannynoonan/interview-prep | ic/02_subarrays/04_subarray_sum_ints.py | 04_subarray_sum_ints.py | py | 910 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pytest.main",
"line_number": 38,
"usage_type": "call"
}
] |
34467169541 | # -*- coding: utf-8 -*-
"""
Created on Wed Jun 23 13:55:08 2021
@author: CWilson
"""
import pandas as pd
import datetime
from Read_Group_hours_HTML import output_each_clock_entry_job_and_costcode
day_of_week = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday']
mdi_file = 'Z:\CSM\\MDI Doc... | cwilsonCrystalSteel/Python | AdHoc_Absenteeism.py | AdHoc_Absenteeism.py | py | 5,272 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pandas.read_excel",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "Read_Group_hours_HTML.output_each_clock_entry_job_and_costcode",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "pandas.unique",
"line_number": 33,
"usage_type": "call"
... |
71668871732 | """ run a match with an agent on remote machine, modified from Deepmind PySC2 and DistLadderV1.
This needs to be called twice, once for the human, and once for the agent.
In two different machine:
The human plays on the host. There you run it as:
$ python -m distladder3.bin.play_vs_remote_agent --human --remote <agen... | dachidahu/SC2AgentsZoo2 | agent_TLeagueFormal14/DistLadder3/distladder3/bin/play_vs_remote_agent.py | play_vs_remote_agent.py | py | 3,340 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "absl.flags.FLAGS",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "absl.flags",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "absl.flags.DEFINE_integer",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "absl.flags... |
41709356921 | import mmcv
import torch
import numpy as np
from mmcv.utils import deprecated_api_warning
from numpy import random
import torch.nn.functional as F
from ..builder import PIPELINES
@PIPELINES.register_module()
class NormZData(object):
"""normalize volumetric data & seg in the z-axis to specified slice spacing.
... | urmagicsmine/CSPR | medseg/mmseg/datasets/pipelines/transforms_ct.py | transforms_ct.py | py | 13,856 | python | en | code | 34 | github-code | 21 | [
{
"api_name": "numpy.random.randint",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 61,
"usage_type": "attribute"
},
{
"api_name": "torch.Tensor",
"line_number": 75,
"usage_type": "call"
},
{
"api_name": "numpy.float32",
... |
31289744144 | from collections import defaultdict, deque
class Graph:
"""
graph, dfs, and bfs
"""
def __init__(self):
self.graph = defaultdict(list)
def add_edge(self, u, v):
self.graph[u].append(v)
def dfs(self, s):
visited = set()
path = []
stack = []
... | sengami-yuka/py | ds_alg/graph.py | graph.py | py | 1,145 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "collections.defaultdict",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "collections.deque",
"line_number": 33,
"usage_type": "call"
}
] |
22325582761 | import sys
from names_matcher.algorithm import NamesMatcher
def main():
"""
Given two text files with one identity per line, output the matches from \
the first to the second.
The names are expected to be joined by "|". The result is printed to stdout, lines from
the second file in the sequence ... | athenianco/names-matcher | names_matcher/__main__.py | __main__.py | py | 888 | python | en | code | 20 | github-code | 21 | [
{
"api_name": "sys.argv",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "sys.stderr",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"... |
73892190773 | #!/usr/bin/python3
''' Script takes string and sends a search request to the Star Wars API '''
from sys import argv
import requests
if __name__ == "__main__":
url = 'https://swapi.co/api/people/'
# Search parameter is our line argument
parameters = {'search': argv[1] if len(argv) > 1 else ''}
# Make a ... | cynergist/holbertonschool-higher_level_programming | 0x11-python-network_1/9-starwars.py | 9-starwars.py | py | 1,017 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "sys.argv",
"line_number": 9,
"usage_type": "argument"
},
{
"api_name": "requests.get",
"line_number": 11,
"usage_type": "call"
}
] |
22961402014 | import os
import sys
import numpy as np
from scipy.integrate import simps
import Metrics
import argparse
import json
import h5py
import matplotlib.pyplot as plt
from statistics import median
scriptDir = os.path.dirname(os.path.realpath(__file__)) + "/"
models = ["convnetquakeingv", "magnet", "mlstm_fcn", "tcn"]
srcDa... | ecokeco/tstl | scripts/report_multiple_runs_performance_gain_vs_lr.py | report_multiple_runs_performance_gain_vs_lr.py | py | 3,848 | python | en | code | 5 | github-code | 21 | [
{
"api_name": "os.path.dirname",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "os.path.realpath",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_n... |
11537690068 | #!/usr/bin/env python2
import numpy as np
from minilog import DataLog
import sys
if len(sys.argv) < 4:
print('Usage: load <filename> <ncells> <var>')
sys.exit(1)
fname = str(sys.argv[1])
ncell = int(sys.argv[2])
vname = str(sys.argv[3])
log = DataLog.load_csv(fname).npview()
# Plot
if False:
import matpl... | CardiacModelling/tailored-ipsc-models | myokit/formats/opencl/template/plot.py | plot.py | py | 1,072 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "sys.argv",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "sys.exit",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 10,
... |
42543504495 | from scipy import stats
def soma(v):
i=0
for x in v:
i+=x
return i
def crescente(v):
i = 0
j=0
aux =0
while i<len(v) - 1:
j= i+1
while j < len(v):
if v[i] >= v[j]:
aux = v[i]
v[i] = v[j]
... | vitorjusto/media-mediana-e-moda | main (4).py | main (4).py | py | 1,113 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "scipy.stats.mode",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "scipy.stats",
"line_number": 50,
"usage_type": "name"
}
] |
23636952477 | from csv import DictReader
import json
def convert():
# open file in read mode
data={}
with open('test.csv', 'r') as read_obj:
# pass the file object to DictReader() to get the DictReader object
csv_dict_reader = DictReader(read_obj)
# iterate over each line as a ordered dictionary... | TruongTX-Martin/python_convert_csv_to_json | convert_csv_to_json.py | convert_csv_to_json.py | py | 630 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "csv.DictReader",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": 19,
"usage_type": "call"
}
] |
39830238508 | import sys
from random import shuffle
import numpy as np
from sklearn import datasets
import torch
import torch.nn as nn
import torchvision.datasets as dsets
import torchvision.transforms as transforms
from torch.autograd import Variable
# Hyperparameters
# num_epochs = 50
# lr = 0.01
def get_iris():
iris = dat... | beduffy/auto-ml-experiments | grid_search_auto_encoder.py | grid_search_auto_encoder.py | py | 6,116 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "sklearn.datasets.load_iris",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "sklearn.datasets",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "sklearn.datasets.load_boston",
"line_number": 28,
"usage_type": "call"
},
{
"api_name... |
25924756947 | from django.urls import path
from . import views
from django.contrib.auth import views as auth_views
urlpatterns = [
path('', views.index,name ='index'),
# path('login/', views.login,name ='login'),
path('rooms/<int:hotel_id>/', views.rooms,name ='rooms'),
path('roomdetail/<int:roomtype_id>/', views.roomde... | kudohdtt/Web-application | web/servers/mysite/home/urls.py | urls.py | py | 990 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
20726864652 | import io
from operator import mod
import sys
_INPUT = """\
4
1 3 5 2
"""
sys.stdin = io.StringIO(_INPUT)
# ---------------------------------
n = int(input())
ns = map(int, input().split())
# key = num , value = gen
ndict = {}
gen = 0
for i, num in enumerate(ns):
tmp_i = i + 1
if num not in ndict.keys():
... | makima333/Atcoder-ganbaru | contest/abc274/C.py | C.py | py | 491 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "sys.stdin",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "io.StringIO",
"line_number": 10,
"usage_type": "call"
}
] |
1268701152 | import os
from flask import Flask, request, abort
from linebot import (
LineBotApi, WebhookHandler
)
from linebot.exceptions import (
InvalidSignatureError
)
from linebot.models import (
MessageEvent, TextMessage, TextSendMessage,
SourceUser, SourceGroup, SourceRoom,
TemplateSendMessage, ConfirmTem... | husentoding/kambing | app2.py | app2.py | py | 6,971 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "flask.Flask",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "linebot.LineBotApi",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "linebot.WebhookHandler",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "pyrebase.initia... |
74618367093 | # -*- coding: utf-8 -*-
from django.shortcuts import HttpResponse, redirect
import plogical.CyberCPLogFileWriter as logging
from loginSystem.views import loadLoginPage
import os
import json
from plogical.httpProc import httpProc
from plogical.mailUtilities import mailUtilities
from plogical.acl import ACLManager
from... | usmannasir/cyberpanel | manageServices/views.py | views.py | py | 12,707 | python | en | code | 1,302 | github-code | 21 | [
{
"api_name": "models.PDNSStatus.objects.get",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "models.PDNSStatus.objects",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "models.PDNSStatus",
"line_number": 22,
"usage_type": "name"
},
{
"ap... |
43811815197 | '''
Class for one classifier model
ML Pipeline
Aya Liu
'''
from __future__ import division
import os
import csv
import pandas as pd
import numpy as np
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import pylab as pl
from sklearn import model_selection, metrics
from sklearn.metrics import ro... | aya-liu/machine-learning-for-policy | hws/hw4/model.py | model.py | py | 14,836 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "matplotlib.use",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sklearn.metrics.roc_auc_score",
"line_number": 110,
"usage_type": "call"
},
{
"api_name": "sklearn.metrics",
"line_number": 192,
"usage_type": "name"
},
{
"api_name": "os.pat... |
43791064627 | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.linear_model import LinearRegression
# -------------------------
# load data
# ------------
data = pd.read_csv('../data/1.01. Simple linear regression.csv')
# print(data.head())
# print(data.describe())
# define regression variab... | warpalatino/public | Machine learning/ML/traditional_ML/regressions/DS1_sk_simple_linear_reg.py | DS1_sk_simple_linear_reg.py | py | 1,906 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "pandas.read_csv",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.scatter",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "matplotli... |
32194237905 | import os
import sys
import datetime
os.system('git pull origin master')
title = sys.argv[1]
print('Making Hurlant ...')
# initialization and declaration of variables
sHome =os.getenv("HOME")
sYear = str(datetime.datetime.today().year)
imagename = "".join(item[0].lower() for item in title.split())
filetitle=title.lo... | furzepig/brachistochrone | sitescripts/hurlant.py | hurlant.py | py | 799 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "os.system",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "os.getenv",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.today",
"line_n... |
38566761732 | import torch
import numpy as np
from tqdm import tqdm
def fit(train_loader, val_loader, model, loss_fn, optimizer, scheduler, n_epochs, cuda, log_interval, metrics=[],
start_epoch=0):
"""
Loaders, model, loss function and metrics should work together for a given task,
i.e. The model should be able... | nhatkhtn/Image-Retrieval-Backend | mysite/myapp/VideoRetrieval/trainer.py | trainer.py | py | 4,131 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "tqdm.tqdm",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "torch.cat",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "numpy.mean",
"line_number": 74,
"usage_type": "call"
},
{
"api_name": "torch.no_grad",
"line_number": 88,... |
32684105646 | ########################################################################
# File name: __init__.py
# This file is part of: aioxmpp
#
# LICENSE
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundat... | horazont/aioxmpp | aioxmpp/httpupload/__init__.py | __init__.py | py | 3,361 | python | en | code | 215 | github-code | 21 | [
{
"api_name": "structs.JID",
"line_number": 76,
"usage_type": "name"
},
{
"api_name": "xso.Request",
"line_number": 103,
"usage_type": "call"
},
{
"api_name": "stanza.IQ",
"line_number": 104,
"usage_type": "call"
},
{
"api_name": "structs.IQType.GET",
"line_nu... |
16056306338 | import sys
from setuptools import setup, find_packages
from orca import VERSION
with open("requirements.txt") as f:
requirements = f.readlines()
with open("README.md") as f:
readme = f.read()
setup(
name="orca.py",
author="b1nzy",
url="https://github.com/VincentRPS/orca.py",
version=VERSION,... | VincentRPS/orca.py | setup.py | setup.py | py | 1,499 | python | en | code | 4 | github-code | 21 | [
{
"api_name": "setuptools.setup",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "orca.VERSION",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "setuptools.find_packages",
"line_number": 17,
"usage_type": "call"
}
] |
330628386 | from sklearn import svm
import cv2
import numpy as np
def extract_features(image_path):
img = cv2.imread(image_path, 0)
if img is None:
print(f"Error: Unable to load image {image_path}")
return None
return np.array([np.mean(img), np.var(img)])
def train_classifier():
X = []
y = []
... | Ishan-Chanuka/SAMS-Python-CGV | investigate.py | investigate.py | py | 1,384 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "cv2.imread",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.mean",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.var",
"line_number": 10,
... |
25949491673 | import matplotlib.pyplot as plt
import random as rnd
def data():
paths = {}
print("What type of line (:,-- or-)?")
linetype = input()
print ("What color (r,g or b)?")
color = input()
print("What type of marker(o,s or ^)?")
markerstyle = input()
paths['linetype'] = linetype
paths['color'] = color
pa... | TheodorosChristou/com411 | visual/plots/dict.py | dict.py | py | 771 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "random.randrange",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "random.randrange",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "matplotlib.p... |
8478611309 | try:
import usocket as socket
except:
import socket
import ujson
import gc
import utime
class webserver:
def __init__(self,port):
self.__html=None
self.__jSonStr=None
self.__webserver=None
self.__callback=None
self.__webserver=socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.__... | hkdickyko/hkdickyko.github.io | assets/py/tools/webserver.py | webserver.py | py | 2,344 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "socket.socket",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "socket.AF_INET",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "socket.SOCK_STREAM",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "ujson.loads... |
6637790685 | from typing import Literal
from fastapi import Depends, FastAPI, HTTPException
from fastapi.middleware.cors import CORSMiddleware
from sqlalchemy.orm import Session
from . import config, crud, database, schemas
app = FastAPI()
app.add_middleware(
CORSMiddleware,
allow_origins=config.settings.BACKEND_CORS_O... | a-grever/challenge-real-estate-api | app/main.py | main.py | py | 1,312 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "fastapi.FastAPI",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "fastapi.middleware.cors.CORSMiddleware",
"line_number": 13,
"usage_type": "argument"
},
{
"api_name": "typing.Literal",
"line_number": 24,
"usage_type": "name"
},
{
"api_name... |
32762556718 | import os
import multiprocessing as mp
import numpy as np
def load_trace(f):
trace = np.loadtxt(f, delimiter='\t')
trace = trace[trace[:,0].argsort(kind="mergesort")]
trace[:,0] -= trace[0][0]
return trace
def dump_trace(trace, fname):
global dst
with open(os.path.join(dst, fname), "w") as fp... | csmcguan/tor-capture | sort_traces.py | sort_traces.py | py | 928 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "numpy.loadtxt",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "multiprocessing.Pool",
"li... |
20934484234 | from lib2to3.pgen2.token import OP
from typing import Dict, Optional, Any
import numpy as np
from numpy.typing import NDArray
from copy import deepcopy
from lux.stats import *
from lux.kit import *
from customized_env.phase_rewards.phase_resolver import PhaseRewarder
class DenseRewards(PhaseRewarder):
def __ini... | foolsholder/lux-dummy-agent | customized_env/phase_rewards/dense_rewards.py | dense_rewards.py | py | 5,559 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "customized_env.phase_rewards.phase_resolver.PhaseRewarder",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "typing.Dict",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "typing.Dict",
"line_number": 17,
"usage_type": "name"
},
{
... |
15706119448 | import sys
import cv2, numpy as np
from sklearn.cluster import KMeans
import os
from PIL import Image
import shutil
import time
from timeit import default_timer as timer
import math
def renameFolderFiles(path, prefix) :
# avoid dup files error
path = str(path)
prefix = str(prefix)
fileList = os.listdi... | Matres03/AstroPi_Image_Alg_Classification | src/DivederExperimental.py | DivederExperimental.py | py | 6,377 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "os.listdir",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.rename",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.rename",
"line_number": 26,
... |
32314469966 | from django.contrib.auth.models import User
from rest_framework.serializers import ModelSerializer, PrimaryKeyRelatedField, SerializerMethodField
from api.models import Item
from api.serializers.user import UserSerializer
class ItemSerializer(ModelSerializer):
""" Item Detail Seralizer"""
owner = PrimaryKey... | rusnano0/django-backend | api/serializers/item.py | item.py | py | 1,008 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "rest_framework.serializers.ModelSerializer",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "rest_framework.serializers.PrimaryKeyRelatedField",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.models.User.objects.all",
"li... |
1303577084 | import datetime
import os
exec_part = 2 # which part to execute
exec_test_case = 0 # -1 = all test inputs, n = n_th test input; 0 = real puzzle input
# Puzzle input
dirname = os.path.dirname(__file__)
with open(os.path.join(dirname, 'input/input_test03.txt')) as f:
INPUT_TEST = f.read()
with open(os.path.join(di... | vunguyenq/adventofcode | 2022/03.RucksackReorganization.py | 03.RucksackReorganization.py | py | 2,232 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "os.path.dirname",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 9... |
37856593576 | from typing import Optional
from ..constants import DEFAULT_LIMIT, DEFAULT_SEARCH_LIMIT
from ..models import (
FetchOrdersParams,
FetchCanceledOrdersParams,
FetchCanceledOrdersResponse,
MarketSymbol,
UnixTimestamp,
)
async def fetch_canceled_orders(
self,
symbol: Optional[MarketSymbol] = ... | AktaryTech/xrpl-dex-sdk-python | xrpl_dex_sdk/methods/fetch_canceled_orders.py | fetch_canceled_orders.py | py | 1,419 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "typing.Optional",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "models.MarketSymbol",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "models.UnixTimest... |
2317440690 | import argparse
import logging
import os
import time
import torch
import numpy as np
from shared import SharedTensor
import util
def parse_args():
'''
Parse input arguments.
'''
parser = argparse.ArgumentParser(
description='Train private or public multinomial logistic regression.')
parse... | facebookresearch/mpcfp | multi_classification.py | multi_classification.py | py | 7,882 | python | en | code | 5 | github-code | 21 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "torch.mean",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "numpy.argmax",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "logging.info",
"l... |
7861853574 | import tempfile
import uuid
import pytest
from relocation_helper.appConfig import ApplicationConfiguration
from relocation_helper.dao import Dao
from relocation_helper.migration import Migration
from relocation_helper.skillLogic import SkillLogic, YaDRequest, YaDRequestObject, YaDRequestSessionObject
config = Applic... | 11sanach11/ya_skill_relocation_helper | tests/test_skillLogic.py | test_skillLogic.py | py | 2,426 | python | ru | code | 0 | github-code | 21 | [
{
"api_name": "relocation_helper.appConfig.ApplicationConfiguration",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "tempfile.gettempdir",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "uuid.uuid4",
"line_number": 12,
"usage_type": "call"
},
{
... |
73569022454 | #Idea By @ProgrammingError
#Made By @ProgrammingError
#Thanks To Google😂😂😂
import requests, random, os
from decouple import config
from telethon import Button, custom, events, functions, TelegramClient
import logging
logging.basicConfig(format='[%(levelname) 5s/%(asctime)s] %(name)s: %(message)s',
... | hellboi-atul/padhotgbot | padho.py | padho.py | py | 2,690 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "logging.basicConfig",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "logging.WARNING",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "decouple.config",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "decouple.con... |
73474475893 | import scrapy
import urllib
import uuid
import socket
from pprint import pprint
import time
import os
import sys
from scrapy.selector import HtmlXPathSelector
from testScrapy.items import TestscrapyItem
from scrapy.http import Request
sys.path.append(os.path.abspath(""))
print(os.path.abspath(""))
from models import ... | claylee/testScrapy | testScrapy/spiders/ttSpider.py | ttSpider.py | py | 9,188 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "sys.path.append",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_num... |
11868054525 | import PyQt5.QtWidgets as qtw
import PyQt5.QtGui as qtg
class MainWindow(qtw.QWidget):
def __init__(self):
super().__init__()
# Change The Title
self.setWindowTitle("Hello PyQt5")
# To Change Window Icon
# self.setWindowIcon(QtGui.QIcon("../CodeX/CodeX Base/codex.png"))
... | MananBhanushali/PyQt5 | hello.py | hello.py | py | 1,160 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "PyQt5.QtWidgets.QWidget",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "PyQt5.QtWidgets",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtWidgets.QVBoxLayout",
"line_number": 17,
"usage_type": "call"
},
{
"api_name":... |
5581578150 | import sys
import json
def main():
prog = json.load(sys.stdin)
print(prog)
for func in prog["functions"]:
new_instrs = []
for instr in func["instrs"]:
new_instrs.append(instr)
new_instrs.append({'dest': 'new_var', 'op': 'const',
'type'... | JonathanDLTran/CS6120-Jonathan | trivial_pass.py | trivial_pass.py | py | 514 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "json.load",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sys.stdin",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "json.dumps",
"line_number": 16,
"usage_type": "call"
}
] |
27590970027 | import spider_jqdata_swhy as jqhy
import spider_db as db
import spider_sql as sql
import datetime as dt
import time
import example_logger as log
from jqdatasdk import *
def init_jqdata_swhy(swhylevel):
res = jqhy.get_jqdata_swhy(swhylevel)
if res is not None:
try:
con = db.get_dbcon()
... | harlemnight/spider | example_jqdata.py | example_jqdata.py | py | 3,332 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "spider_jqdata_swhy.get_jqdata_swhy",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "spider_db.get_dbcon",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "spider_sql.SQL_DELETE_STOCK_JQDATA_SWHY",
"line_number": 17,
"usage_type": "attrib... |
12070097645 | import requests
from bs4 import BeautifulSoup
# EXAMPLE LINK https://github.com/Kingshukrox?tab=repositories
# TAG WHERE NAME OF THE REPO IS STORED(more <a> tag within this) wb-break-all
# ABOUT p-note user-profile-bio mb-3 js-user-profile-bio f4
username = input('Enter the exact username: ')
url = 'https://git... | Kingshukrox/WebScraping-python | github repo list AND selenium/github_repo.py | github_repo.py | py | 1,281 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "requests.get",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 16,
"usage_type": "call"
}
] |
22288318286 | # -*- coding: utf-8 -*-
"""
Created on Fri Apr 2 21:05:28 2021
@author: Ale
"""
import cv2
from utils import listFiles, getBaseName, create_folder
def main():
files = listFiles('data')
if files == []:
print('Folder *data* is empty, please load video file first!')
exit()
else:
... | alex1779/extract_frames_with_cv2 | main.py | main.py | py | 1,018 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "utils.listFiles",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "utils.getBaseName",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "utils.create_folder",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "cv2.VideoCaptur... |
30558467736 | from datetime import datetime
import pytest
from alpaca.broker.requests import (
UploadDocumentMimeType,
UploadDocumentRequest,
UploadDocumentSubType,
DocumentType,
UploadW8BenDocumentRequest,
W8BenDocument,
CreateJournalRequest,
)
from alpaca.broker.models import (
AccountDocument,
... | alpacahq/alpaca-py | tests/broker/test_models.py | test_models.py | py | 13,662 | python | en | code | 324 | github-code | 21 | [
{
"api_name": "pytest.raises",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "alpaca.broker.models.AccountDocument",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "pytest.raises",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "alpa... |
14452146447 | import gym
import gym_airsim
import torch
import numpy as np
import argparse
import ast
parser = argparse.ArgumentParser()
# parser.add_argument("--goal", type=str, required=True)
# args = parser.parse_args()
# goal = ast.literal_eval(args.goal)
# print(f"Goal is {goal} type {type(goal)}")
path_to_model = '/home/i... | FaisalAhmed0/gym-airsim | airsim_policy_test.py | airsim_policy_test.py | py | 1,378 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "torch.load",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "gym.make",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "gym.make",
"line_numbe... |
12023934558 | from unittest import TestCase
import sqlite3
import tempfile
import random
import os
import uuid
from shutil import copytree, rmtree
from aequilibrae import Project
import string
from ...data import siouxfalls_project
class TestAbout(TestCase):
def setUp(self) -> None:
os.environ['PATH'] = os.path.join(te... | chrisc20042001/AequilibraE | tests/aequilibrae/project/test_about.py | test_about.py | py | 3,088 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "unittest.TestCase",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "os.environ",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_nu... |
71002289654 | # -*- coding: utf-8 -*-
import json
import time
from django.http import HttpResponseRedirect, HttpResponse
from django.template import RequestContext
from django.shortcuts import render_to_response
from django.db.models import F
from django.contrib.auth.decorators import login_required
from django.contrib.auth.models ... | chengdg/weizoom-panda | product/product_list.py | product_list.py | py | 18,301 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "core.resource.Resource",
"line_number": 43,
"usage_type": "attribute"
},
{
"api_name": "core.resource",
"line_number": 43,
"usage_type": "name"
},
{
"api_name": "core.resource",
"line_number": 45,
"usage_type": "name"
},
{
"api_name": "models.Produc... |
23601909755 | import json
import logging
from http.server import BaseHTTPRequestHandler
from app_config import AppConfig
config = None
class UserService(BaseHTTPRequestHandler):
"""The UserService Class provides a HTTP Handler for the User Service
Methods
-------
do_Get() - Handles GET requests
"""
# _use... | koebane82/user-application-poc | src/user_service.py | user_service.py | py | 3,106 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "http.server.BaseHTTPRequestHandler",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "logging.debug",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "logging.info",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "logging.... |
18843283615 | import pygame
# inicializa pygame e fonte
pygame.init()
pygame.font.init()
# janela
display = pygame.display.set_mode((1280, 720))
# campo
campo_img = pygame.image.load('../assets/bg.png')
campo = campo_img.get_rect()
'''
PLAYER 1:
(0,0) = canto superior esquerdo
30 = largura
150 = altura
'''
player... | staradrik/gamePongClass | scripts/legacy_game.py | legacy_game.py | py | 5,795 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pygame.init",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "pygame.font.init",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pygame.font",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "pygame.display.set_mode",
... |
5789665961 | import itertools
import math
import sys
import orst
try:
s = sys.argv[1]
except:
s = sys.stdin.read()
ret = []
for elem in s:
ret.append(orst.code_page.index(elem))
total = power = 0
for elem in ret:
total += elem * 512 ** power
power += 1
ret = []
while total:
tot... | cairdcoinheringaahing/Orst-Geo | orst2geo.py | orst2geo.py | py | 815 | python | en | code | 4 | github-code | 21 | [
{
"api_name": "sys.argv",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "sys.stdin.read",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sys.stdin",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "orst.code_page.index",
... |
15351330059 | # coding=future_fstrings
from __future__ import print_function
from __future__ import unicode_literals
import os
import numpy as np
import logging
logging.getLogger('matplotlib').setLevel(logging.ERROR)
import time
from collections import defaultdict
import matplotlib
# matplotlib.use('agg')
# matplotlib.rc('xtick.maj... | RomoL2/RegVar | inst/extdata/RBPamp/RBPamp/report.py | report.py | py | 70,995 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "logging.getLogger",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "logging.ERROR",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.rcParams",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "matplotli... |
31217038917 | from torch.utils.data import DataLoader
from models import captcha
from util.my_dataset import *
from util.one_hot import *
# test_dir = DIR_DATA + r'\valid'
# test_dir = DIR_PROJECT + r'\train'
test_data = MyDataSet(captcha_type[2])
test_dataloader = DataLoader(test_data, batch_size=batch_size, shuffle=True)
# 加载之前... | liuzhewu/captcha | test.py | test.py | py | 932 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "torch.utils.data.DataLoader",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "torch.utils.data.load",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "torch.utils.data",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "mo... |
43235342905 | import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
data = pd.read_csv('BTC-EUR.csv', index_col='Date', parse_dates=True)
data['Buy'] = np.zeros(len(data))
data['Sell'] = np.zeros(len(data))
data['Rolling MAX'] = data['Close'].shift(1).rolling(window=28).max()
data['Rolling MIN'] = data['Close'].sh... | NathanLeDev/BTC-analysis---turtle-method | exBTC.py | exBTC.py | py | 898 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pandas.read_csv",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.subplots",
... |
70014486452 | """
Allows for quick and simple debugging of tests.
Note:
`pytest-cov` / `coverage.py` must be disabled for this to debug properly.
Easiest way is to ensure that pytest gets passed the `- -no - cov` flag.
"""
import sys
import pytest
if __name__ == "__main__":
# Checking if the setup.cfg contains lines th... | ans-group/sdk-python | run_tests.py | run_tests.py | py | 649 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "sys.exit",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pytest.main",
"line_number": 18,
"usage_type": "call"
}
] |
3961888889 | # coding:utf-8
import sys
import os
curpath = os.path.realpath(__file__)
prepath = curpath[:-7]
sys.path.append(prepath)
from PyQt5.QtCore import pyqtSignal, QThread
from Ui_MainWindow import Ui_MainWindow
from Ui_Dialog import Ui_Dialog
from PyQt5.QtWidgets import QWidget, QApplication, QMainWindow, QFile... | Hhkai/WMLFRTM | test.py | test.py | py | 6,936 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "os.path.realpath",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "sys.path.append",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_numbe... |
26361276701 | from binascii import hexlify, unhexlify
import pefile
import regex as re
import argparse
import logging
import traceback
import os
import sys
import json
import hashlib
import yara
import subprocess
import shutil
import base64
import gzip
from pathlib import Path
from binascii import hexlify, unhexlify
import extract_c... | MuziSec/malware_scripts | bumblebee/buzzbuzz.py | buzzbuzz.py | py | 12,482 | python | en | code | 4 | github-code | 21 | [
{
"api_name": "pathlib.Path",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.path.realpath",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_n... |
34630038190 | import numpy as np
import matplotlib.pyplot as plt
from collections import Counter
with open('textoprueba.txt', 'r') as archivo:
datosleidos=archivo.read().replace('\n', '')
print ("DATOS LEIDOS:")
print (datosleidos)
boriginal=list("abcdefghijklmnopqrstuvwxyz .,!0123456789ABCDEFGHIJLMNOPQRSTUVWXYZ")
#bcifrada = li... | jameshell/telematica2 | cifrado.py | cifrado.py | py | 1,500 | python | es | code | 0 | github-code | 21 | [
{
"api_name": "collections.Counter",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.bar",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyp... |
1117759953 | import pandas as pd
from pathlib import Path
# Function to convert temperature from Kelvin to Celsius
def kelv_to_celsius(temp_kelv: float) -> float:
"""Convert temperature from Kelvin to Celsius.
Parameters:
temp_kelvin (float): Temperature in Kelvin.
Returns:
float: Temperature in Celsiu... | GransMango/WeatherItsRainOrShineImFine | DataProcessing.py | DataProcessing.py | py | 1,875 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "pathlib.Path.cwd",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "pandas.read_csv",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
... |
74367270452 | from django.contrib import admin
from .models import Article
# Register your models here.
class ArticleAdmin(admin.ModelAdmin):
list_display = (
"created_ad",
"author",
"title",
"content",
"content_text",
"img",
"id",
)
admin.site.register(Article, Ar... | VashUber/web-4sem | server/src/api/admin.py | admin.py | py | 332 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django.contrib.admin.ModelAdmin",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.contrib.admin.site.register",
"line_number": 19,
"usage_type": "call"
},... |
197053572 | # coding = utf-8
# author: holger
# version: 4.0.0
# license: AGPL-3.0
# belong: DailyReport-BotCore
import json
import os
import sys
import traceback
from random import randint
from time import sleep
from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.... | HolgerZhang/DailyReport | BotCore/bot.py | bot.py | py | 14,522 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "os.environ.get",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "os.environ.get",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_... |
6518612837 | import logging
import math
import qcelemental as qcel
from . import optparams as op
from . import v3d
from . import log_name
from .exceptions import AlgError
from .misc import string_math_fx
from .simple import Simple
logger = logging.getLogger(f"{log_name}{__name__}")
class Oofp(Simple):
"""out-of-plane angle... | psi-rking/optking | optking/oofp.py | oofp.py | py | 8,539 | python | en | code | 17 | github-code | 21 | [
{
"api_name": "logging.getLogger",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "simple.Simple",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "simple.Simple.__init__",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "simple.Simple"... |
15231522925 | # -*- coding: utf-8 -*-
"""
@author: Sreeraman SR
"""
import argparse
import base64
import concurrent.futures
import glob
import os
from collections import OrderedDict
import cv2
import numpy as np
import requests
import torch
from models.network_swin2sr import Swin2SR as net
from utils import util_calculate_psnr_ss... | Sreeramansr/Image-Upscaling-Module | swin2sr_net.py | swin2sr_net.py | py | 3,897 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "torch.device",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "torch.cuda.is_available",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "models.network_s... |
43893451231 | """create the default_user_policy
Revision ID: 12a91e0863f5
Revises: 4d42b4db090f
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '12a91e0863f5'
down_revision = '4d42b4db090f'
POLICY_NAME = 'wazo_default_user_policy'
POLICY_DESCRIPTION = '''\
Default Wazo poli... | wazo-platform/wazo-auth | wazo_auth/database/alembic/versions/12a91e0863f5_create_the_default_user_policy.py | 12a91e0863f5_create_the_default_user_policy.py | py | 3,258 | python | en | code | 7 | github-code | 21 | [
{
"api_name": "sqlalchemy.sql.table",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.sql",
"line_number": 54,
"usage_type": "attribute"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "sqlalchemy... |
71339522293 | import gc
import logging
import os
import platform
import struct
from tempfile import TemporaryDirectory
from typing import List, Optional
import lief # type: ignore
import lief.PE # type: ignore
import pyscylla # type: ignore
from .process_control import MemoryRange, ProcessController
LOG = logging.getLogger(__n... | Dy-Baby/unlicense | unlicense/dump_utils.py | dump_utils.py | py | 5,872 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "logging.getLogger",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "lief.parse",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "lief.PE",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "process_control.MemoryRange... |
23193885088 | import datetime
import pandas as pd
from apscheduler.schedulers.blocking import BlockingScheduler
#from apscheduler.schedulers.background import BackgroundScheduler
list_1 = []
def test_1():
list_1.append(str(datetime.datetime.now())[0:19])
pd.Series(list_1).to_csv('apsched.csv')
print('job executed!')
... | wonderui/Python-Practice | 0_Inbox/apscheduler/sched.py | sched.py | py | 512 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "datetime.datetime.now",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "pandas.Series",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "datetime.date... |
38177693587 | # © 2022 - Numigi (tm) and all its contributors (https://bit.ly/numigiens)
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
import base64
from odoo import api, models
from odoo.addons.product_pricelist_direct_print_extended.wizards.\
product_pricelist_print import ProductPricelistPrint
@api.multi
... | Numigi/odoo-product-addons | product_pricelist_direct_print_chatter/wizards/product_pricelist_print.py | product_pricelist_print.py | py | 3,337 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "odoo.api.multi",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "odoo.api",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "odoo.addons.product_pricelist_direct_print_extended.wizards.product_pricelist_print.ProductPricelistPrint.send_batch... |
31353292793 | #Given: Positive integer n ≤ 7
#Return: Total number of permutations of length n, followed by list of all permutations
import math
import itertools
def permcalculator(n):
"""Prints total number of permutations of length n, followed by list of all permutations"""
#Factorial is the product of all posi... | agolikova/Rosalind-Bioinformatics-Solutions | Code/PERM_Enumerating gene orders.py | PERM_Enumerating gene orders.py | py | 648 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "math.factorial",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "itertools.permutations",
"line_number": 13,
"usage_type": "call"
}
] |
18609544132 | """gmail
Usage:
gmail.py (--to TO) [--subject SUBJECT] [--body BODY] [--file FILE]...
gmail.py (-h | --help)
gmail.py --version
Options:
--to TO
--subject SUBJECT
--file FILE
--body BODY
-h, --help Show this screen
--version Show version
"""
# The code in https://www.geeksfor... | maxgonzaga/gmail_sender | gmail.py | gmail.py | py | 1,809 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "dotenv.load_dotenv",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "email.mime.multipart.MIMEMultipart",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "email... |
38044834402 | from typing import List
from github import Github
import pandas as pd
from github.Repository import Repository
from repo_issue import RepoIssue
from repo_pull_request import RepoPullRequest
class Repo:
def __init__(self, name: str, full_name: str, gh_client: Github):
self.name = name
self.full_n... | Reslan-Tinawi/visualization-libraries-dashboard | src/repo.py | repo.py | py | 5,223 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "github.Github",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "github.Repository.Repository",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "pandas.DataFrame",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "pandas.Da... |
47629156624 | from django.urls import path
from . import views
urlpatterns = [
path('', views.all_gear_list, name='all_gear_list'),
path('/bat_list', views.bat_list, name='bat_list'),
path('/bat/<int:id>', views.bat_detail, name='bat_detail'),
path('/glove_list', views.glove_list, name='glove_list'),
path('/glov... | AlbertWhitlock/Baseball-Gear-Reviewer | baseball_gear_reviewer/reviewer/urls.py | urls.py | py | 1,256 | python | en | code | 0 | github-code | 21 | [
{
"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",
... |
6877706230 | # noqa W605
import torch
import torch.nn.functional as F
from torch import nn
from torch.autograd import Function
from torch.jit import script
from pytorch_tabular.models.common.layers import PositionWiseFeedForward
from .utils import _make_ix_like
# GLU Variants Improve Transformer https://arxiv.org/pdf/2002.05202... | Lapis-Hong/pytorch_tabular | src/pytorch_tabular/models/common/activations.py | activations.py | py | 6,989 | python | en | code | null | github-code | 21 | [
{
"api_name": "torch.nn.Module",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "pytorch_tabular.models.common.layers.PositionWiseFeedForward",
"line_number": 27,
"usage_type": "call"
},... |
6502007380 | from abc import ABCMeta, abstractmethod
from typing import Optional, Any, List, Dict, Type
from astroplan import ObservingBlock
from pyobs.utils.time import Time
from .task import Task
from pyobs.object import Object
class TaskSchedule(Object, metaclass=ABCMeta):
def __init__(self, **kwargs: Any):
Object... | pyobs/pyobs-core | pyobs/robotic/taskschedule.py | taskschedule.py | py | 1,501 | python | en | code | 8 | github-code | 21 | [
{
"api_name": "pyobs.object.Object",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "abc.ABCMeta",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "typing.Any",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "pyobs.object.Object.__init... |
34202492197 | from PyQt5.QtWidgets import QWidget, QMainWindow
from typing import List, Tuple
from pycture.dialogs import SegmentsInput
from ..command import Command
class TransformByLinearSegments(Command):
def __init__(self, parent: QWidget):
super().__init__(parent, "By linear segments")
def execute(self, mai... | miguel-martinr/Pycture | src/pycture/commands/edit_commands/transform_by_linear_segments.py | transform_by_linear_segments.py | py | 1,960 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "command.Command",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtWidgets.QWidget",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtWidgets.QMainWindow",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "py... |
71116806773 | import read
import pandas as pd
from collections import Counter
df = read.load_data()
print(df.head(2))
long_str = ' '.join(df['headline'].astype(str).tolist())
str_list = long_str.split(' ')
cnt = Counter()
for word in str_list:
cnt[word] += 1
for val in cnt:
if cnt[val] > 100:
print(val) | anuj8june/dataquest_projects | Guided Project- Transforming data with Python/count.py | count.py | py | 313 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "read.load_data",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "collections.Counter",
"line_number": 10,
"usage_type": "call"
}
] |
4616812510 | import json
import requests
import sqlite3
import re
from django.shortcuts import render
# Create your views here.
from django.template.defaultfilters import pprint
from django.utils.decorators import method_decorator
from django.views import generic
from django.http.response import HttpResponse
from django.views.dec... | tiinyphoto/chatbot | comchatbot/chatbot/views.py | views.py | py | 3,145 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django.views.generic.View",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "django.views.generic",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "django.http.response.HttpResponse",
"line_number": 26,
"usage_type": "call"
},
{
... |
33912023487 | from functools import wraps
from bot import bot
from pyrogram.types import InlineKeyboardMarkup, InlineKeyboardButton
from pyrogram.errors.exceptions.bad_request_400 import UserNotParticipant
FTEXT = f" **🚫Access Denied🚫** \nYou Must Join [Our Channel](https://t.me/CGSUpdates)To Use Me. So, Please Join it &... | stdano1/blabla | bot/plugins/fsub.py | fsub.py | py | 940 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pyrogram.types.InlineKeyboardMarkup",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pyrogram.types.InlineKeyboardButton",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pyrogram.errors.exceptions.bad_request_400.UserNotParticipant",
"line_n... |
24912399745 | import csv
import pandas as pd
import psycopg2 as pg
#from sqlalchemy import create_engine
def main():
conn = pg.connect(
database="ernieplus",
)
cursor = conn.cursor()
for i in range(0, 31, 5):
peelback_query = "select citing_integer_id, cited_integer_id from akhilrj2.peelback_table where peelback_y... | illinois-or-research-analytics/spring_2022_research | akhil/DEFUNCT_peelback_analysis/generate_peelback_csv.py | generate_peelback_csv.py | py | 701 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "psycopg2.connect",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pandas.read_sql_query",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 17,
"usage_type": "call"
}
] |
37670235840 | import requests
import urllib3
from lxml import etree
urllib3.disable_warnings() #忽略https证书告警
headers = {
'Cookie': '登录后获取自己cookie',
'Upgrade-Insecure-Requests': '1',
'Referer': 'https://fofa.so/',
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70... | MambaInVeins/File_Transfer | src/fofa_spider.py | fofa_spider.py | py | 1,734 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "urllib3.disable_warnings",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "lxml.etree.HTML",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "lxml.etree",
... |
33926821081 | # imports
import pandas as pd
import matplotlib.pyplot as plt
# read data into a DataFrame
data = pd.read_csv('advertising.csv')
data.head()
# print the shape of the DataFrame
data.shape
# visualize the relationship between the features and the response using scatterplots
fig, axs = plt.subplots(1, 3, sh... | skffaisal/Machine-learning-model-_-Linear-regression | project1.py | project1.py | py | 3,900 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pandas.read_csv",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "sklearn.l... |
30910193128 | from django.template.loader import get_template
from django.http import HttpResponse, HttpResponseRedirect, HttpResponseBadRequest
from django.template import Context
from teaching_data_structure import TeachingHierarchy, SchoolYear, TeachingClass
from utils import get_header_navbar
import json
from djangoSRV.teacher i... | varun-verma11/CodeDrill | djangoSRV/Views/teacher_view.py | teacher_view.py | py | 2,783 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "djangoSRV.teacher.get_courses_with_assignments2",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "django.template.loader.get_template",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "utils.get_header_navbar",
"line_number": 20,
"usage_t... |
41301762662 |
from django.urls import path
from . import views
urlpatterns =[
path('', views.alljobs, name='alljobs'),
path('python/',views.pythonjobs, name='pythonjobs'),
path('php/',views.phpjobs, name='phpjobs'),
path('java/',views.javajobs, name='javajobs'),
path('javascript/',views.javascriptjobs, name='j... | johngaitho05/Portfolio-Website | jobs/urls.py | urls.py | py | 447 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
3662704394 | from threading import Lock
from bluetooth.ble import GATTRequester
import logging
class Bulb(object):
#
# Commands
#
GET_CONFIG = (0x2b, 0x05, 0x04)
SET_CONFIG = (0x2b, 0x0d, 0x03)
GET_NAME = (0x03, None, None)
SET_RESET = (0x2b, 0x05, 0x0b)
#
# Color & brightness c... | GabK/pyrevogi | pyrevogi/__init__.py | __init__.py | py | 4,487 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "threading.Lock",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "bluetooth.ble.GATTRequester",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "logging.debug",
"line_number": 131,
"usage_type": "call"
}
] |
5170667284 | # ==============================================================================
# File: player_data.py
# Project: allison
# File Created: Sunday, 31st October 2021 2:55:59 pm
# Author: Dillon Koch
# -----
# Last Modified: Sunday, 31st October 2021 2:56:00 pm
# Modified By: Dillon Koch
# -----
#
# -----
# Cleaning/comb... | DillonKoch/Sports_Betting | Data_Cleaning/player_data.py | player_data.py | py | 21,057 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "os.path.dirname",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.path.abspath",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "sys.path.append",
"... |
86745532628 | import sys
input = sys.stdin.readline
from collections import deque
deq = deque()
n, k = map(int, input().split())
answer = []
for i in range(1, n+1):
deq.append(i)
for i in range(n):
for j in range(k-1):
deq.append(deq.popleft())
answer.append(deq.popleft())
print('<'+', '.join(map(str, answer))... | STkangyh/VacationAlgorithmClass | Baekjun/Silver/1158.py | 1158.py | py | 327 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "sys.stdin",
"line_number": 2,
"usage_type": "attribute"
},
{
"api_name": "collections.deque",
"line_number": 5,
"usage_type": "call"
}
] |
32361171058 | import string
import textwrap
from prompt_toolkit.completion import Completion
from empire.client.src.EmpireCliState import state
from empire.client.src.menus.Menu import Menu
from empire.client.src.utils import table_util, date_util, print_util
from empire.client.src.utils.autocomplete_util import filtered_search_li... | ryanmrestivo/red-team | Command-Control-Exfiltration-&-Persistance/Empire/Empire/empire/client/src/menus/ListenerMenu.py | ListenerMenu.py | py | 4,509 | python | en | code | 91 | github-code | 21 | [
{
"api_name": "empire.client.src.menus.Menu.Menu",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "empire.client.src.utils.autocomplete_util.position_util",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "empire.client.src.utils.autocomplete_util.filtered_sear... |
19121959461 | from rest_framework.decorators import api_view
from rest_framework.response import Response
from .settings import REST_AUTH
@api_view()
def root_route(request):
return Response({
"message": "This is The APi of PP55"
})
# dj-rest-auth logout view fix
@api_view(['POST'])
def logout_route(request):
... | JacquesIversen/api-rest-for-final-pp5 | pp5_api/views.py | views.py | py | 799 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "rest_framework.response.Response",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "rest_framework.decorators.api_view",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "rest_framework.response.Response",
"line_number": 16,
"usage_type": "ca... |
5606525294 | from utils import *
from pydrake.multibody.plant import MultibodyPlant
from pydrake.multibody.parsing import Parser
from pydrake.systems.framework import Context, LeafSystem, BasicVector, DiscreteValues, EventStatus
from pydrake.trajectories import Trajectory, PiecewisePolynomial
from pydrake.common.value import A... | git-dhruv/Hop-Skip-and-Jump | src/phase_switch.py | phase_switch.py | py | 4,952 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pydrake.systems.framework.LeafSystem",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "pydrake.systems.framework.LeafSystem.__init__",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pydrake.systems.framework.LeafSystem",
"line_number": 14,
... |
25942718168 | """
@Author: Arjun Ravikumar
@Purpose: To find the best cluster count and then agglomerate the data
"""
import numpy as np
import sys
from sklearn.cluster import KMeans
from sklearn.metrics import silhouette_score
'''
Global variables
'''
class Agglomerate:
columnsArray = {}
csvData = {}
clusters = []
clusterLis... | arjunravikumar/LocationBasedIntelligence | Agglomeration.py | Agglomeration.py | py | 6,110 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "sklearn.cluster.KMeans",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "sklearn.metrics.silhouette_score",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "numpy.sqrt",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "nu... |
16640856964 | import numpy as np
import matplotlib.pyplot as plt
from Algorithms.FilterBanks.FilterBanks import Downsample, Upsample
from Algorithms.FilterBanks.TwoBandFilters import ParalleloidDecimator
class Lattice2D(object):
def __init__(self):
super(Lattice2D, self).__init__()
self._basis = None
def s... | alabamagan/Python-code-lab | Lattice/MakeLattice.py | MakeLattice.py | py | 3,412 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "numpy.ndarray",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "numpy.array",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "matplotlib.... |
130774664 | from django.db.models import Q, ForeignKey, ManyToManyField
def prepare_model_data_from_dict(model_data, data):
copy_data = {}
fks = [field.name for field in model_data._meta.get_fields() if isinstance(field, ForeignKey) ]
m2m = [field.name for field in model_data._meta.get_fields() if isinstance(field, M... | nou-ros/pyLab | pyWebFramework/06-django-lab/02-django-api/01-graphene/_03_accounting/api/utils.py | utils.py | py | 572 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django.db.models.ForeignKey",
"line_number": 5,
"usage_type": "argument"
},
{
"api_name": "django.db.models.ManyToManyField",
"line_number": 6,
"usage_type": "argument"
}
] |
18456983389 | """Author: Andy Rosales Elias. University of California, Santa Barbara. andy00@umail.ucsb.edu"""
import sqlite3 as lite
####CONFIG FOR GAME MECHANICS#######
def dropTable(table):
"""Precondition: Table exists and wants to be deleted/dropped :rip:
Postcondition: Deletes tablename_{channel} db table"""
c... | andyyy60/slack-tic-tac-toe | db_config.py | db_config.py | py | 3,032 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "sqlite3.connect",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
... |
35701368447 | from io import BytesIO
import torch
import werkzeug
from flask_restful import Resource, reqparse
from PIL import Image
from transformers import (AutoTokenizer, VisionEncoderDecoderModel,
ViTImageProcessor)
class Image2Text(Resource):
def post(self):
parser = reqparse.RequestPars... | carlos19960601/ai-experience | image2text.py | image2text.py | py | 1,667 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "flask_restful.Resource",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "flask_restful.reqparse.RequestParser",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "flask_restful.reqparse",
"line_number": 13,
"usage_type": "name"
},
{
... |
31970453941 | from __future__ import division
import random
from flask import abort, request, session
from sqlalchemy import or_
from idl import app
from idl.cache import cache
from idl.database import idl_session
from idl.database.models import StoredPlayer
from idl.views.utils import get_games_for_player, get_forum_member, \
... | camgunz/idl.org | idl/views/player_profiles.py | player_profiles.py | py | 2,422 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "idl.database.idl_session.query",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "idl.database.models.StoredPlayer",
"line_number": 20,
"usage_type": "argument"
},
{
"api_name": "idl.database.idl_session",
"line_number": 20,
"usage_type": "name"
... |
7790060166 | import numpy as np
import pandas as pd
from sklearn.metrics import confusion_matrix
import torch
import torch.nn as nn
import torch.nn.functional as F
import matplotlib.pyplot as plt
import os
import sys
from tqdm import tqdm
import h5py
import random
import math
import gpytorch
import utils
from torch.nn.utils import ... | suvoooo/Transients-MissingData | models.py | models.py | py | 25,827 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "gpytorch.models",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "gpytorch.means.ConstantMean",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "gpytorch.means",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "... |
18330252194 | #!/usr/bin/env python3
print('__file__={0:<35} | __name__={1:<20} | __package__={2:<20}'.format(__file__,__name__,str(__package__)))
import numpy as np
import matplotlib.pyplot as plt
from scipy.optimize import minimize
from scipy.optimize import NonlinearConstraint
import pyoptsparse as pyop
from pyoptsparse.pyOpt_so... | sethmnielsen/optimization-techniques | hw1/trusty_solver.py | trusty_solver.py | py | 4,968 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "seaborn.set_style",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.ones",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "pyoptsparse.Optimization",
"line_number": 41,
"usage_type": "attribute"
},
{
"api_name": "numpy.arra... |
1337909473 |
import json
import requests
"""根据起点和终点,返回路线规划的距离和行驶时间"""
#设置出行方式
trip_mode = 'driving'
#判断出行方式,获取相应接口地址
if trip_mode == 'driving':
url = 'http://api.map.baidu.com/routematrix/v2/driving?'
elif trip_mode == 'riding':
url = 'http://api.map.baidu.com/routematrix/v2/riding?'
elif trip_mode == 'walking':
url = 'http:... | MiguelCoco/Route-Matrix- | route_matrix.py | route_matrix.py | py | 1,729 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "requests.get",
"line_number": 41,
"usage_type": "call"
}
] |
26107273535 | import argparse
import csv
import datetime
import json
import logging
import os
import sys
import numpy as np
import torch
import torch.nn as nn
from torch.utils.data import DataLoader
from dataset import get_dataset
from model import get_model
from params import HyperParams
logger = logging.getLogger(__name__)
logg... | kasegao/sagemaker-sample | src/entry.py | entry.py | py | 6,012 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "logging.getLogger",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "logging.StreamHandler",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "sys.stdout... |
5631843572 | import torch
import torch.nn as nn
import torchvision
from torch.utils.data import Dataset, DataLoader, random_split
from torchvision import transforms as T
from PIL.JpegImagePlugin import convert_dict_qtables
from PIL import Image
import torch.fft
import torch.nn.functional as F
import numpy as np
import os
import m... | KimJwn/videoprint | utils.py | utils.py | py | 7,317 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "torchvision.transforms.Compose",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "torchvision.transforms",
"line_number": 45,
"usage_type": "name"
},
{
"api_name": "torchvision.transforms.ToTensor",
"line_number": 46,
"usage_type": "call"
},
{
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.