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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7160418371 | from typing import Callable, List
import matplotlib
from matplotlib.animation import FuncAnimation
from matplotlib.axes import Axes
import matplotlib.pyplot as plt
import numpy as np
from drawnow import drawnow
from numpy.random import rand, uniform
# f(x,y) = (1.5 – x -xy)^2 + (2.25 – x + xy^2)^2 + (2.625 – x + xy^3)... | DonChaka/PSI | Chmara/Chmara.py | Chmara.py | py | 4,495 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "typing.Callable",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "numpy.random.uniform",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "numpy.random.uniform",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "numpy.rando... |
2697985372 | import numpy as np
import cv2, time, pandas
from datetime import datetime
face_cascade = cv2.CascadeClassifier('haarcascade_frontalface_default.xml')
eye_cascade = cv2.CascadeClassifier('haarcascade_eye.xml')
#updates for graph
first_frame=None
status_list=[None,None]
times=[]
df=pandas.DataFrame(columns=["Start","E... | bhasinparth/Automate-boring-stuff-With-Python | live_face_eye.py | live_face_eye.py | py | 1,584 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "cv2.CascadeClassifier",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "cv2.CascadeClassifier",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "cv2.VideoW... |
40136038854 | import pandas
import numpy as np
import math
import string
from sklearn.datasets import fetch_20newsgroups
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.naive_bayes import MultinomialNB
from sklearn import metrics
from nltk.stem impo... | Chikharom/CompetitionML | test_sk2.py | test_sk2.py | py | 1,908 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sklearn.feature_extraction.text.TfidfVectorizer",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 24,
"usage_type": "call"
},
{
"api_n... |
31837098333 | #!
# object & class
# 6.1 object
# object(data, code)
# object(variable, function)
# object(attribute, method)
# 6.2 class
class Person():
def __init__(self, name):
self.name = name
hunter = Person('Elmer Fudd')
print(hunter.name)
# 6.3 inheritance
class Car():
def exclaim(self):
print("I'm a Car!")
class Y... | Maphnew/introducing_python | part6.py | part6.py | py | 6,060 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "collections.namedtuple",
"line_number": 203,
"usage_type": "call"
}
] |
22701912195 | from re import template
from django.http import HttpResponseRedirect,HttpResponse,HttpResponseNotFound
from django.shortcuts import render
from django.urls import reverse
from django.core.files.storage import FileSystemStorage
from .models import Candidate
from .forms import CandidateForm
# Create your views here.
de... | roli-1y/Job-application-review-candidate-management-system-using-Django | JARS_/candidates/views.py | views.py | py | 3,101 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "models.Candidate.objects.get",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "models.Candidate.objects",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "models.Candidate",
"line_number": 16,
"usage_type": "name"
},
{
"api_n... |
72128928188 | #group. gltexture acts differently, so need it maybe.
from pyglet.gl import *
#https://pyglet.readthedocs.io/en/latest/programming_guide/graphics.html
from pyglet.graphics import vertex_list, vertex_list_indexed, Batch
#pyglet.graphics.vertex_list
from pyglet import image
pic = image.load('pic2.jpg')
texture = pic.g... | liltmagicbox/3dkatsu | pyglets/pyglet_11_4_shader_group.py | pyglet_11_4_shader_group.py | py | 2,194 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pyglet.image.load",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pyglet.image",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "pyglet.gl.window.Window",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pyglet.gl.wind... |
7134123665 | from itertools import product
from pathlib import Path
import numpy as np
import torch
import torchvision.transforms as transforms
from torch import nn
from torch.utils import data
from tqdm import tqdm
import wandb
from datasets.blastocyst import ClinicDataset, SFUDataset
from models.unet import UNet
from utils.trai... | mrvanolog/fc_inceptioned_unet | train_vanilla_unet.py | train_vanilla_unet.py | py | 4,408 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "torch.cuda.is_available",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "torchvision.transforms.Compose",
"line_number": 20,
"usage_type": "call"
},
{
"api_name":... |
75014307388 | import numpy as np
from deap import base
from deap import creator
from deap import tools
from deap import algorithms
import matplotlib.pyplot as plt
import random
t = np.arange(0, 24)
P_PV = np.array([0, 0, 0, 0, 0, 0, 0, 0, 6, 10, 15, 20,
30, 40, 40, 20, 15, 10, 8, 2, 0, 0, 0, 0])
P_WT = ... | Dany503/Algoritmos-Geneticos-en-Python-Un-Enfoque-Practico | Cap5/Capitulo5_multiples_objetivos.py | Capitulo5_multiples_objetivos.py | py | 5,471 | python | en | code | 33 | github-code | 6 | [
{
"api_name": "numpy.arange",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": ... |
10230321685 | """
This file defines the base class for evals.
"""
import abc
import asyncio
import logging
import os
import random
from multiprocessing.pool import ThreadPool
from pathlib import Path
from typing import Any, Awaitable, Callable, Dict, List, Optional, Tuple
from tqdm import tqdm
from evals.api import CompletionFn
f... | openai/evals | evals/eval.py | eval.py | py | 9,331 | python | en | code | 12,495 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "typing.List",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "typing.Any",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "random.Random",
"line_nu... |
70623684667 | class Binary:
def run(self, N):
import pdb;pdb.set_trace()
result = []
while N>0:
i = int(N%2)
N=int(N/2)
result.append(i)
# return result[::-1]
return [a for a in reversed(result)]
print(Binary().run(20))
| presitad/ibit | decitobin.py | decitobin.py | py | 296 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pdb.set_trace",
"line_number": 3,
"usage_type": "call"
}
] |
31095145330 | import bpy
from .util import *
from .read_material import *
from .write_material import *
from .read_mesh import *
from .write_mesh import *
from .read_sms_mesh import *
from .write_sms_mesh import *
import bmesh
from bpy_extras.io_utils import ImportHelper
from bpy_extras.io_utils import ExportHelper
from bpy_extras.... | ElectricVersion/Blender-FATE-plugin | __init__.py | __init__.py | py | 15,779 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "bpy.utils.register_class",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "bpy.utils",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "bpy.utils.register_class",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "bpy.... |
37083244045 | import dash
import dash_core_components as dcc
import dash_html_components as html
import datetime
from datetime import datetime as dt
import pandas as pd
import numpy as np
from app import app
from callbacks import init_callbacks
today = datetime.date.today()
def run_server():
"""
Main function to run the ... | alyahali/Udacity-Capstone-Project | lstm/index.py | index.py | py | 2,770 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "datetime.date.today",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "app.app.layout",
"line_number": 35,
"usage_type": "attribute"
},
{
"api_name": "app.app",
... |
13080180248 | #******************Author:Somnath Das**********************
#******AWS-CLI should be configured prior to run this******
#Inserting an item into existing DynamoDB table.
import boto3
client = boto3.client('dynamodb')
# Table (bookstore) was already created with Partition Key 'category' and Sort Key as 'bookid' which ... | sdas92/aws | DynamoDB/insert_record.py | insert_record.py | py | 766 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "boto3.client",
"line_number": 7,
"usage_type": "call"
}
] |
19371686817 | import glob
import numpy as np
import matplotlib.pyplot as plt
ft_files = glob.glob(r'Z:\giocomo\export\data\Projects\AlexA_NP\AA_2009*\*.ft')
time_diff = np.empty((len(ft_files),))
time_diff.fill(np.nan)
for idx,fi in enumerate(ft_files):
try:
ft_data = np.genfromtxt(fi)
vr_name = fi.replace('.ft'... | GiocomoLab/AlexA_Library | helpers/check_ft_sync.py | check_ft_sync.py | py | 809 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "glob.glob",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "numpy.empty",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "numpy.nan",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "numpy.genfromtxt",
"line_number... |
13522819749 | import numpy as np
import matplotlib.pyplot as plt
import mpl_toolkits.mplot3d as a3
from mpl_toolkits.mplot3d import Axes3D
from matplotlib.patches import Polygon
def rotplot(R, currentAxes=None):
# This is a simple function to plot the orientation
# of a 3x3 rotation matrix R in 3-D
# You shou... | prgaero/prgaero.github.io | scripts/rotplot.py | rotplot.py | py | 1,886 | python | en | code | 8 | github-code | 6 | [
{
"api_name": "numpy.array",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.dot",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 23... |
73025047229 | import random
import sys
from contextlib import contextmanager
from faker import Faker
from faker.providers import company, lorem, python
from sqlalchemy.exc import IntegrityError
from promptly.models import db
from promptly.models.chat import ChatEntry
fake = Faker()
fake.add_provider(company)
fake.add_provider(lo... | sergeyklay/promptly | backend/tests/seeder.py | seeder.py | py | 7,622 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "faker.Faker",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "faker.providers.company",
"line_number": 14,
"usage_type": "argument"
},
{
"api_name": "faker.providers.lorem",
"line_number": 15,
"usage_type": "argument"
},
{
"api_name": "fak... |
18003924085 | from algo.pn_utils.maniskill_learn.utils.data import to_torch
from algo.pn_utils.maniskill_learn.utils.torch import ExtendedModule
from ..builder import POLICYNETWORKS, build_backbone, build_dense_head
from ..utils import replace_placeholder_with_args, get_kwargs_from_shape
@POLICYNETWORKS.register_module()
class Con... | PKU-EPIC/UniDexGrasp | dexgrasp_policy/dexgrasp/algo/pn_utils/maniskill_learn/networks/policy_network/continuous_policy.py | continuous_policy.py | py | 2,201 | python | en | code | 63 | github-code | 6 | [
{
"api_name": "algo.pn_utils.maniskill_learn.utils.torch.ExtendedModule",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "utils.get_kwargs_from_shape",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "utils.replace_placeholder_with_args",
"line_number": 12,
... |
23278489532 | import logging
from urllib.parse import urljoin, urlparse
import os
import re
TAGS = {"img": "src", "link": "href", "script": "src"}
LOG = logging.getLogger(__name__)
def find_resourcetags(soup, url):
resources = []
for tag, attribute in TAGS.items():
for res in soup.find_all(tag):
resou... | LenaVolkova/python-project-lvl3 | page_loader/parse_and_name.py | parse_and_name.py | py | 1,782 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "urllib.parse.urljoin",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "urllib.parse.urlparse",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "os.path.s... |
39741262517 | # Author: R Santosh
# How to Execute(2.7.13): python test_lookup.py objName1 objName2
# Objective: Fast look up of the swift objects in the cluster
from custom_bloom_filter import calculate_md5code
from elasticsearch import Elasticsearch
import json
from flask_restful import Resource, request
es = Elasticsearch()
cl... | KumarAbhinav/elasticfilter | test_lookup.py | test_lookup.py | py | 865 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "elasticsearch.Elasticsearch",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "flask_restful.Resource",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "flask_restful.request.form",
"line_number": 16,
"usage_type": "attribute"
},
{
... |
26041296956 | from __future__ import annotations
from pathlib import Path, PurePath
from textwrap import dedent
import pytest
from packaging.version import Version
from pants.backend.python.goals import lockfile
from pants.backend.python.macros import poetry_requirements
from pants.backend.python.macros.poetry_requirements import... | pantsbuild/pants | src/python/pants/backend/python/macros/poetry_requirements_test.py | poetry_requirements_test.py | py | 22,743 | python | en | code | 2,896 | github-code | 6 | [
{
"api_name": "packaging.version.Version",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "pants.backend.python.macros.poetry_requirements.get_max_caret",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "pytest.mark.parametrize",
"line_number": 37,
"usa... |
25354375874 | from collections import Counter
class Solution:
def findAnagrams(self, s: str, p: str) -> List[int]:
dict_p=Counter(p)
dict_s=Counter(s[:len(p)])
output=[]
i=0
n=len(p)
while n<=len(s):
if dict_s==dict_p:
output.append(i)
... | nikjohn7/Coding-Challenges | LeetCode/May challenge/day17.py | day17.py | py | 563 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "collections.Counter",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "collections.Counter",
"line_number": 6,
"usage_type": "call"
}
] |
73815028346 | from os import makedirs
from os.path import join, exists, expanduser
import configparser
import json
_root = expanduser('~/.config/twitter-cli')
exists(_root) or makedirs(_root)
_config = None
CONFIG_FILE = join(_root, 'config')
DATABASE_FILE = join(_root, 'data.sqlite3')
_SECTION_PROXY = 'PROXY'
_SECTION_KEYS = 'K... | python-cli/twitter-cli | twitter_cli/config.py | config.py | py | 3,177 | python | en | code | 66 | github-code | 6 | [
{
"api_name": "os.path.expanduser",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.makedirs",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_n... |
34454524930 | from fastapi import Depends, Request
async def get_app(request: Request):
return request.app
async def get_user_by_id(user_id: str, request: Request):
user = await request.app.state.users.get_user_by_id(user_id)
return user
app_dependency = Depends(get_app)
user_dependency = Depends(get_user_by_id)
| Feraclin/MusicConvertor | api/app/api_v1/deps.py | deps.py | py | 318 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "fastapi.Request",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "fastapi.Request",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "fastapi.Depends",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "fastapi.Depends",
"... |
45551292 | import datetime
import json
import urllib.request
from typing import Generator
from bs4 import BeautifulSoup
brand_home_url = 'https://www.manualslib.com/brand/'
base_url = 'https://www.manualslib.com'
b_url = 'https://www.manualslib.com/brand/acer/'
def make_soup(input_url):
html_headers = {'User-Agent': 'Mozil... | rfung4/manualslib | main.py | main.py | py | 3,046 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "urllib.request.request.Request",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "urllib.request.request",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "urllib.request",
"line_number": 21,
"usage_type": "name"
},
{
"api_nam... |
3264163236 | import cherrypy
import json
import os
import time
ACTIVE_TIMEOUT = 305
LOGGING_DIR = os.path.join(os.getcwd(), 'history')
class DropbloxDebugServer(object):
@cherrypy.expose
def index(self):
cherrypy.response.headers['Access-Control-Allow-Origin'] = '*'
response = {'code': 200}
if not os.path.exists(L... | shaktisingh96/digitalocean-cloudtitans | source/history_server.py | history_server.py | py | 3,045 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "os.path.join",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "os.getcwd",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "cherrypy.response",
"line_number... |
21077902710 | from os import environ
import logging
import requests
logging.basicConfig(level="INFO")
logger = logging.getLogger(__name__)
rollup_server = environ["ROLLUP_HTTP_SERVER_URL"]
logger.info(f"HTTP rollup_server url is {rollup_server}")
def handle_advance(data):
logger.info(f"Received advance request data {data}")
... | solity-research/ethIstanbul | cartesi/echo-app/dapp.py | dapp.py | py | 1,698 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logging.basicConfig",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "requests.post",
"li... |
1121064332 | '''
https://www.acmicpc.net/problem/9019
백준 9019 DSLR문제
'''
# value 'n' int register is 0~9999
# rD : n=2n (if 2n>9999 then n=2n mod 9999)
# rS : n=n-1 (if n==0 then n=9999)
# rL : n=BCDA (rotate to left)
# rR : n=DABC (rotate to right)
import sys
import collections
# n=2n (if 2n>9999 then n=2n mod 9999)
... | thdwlsgus0/algorithm_study | python/백준/9019_DSLR.py | 9019_DSLR.py | py | 2,718 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "collections.deque",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "sys.stdin.readline",
"line_number": 77,
"usage_type": "call"
},
{
"api_name": "sys.stdin",
"line_number": 77,
"usage_type": "attribute"
},
{
"api_name": "sys.stdin.readlin... |
20363573250 | #%%
import pytest
from pathlib import Path
from typing import List
import numpy as np
import sas_rmc
from sas_rmc.box_simulation import Box
from sas_rmc.controller import Controller
from sas_rmc.particles import CoreShellParticle, Dumbbell, Particle
from sas_rmc.scattering_simulation import ScatteringSimulation
from... | lestercbarnsley/SasRMC | tests/simulation_test.py | simulation_test.py | py | 23,983 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.pi",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "sas_rmc.shapes.Cube",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "sas_rmc.shapes",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "sas_rmc.shapes.Cube"... |
7287787108 | import numpy as np
import scipy.optimize as opt
import scipy.io as sio
from scipy.spatial import cKDTree
import matplotlib as mpl
mpl.use('TkAgg') # or whatever other backend that you want
import matplotlib.pyplot as plt
import time
from extra import *
from solve_torch import *
#Choose size of functional maps
n_vecs... | JM-data/PyFuncMap | tmp/example.py | example.py | py | 3,162 | python | en | code | 5 | github-code | 6 | [
{
"api_name": "matplotlib.use",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "scipy.io.loadmat",
"line_number... |
15747463272 | import numpy as np
import pandas as pd
import scipy.linalg
from scipy import special
class simpleEDMD:
"""
simpleEDMD(X, Y, dictionary_strategy)
A class represents a simple EMDM algorithm
Parameters
----------
X : np.ndarray
input data at time t in [M, N] format, whe... | ge96rox/MLCMS-Final | src/simpleEDMD.py | simpleEDMD.py | py | 4,695 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.linalg.pinv",
"line_number": 76,
"usage_type": "call"
},
{
"api_name": "numpy.linalg",
"line_number": 76,
"usage_type": "attribute"
},
{
"api_name": "numpy.linalg.pinv",
"line_number": 80,
"usage_type": "call"
},
{
"api_name": "numpy.linalg",
... |
18959328697 | import math
from dotmap import DotMap
from src.configuration.configuration import DISPLAY_HEIGHT, DISPLAY_WIDTH, GLOBAL_OBJECT_SIZE, TILE_BUFFER
SAFE_SPACE_IN_TILES = 2
SAFE_SPACE_IN_PIXELS = SAFE_SPACE_IN_TILES * GLOBAL_OBJECT_SIZE
BUFFERED_SAFE_SPACE_IN_PIXELS = (SAFE_SPACE_IN_TILES + TILE_BUFFER) * GLOBAL_OBJECT_SI... | IsaacSmith13/zegend-of-lelda | src/objects/camera.py | camera.py | py | 3,534 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "src.configuration.configuration.GLOBAL_OBJECT_SIZE",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "src.configuration.configuration.TILE_BUFFER",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "src.configuration.configuration.GLOBAL_OBJECT_SIZE",... |
27094819434 | from pathlib import Path
import torchvision
from pyspark.sql import SparkSession
from rikai.spark.functions import to_image
def test_resnet(spark: SparkSession):
spark.udf.register("to_image", to_image)
work_dir = Path().absolute().parent.parent
image_path = f"{work_dir}/python/tests/assets/test_image.j... | World-shi/rikai | experimental/torchhub/tests/test_resnet.py | test_resnet.py | py | 841 | python | en | code | null | github-code | 6 | [
{
"api_name": "pyspark.sql.SparkSession",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "rikai.spark.functions.to_image",
"line_number": 10,
"usage_type": "argument"
},
{
"api_name": "pathlib.Path",
"line_number": 11,
"usage_type": "call"
},
{
"api_name"... |
31605680322 | #!/usr/bin/python
import io
import re
from bs4 import BeautifulSoup
def filter_non_printable(str):
return ''.join([c for c in str if ord(c) > 31 or ord(c) == 9])
def scrapData( theDir, listing, listingn, bVerbose ):
#import urllib2
#listing = '4719629';
#response = urllib2.urlopen('https://www.ai... | mobilelifecenter/simpleScrepper | code/simpleScraper.py | simpleScraper.py | py | 24,425 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "bs4.BeautifulSoup",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "io.open",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "re.search",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "re.findall",
"line_number": 5... |
34385604325 | # encoding: utf-8
import os,sys
curPath = os.path.abspath(os.path.dirname(__file__))
sys.path.append(curPath)
import numpy, pygame
import Chessboard
class Gomoku():
def __init__(self):
self.screen = pygame.display.set_mode((800, 600))
pygame.display.set_caption("五子棋")
self.cloc... | youki-cao/Gomoku-AI | Code_AI_Gomoku/gomoku.py | gomoku.py | py | 2,491 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.path.abspath",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "sys.path.append",
"line... |
22394106302 | import smtplib
from email.mime.text import MIMEText
from email.header import Header
# smtpserver = 'imap.139.com'
# user='13515260240@139.com'
# password='Q973906567QPP,'
# sender='13515260240@139.com'
# receivers='973906567@qq.com'
# subject='hhhh'
# msg=MIMEText('<html><h1>love you</h1></html>','html','utf-8')
# msg... | fbb973906567/emailpython | email1.py | email1.py | py | 1,067 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "email.mime.text.MIMEText",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "email.header.Header",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "email.header.Header",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "emai... |
75136416827 | import random
import tgalice
import yaml
from tgalice.cascade import Pr
from cascade import csc, Turn
with open('texts/lifehacks.yaml', 'r', encoding='utf-8') as f:
HACKS = yaml.safe_load(f)
MENU_SUGGESTS = ['тренировка', 'правила', 'лайфхаки', 'разминка', 'противопоказания', 'результаты']
def is_first_turn(... | avidale/alice-stretching | scenarios/menu.py | menu.py | py | 9,221 | python | ru | code | 1 | github-code | 6 | [
{
"api_name": "yaml.safe_load",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "cascade.Turn",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "tgalice.SOURCES",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "cascade.Turn",
"... |
25006228065 | """
Utilities for working with bam files
"""
import math
import pysam
import logging
from collections import Counter
from helpers import Window, Observation, DUMMY_ID
from helpers import add_window_observation
from exceptions import FullWindowException
from exceptions import Error
DUMMY_BASE = "*"
def extract_windows... | DENE-dev/dene-dev | RQ1-data/exp2/582-pockerman@hidden_markov_modeling-ded17a7966e5c7521820e2b394af19c0874040e1/bam_helpers.py | bam_helpers.py | py | 18,414 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pysam.FastaFile",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "pysam.AlignmentFile",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "exceptions.Error",
"line_number": 125,
"usage_type": "call"
},
{
"api_name": "exceptions.Erro... |
5697749741 | import tkinter as tk
from tkinter import messagebox
import openai
import threading
import configparser
from tkinter import filedialog
import os
import sys
# Create a new ConfigParser object
config = configparser.ConfigParser()
# Get the path of the .exe file
exe_path = os.path.dirname(sys.executable)
# Read the conf... | djshin443/lblm | chatapp/Chatapp.py | Chatapp.py | py | 7,402 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "configparser.ConfigParser",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "sys.executable... |
43327422567 | #! C:\Users\Vincci\PycharmProjects\detr-main_redownload\venv\Scripts\python.exe
from engine import evaluate
from main import get_args_parser
import torch
from torch import nn
import datasets
from datasets import build_dataset, get_coco_api_from_dataset
from torch.utils.data import DataLoader, DistributedSampler
... | Himwong113/Comp5113 | Finial_ver1_20231124/SVM_box_ver2.py | SVM_box_ver2.py | py | 5,866 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "torch.set_grad_enabled",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "util.box_ops.box_cxcywh_to_xyxy",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "torch.tensor",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "t... |
4487131266 | import json
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
radius = 1775
semilength=4050
filter = 'rel_tof'
file_in = f'./data/clean/photon_df.xlsx'
width=4.99045323E-16 #particle decay width
hbar=6.582119514*10**(-25) #GeV*s
lifetime = (10**9)*hbar/width
print(f'lifetime of the heavy neutrino... | CrisManrique9910/2022_LLHN_CONCYTEC | scripts/clustering_photons.py | clustering_photons.py | py | 4,940 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pandas.read_excel",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "numpy.abs",
"line_numbe... |
21613107794 | #! /usr/bin/python
# -*- coding: utf-8 -*-
# This file belongs to DWGranularSpeckles project.
# The software is realeased with MIT license.
import math
import numpy as np
import os
from PIL import Image
import matplotlib.pyplot as plt
import multiprocessing
import itertools
from functools import partial
from granular_s... | cocconat/granular_speckles | granular_speckles/matrix.py | matrix.py | py | 7,940 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.all",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "numpy.argmax",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "numpy.max",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "numpy.asarray",
"line_number": 3... |
26138613201 | from flask import Flask, request, jsonify, render_template, make_response, Response
from flask_sqlalchemy import SQLAlchemy
from flask_marshmallow import Marshmallow
from slackclient import SlackClient
import json
import os
app = Flask(__name__)
basedir = os.path.abspath(os.path.dirname(__file__))
# app.config['SQLAL... | trungtx92/Dhihub | BackEnd/main.py | main.py | py | 12,364 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path.abspath",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_num... |
41550817454 | import functools
from ...drivers.channel_order import ChannelOrder
USAGE = """
A ChannelOrder can be initialized with:
* A list, tuple or string of length three: '012', 'bgr', (0, 2, 1)
* An integer from 0 to 5."""
NAMES = {
'r': 0,
'g': 1,
'b': 2,
'R': 0,
'G': 1,
'B': 2,
'0': 0,
'1':... | ManiacalLabs/BiblioPixel | bibliopixel/project/types/channel_order.py | channel_order.py | py | 785 | python | en | code | 263 | github-code | 6 | [
{
"api_name": "functools.singledispatch",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "drivers.channel_order.ChannelOrder.ORDERS.index",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "drivers.channel_order.ChannelOrder.ORDERS",
"line_number": 35,
... |
8930564727 | #!/usr/bin/env python3
#-*- coding: utf-8 -*-
# Import the required Python modules and Flask libraries
from flask import Flask
from flask import render_template
from flask_pymongo import PyMongo
from flask_googlemaps import GoogleMaps
from flask_googlemaps import Map
from flask_mongoengine.wtf import model_form
from f... | Aswathymur/A1MelLocal | flask-mongodb/mongo_connect.py | mongo_connect.py | py | 7,623 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "flask_googlemaps.GoogleMaps",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "pymongo.MongoClient",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "flask.ren... |
43320156877 | import joblib,os,time
import pandas as pd
import numpy as np
from sklearn.metrics import accuracy_score
from sklearn.model_selection import train_test_split,KFold,cross_val_score
from sklearn.metrics import confusion_matrix
import seaborn as sns
import matplotlib.pyplot as plt
def preview_dataframe(df,data):
prin... | hoangvu1806/Disease-Symptom-Prediction | predict.py | predict.py | py | 10,377 | python | vi | code | 1 | github-code | 6 | [
{
"api_name": "pandas.read_csv",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "pandas.Series",
"line_n... |
5611492087 | import spacy
nlp = spacy.load("en_core_web_sm")
#Getting txt tokenised
f = open("Converted.txt", "r", encoding="utf-8")
text = f.read()
doc = nlp(text)
columns =3
rows=500
entities = [[0 for x in range(columns)] for x in range(rows)]
for ent in doc.ents:
for i in range(rows):
if entities[i][0] == 0:
... | Louis-Risbridger/PDF-to-extracted-data | PDF Extraction/TexttoEntities.py | TexttoEntities.py | py | 886 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "spacy.load",
"line_number": 2,
"usage_type": "call"
}
] |
42323197259 | from flask_app import app
from flask import render_template, request, redirect, flash, session
from flask_app.models.hemogram import Hemogram
from flask_app.models.leukocyte_form import Leukocyte_form
from flask_app.models.user import User
import pymysql
db = pymysql.connect(host = 'localhost', user = 'root', password ... | brxndxz/lab_project | flask_app/controllers/lab_tests.py | lab_tests.py | py | 6,926 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pymysql.connect",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "flask.session",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "flask.flash",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "flask.redirect",
"line_n... |
31126534833 | from event_emitter_asyncio.EventEmitter import EventEmitter
import asyncio
import time
from Motors.motors import motors
class Encoder(EventEmitter):
def __init__(self,motor,name):
super().__init__()
self.motor = motor
self.count = 0
self.time_interval = 0
self.speed = 0
self.previous_count ... | gregorianrants/technic-bot | technic/Encoders/Encoder.py | Encoder.py | py | 1,249 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "event_emitter_asyncio.EventEmitter.EventEmitter",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "time.time",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "asyncio.sleep",
"line_number": 42,
"usage_type": "call"
}
] |
36066590773 | from django import template
from quokka.models import Question, Answer, Vote
import django.template.defaultfilters
register = template.Library()
@register.simple_tag
def get_vote_count(answer_id, votes):
count = 0
for vote in votes:
if vote.answer.id == answer_id:
if vote.score == 1:
count += 1
elif vot... | cassiebrooks/itech | quokka/templatetags/quokka_extras.py | quokka_extras.py | py | 1,162 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.template.Library",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "django.template",
"line_number": 5,
"usage_type": "name"
}
] |
3831263657 | import os
from WindPy import w
from tools.log.log_util import addlog, log
def logon_wind():
start_ret = w.start()
if start_ret.ErrorCode != 0:
log.info("Start failed")
log.info("Error Code:" + str(start_ret.ErrorCode))
log.info("Error Message:" + start_ret.Data[0])
raise Conn... | charliedream1/ai_quant_trade | quant_brain/data_io/wind/account_login.py | account_login.py | py | 1,543 | python | en | code | 710 | github-code | 6 | [
{
"api_name": "WindPy.w.start",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "WindPy.w",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "tools.log.log_util.log.info",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "tools.log.log_util.... |
8102125499 | from rest_framework import generics
from rest_framework.permissions import IsAuthenticated
from habits.models import Habit, RelatedHabit
from habits.paginators import HabitPaginator
from habits.permissions import IsOwner
from habits.serializers import HabitSerializer, RelatedHabitSerializer
class HabitCreateAPIView(g... | violetta-p/course_7 | habits/views.py | views.py | py | 2,388 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "rest_framework.generics.CreateAPIView",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.generics",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "habits.serializers.HabitSerializer",
"line_number": 10,
"usage_type": "n... |
3378867524 | import sqlite3
import scipy.io
import os
import json
def getMafa(NFile = 100):
matFile = os.path.join(os.getcwd(), "DATASET", "LABEL", "LabelTrainAll.mat")
trainMatMafa = scipy.io.loadmat(matFile)
DictJson = {}
MaffaRootArray = trainMatMafa['label_train'][0]
numFile = 0
for data in MaffaRootAr... | reynaldiRepo/MCRCNN_FaceMaskDetection | DataReader.py | DataReader.py | py | 3,387 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "os.path.join",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "os.getcwd",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "scipy.io.io.loadmat",
"line_numb... |
14963659187 | import requests
import os
import json
import settings
import re
import emoji
# To set your environment variables in your terminal run the following line:
# export 'BEARER_TOKEN'='<your_bearer_token>'
bearer_token = settings.bt
search_url = "https://api.twitter.com/2/tweets/search/recent"
def bearer_oauth(r):
"""... | hikahana/lt-chill | twitter-py/recent-get.py | recent-get.py | py | 2,469 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "settings.bt",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "requests.get",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number... |
3018665760 | from SubNode import SubNode
from itertools import combinations
class SubGraph:
def __init__(self, num_nodes):
self.nodes = []
for i in range(num_nodes):
node = SubNode(i+1)
self.nodes.append(node)
for node1, node2 in combinations(self.nodes, 2):
node1.a... | staveesh/measurement-scheduler | SubGraph.py | SubGraph.py | py | 429 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "SubNode.SubNode",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "itertools.combinations",
"line_number": 12,
"usage_type": "call"
}
] |
5773911715 | import operator
import os
import cocotb
from cocotb.clock import Clock
from cocotb.triggers import RisingEdge, Timer
from tests.common import check_value
from tests.multi_cycle_cpu.common import datapath_tests, memory_tests, register_tests
from tests.multi_cycle_cpu.common.dut import reset_dut
from tests.multi_cycle_... | ljhahne/multi_cycle_riscv_cpu | tests/multi_cycle_cpu/datapath/datapath/datapath_cocotb.py | datapath_cocotb.py | py | 12,677 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "tests.multi_cycle_cpu.models.output_logic",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "tests.multi_cycle_cpu.models.alu_control",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "tests.multi_cycle_cpu.models.opb5",
"line_number": 43,
... |
16400172869 | import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
a,b,c,d = 1,2,3,4
x = np.linspace(-2.9,12,50)
y = np.linspace(4.2,5.7,50)
x1,x2 = np.meshgrid(x,y)
Z = 21.5 + x1 * np.sin(4*np.pi*x1) + x2 * np.sin(20*np.pi*x2)
fig = plt.figure()
ax = plt.axes(projection='3d')
surf = ax.plo... | kasanatte/ComputeDesign | Task05/demo.py | demo.py | py | 363 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.linspace",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.linspace",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.meshgrid",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.sin",
"line_numb... |
16328379532 | import unittest
import six
from example_tests import example_test
from cupy import testing
class TestBlackScholes(unittest.TestCase):
def test_black_scholes(self):
output = example_test.run_example(
'finance/black_scholes.py', '--n-options', '10')
six.assertRegex(
self,... | hknerdgn/cupy | tests/example_tests/test_finance.py | test_finance.py | py | 1,939 | python | en | code | null | github-code | 6 | [
{
"api_name": "unittest.TestCase",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "example_tests.example_test.run_example",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "example_tests.example_test",
"line_number": 13,
"usage_type": "name"
},
... |
10663239464 | # -*- coding: utf-8 -*-
"""
Created on Tue Oct 22 17:10:35 2019
@author: LocalAdmin
Curve fitting script
"""
import os
import math as m
import numpy as np
import matplotlib.pyplot as plt
from scipy.optimize import curve_fit
import instrument_module as instr
def negative_exponent(x, a, b, c):
return a*1E7 * np.e... | rehogenbirk/MEP_control_software | curve_fitting_script.py | curve_fitting_script.py | py | 2,255 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.exp",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.exp",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.log",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 34,
... |
70704100028 | from . import views
from django.urls import path
from .views import (
AddSong,
MusicList,
HomeView,
SongDetail,
DeleteSong,
EditSong
)
urlpatterns = [
path("", HomeView.as_view(), name="home"),
path("add_song/", AddSong.as_view(), name="add_song"),
path("songs", MusicList.as_view()... | StaffanHynge/Music-Maker | songs/urls.py | urls.py | py | 545 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.urls.path",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "views.HomeView.as_view",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "views.HomeView",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "django.urls.pa... |
410842461 | from typing import Callable, Tuple
import jax
import jax.numpy as jnp
from numpy.typing import ArrayLike
from bayesian_sde_solver.utils.insert import insert
from bayesian_sde_solver.utils.progress_bar import progress_bar
def sde_solver(
key,
drift: Callable,
sigma: Callable,
x0: Arra... | hallelujahylefay/bayesianSDEsolver | bayesian_sde_solver/ssm_parabola/ssm_parabola_ode.py | ssm_parabola_ode.py | py | 1,444 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "typing.Callable",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "typing.Callable",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "numpy.typing.ArrayLike",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "jax.random.spl... |
8488159262 | import dash
import dash_html_components as html
import dash_core_components as dcc
import plotly.graph_objs as go
import dash_bootstrap_components as dbc
from utils import dict_main
data = list(dict_main.keys())
channels = dict_main[data[0]]
app = dash.Dash(__name__)
app.title = 'InsuGuard App'
app.colors = {'backgro... | mtfaye/InsuGuard | app.py | app.py | py | 4,751 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "utils.dict_main.keys",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "utils.dict_main",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "utils.dict_main",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "dash.Dash",
"li... |
19687261479 | from flask import Blueprint, current_app, request, abort
from linebot.exceptions import InvalidSignatureError
from application.linebot.webhook_handler import handler
line_callback = Blueprint('callback', __name__)
@line_callback.route("/callback", methods=['POST'])
def callback():
signature = request.headers['X-... | lahdjirayhan/drive-kesma-library-linker | application/linebot/routes.py | routes.py | py | 610 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.Blueprint",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "flask.request.headers",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "flask.request... |
71743707069 | import torch
import torch.nn as nn
import torch.nn.functional as F
import extractors
class SeparableBlock(nn.Module):
def __init__(self, in_chan, out_chan, kernel_size=3, stride=1, padding=1):
super(SeparableBlock, self).__init__()
self.depth_wise_conv = nn.Conv2d(in_chan, in_chan, kernel_size=kern... | gdjmck/FaceAssessment | model.py | model.py | py | 2,680 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "torch.nn.Module",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "torch.nn.Conv2d",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_numbe... |
20519461400 | """!
@brief Cluster generator.
@authors Andrei Novikov (pyclustering@yandex.ru)
@date 2014-2020
@copyright BSD-3-Clause
"""
import collections.abc
import random
class data_generator:
"""!
@brief Data generator provides services to generate data with clusters with normal distribution.
... | annoviko/pyclustering | pyclustering/cluster/generator.py | generator.py | py | 3,475 | python | en | code | 1,113 | github-code | 6 | [
{
"api_name": "collections.abc.abc",
"line_number": 40,
"usage_type": "attribute"
},
{
"api_name": "collections.abc",
"line_number": 40,
"usage_type": "name"
},
{
"api_name": "collections.abc.abc",
"line_number": 44,
"usage_type": "attribute"
},
{
"api_name": "col... |
767703239 | # -*- coding: utf-8 -*-
# only used for testing
import cv2
from pathlib import Path
import os
import numpy as np
import funs.utils as utils
from funs.grdOpt import AbnFea, AbnDetDic, AbnMapFilter,AbnRoc, AbnGt, GridOptFlow, AbnShw1Map, AbnCmbMaps, onlineBg, cmb2kindMapDic
import matplotlib.pyplot as plt
from funs.grdOp... | limax2008/pub_PramidGrdTmp | tst_one.py | tst_one.py | py | 4,104 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "funs.rdConfig.config",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.load",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "numpy.unique",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line... |
1798355332 | import tkinter as tk
import json
from windows.GameWindow import GameWindow
from windows.SettingsWindow import SettingsWindow
class App(tk.Tk):
SCREEN_HEIGHT_MENU_OFFSET = 34
SCREEN_WIDTH_MENU_OFFSET = 4
MIN_GRID_WIDTH = 2
MIN_GRID_HEIGHT = 2
MAX_GRID_WIDTH = 200
MAX_GRID_HEIGHT = 200
MI... | Akoens/PyGOL | main.py | main.py | py | 2,226 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "tkinter.Tk",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "windows.GameWindow.GameWindow",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "windows.SettingsWindow.SettingsWindow",
"line_number": 28,
"usage_type": "name"
},
{
... |
44432299784 | import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import torch.nn as nn
import gc
from scipy.stats import qmc
import time
class TransNet(object):
def __init__(self, x_dim, basis_num, include_const=True, nlin_type='tanh'):
self.x_dim = x_dim
self.include_const = include_const
... | zezhongzhang/TransNet | portable_version/NS_cylinder_v2_col.py | NS_cylinder_v2_col.py | py | 20,930 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "numpy.array",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.random.randn",
"line_number": 67,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 67,
"usage_type": "attribute"
},
{
"api_name": "numpy.sqrt",
"li... |
32206793101 | import os.path as osp
import pickle
import shutil
import tempfile
import numpy as np
import time
import mmcv
import torch
import torch.distributed as dist
from mmcv.runner import get_dist_info
CLASS_INDEX = '/home/oem/mmaction2/mmaction/apis/17c.txt'
def single_gpu_test(model, data_loader):
"""Test model with a... | Ultraman82/NIA_action_recognition | mmaction/apis/test.py | test.py | py | 8,023 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "mmcv.ProgressBar",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "torch.no_grad",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "time.localtime",
"line... |
19345141833 | from abc import ABC, abstractmethod
# Import necessary libraries and modules
import pygame
from constants import *
import numpy as np
from animation import Animator
import random
# Define some constant values
BASETILEWIDTH = 16
BASETILEHEIGHT = 16
DEATH = 5
class Sprite(ABC):
@abstractmethod
def getImage(sel... | DavidSatria29/Game_PAK-MAN | sprites.py | sprites.py | py | 11,226 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "abc.ABC",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "abc.abstractmethod",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "pygame.image.load",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "pygame.image",
"line... |
33917740812 | from datetime import datetime, timedelta
from celery import shared_task
from flask import current_app
from invenio_db import db
from invenio_workflows import Workflow
@shared_task
def delete_old_workflows():
days = current_app.config.get('DELETE_WORKFLOWS_OLDER_THEN_DAYS', 60)
date_to = datetime.now() - time... | SCOAP3/scoap3-next | scoap3/modules/workflows/tasks.py | tasks.py | py | 805 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "flask.current_app.config.get",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "flask.current_app.config",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "flask.current_app",
"line_number": 11,
"usage_type": "name"
},
{
"api_... |
72126795707 | from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.by import By
from selenium.common.exceptions import NoSuchElementException
import csv
import re
options = Options()
options.add_argument('--headless')
driver = webdriver.Chrome(options=options)
page = 1
... | RodrigoLucas1707/desafio-webscraper | webscraper.py | webscraper.py | py | 1,779 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "selenium.webdriver.chrome.options.Options",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 10,
"usage_type": "name"
},
{
... |
13864675823 | #!/usr/bin/python3.5
# -*-coding:Utf-8 -*
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler
# Getting data
data_file = pd.read_csv('https://archive.ics.uci.edu/ml/machine-learning-databases/wine/w... | PiggyGenius/MachineLearning | NoLibraries/LinearDiscriminantAnalysis/lda.py | lda.py | py | 3,905 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pandas.read_csv",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.StandardScaler",
"line_number": 18,
"usage_type": "call"
... |
15484036880 | import email
from unicodedata import name
from django.db import models
from django.forms import CharField, ImageField, Textarea
from django.contrib.auth.models import User
# Create your models here.
class StartUp(models.Model):
name = models.CharField(max_length=20)
info = models.TextField()
fund_req = mod... | ganupadval/FundRaiser | cover/models.py | models.py | py | 952 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.db.models.Model",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "unicodedata.name",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "django.db.... |
21924854636 | #!/usr/bin/env python
# coding: utf-8
# In[ ]:
import io
import datetime
import csv
from google.cloud import storage
from google.cloud.storage import Blob
def hello_gcs(event, context):
"""Triggered by a change to a Cloud Storage bucket.
Args:
event (dict): Event payload.
context (google.... | Nithyanandasagarj/GCP-case-study | raw_to_cleansed.py | raw_to_cleansed.py | py | 1,678 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "google.cloud.storage.Client",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "google.cloud.storage",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "csv.reader",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "io.String... |
16682122527 | import os
import os.path
import subprocess
import sys
import tempfile
def getenv(name, default=None):
if name in os.environ:
return os.environ[name]
if default is None:
print("Environment variable", name, "is not set", file=sys.stderr)
exit(1)
return default
FUNC_EXECUTABLE = geten... | ton-blockchain/ton | crypto/func/auto-tests/run_tests.py | run_tests.py | py | 3,678 | python | en | code | 2,081 | github-code | 6 | [
{
"api_name": "os.environ",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "sys.stderr",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "tempfile.mkdtemp",
... |
30781967345 | import json
import openai
from rest_framework import generics, status, parsers, renderers
from rest_framework.views import APIView
from rest_framework.decorators import api_view, renderer_classes
from rest_framework.response import Response
from rest_framework.renderers import JSONRenderer
from django.http import Str... | shrikale32/chatwithdocsbe | file_upload_chat/api/views.py | views.py | py | 6,752 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "rest_framework.generics.ListCreateAPIView",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.generics",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "file_upload_chat.models.Chat.objects.all",
"line_number": 25,
"usa... |
8068296061 | from __future__ import annotations
from typing import Optional, Union, Dict, Any
import pathlib
import torch
import torch.nn as nn
from dataclasses import dataclass
from omegaconf import DictConfig
import datetime
import logging
import omegaconf
import glob
import dotenv
import os
from rigl_torch.rigl_scheduler import... | calgaryml/condensed-sparsity | src/rigl_torch/utils/checkpoint.py | checkpoint.py | py | 7,837 | python | en | code | 10 | github-code | 6 | [
{
"api_name": "dotenv.load_dotenv",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pathlib.Path.cwd",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "omegaconf.DictC... |
4302261135 | import sys
import pandas as pd
from sqlalchemy import create_engine
import numpy as np
import re
import nltk
nltk.download('punkt')
nltk.download('stopwords')
nltk.download('wordnet')
from nltk.tokenize import word_tokenize
from nltk.corpus import stopwords
from nltk.stem.wordnet import WordNetLemmatizer
from sklearn.p... | denizcanyldrm/Disaster-Response-Pipeline-Project | models/train_classifier.py | train_classifier.py | py | 5,237 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "nltk.download",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "nltk.download",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "nltk.download",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.create_engine",
... |
25262716875 | from google.appengine.ext import ndb
class KeyValueCache(ndb.Model):
"""Data cached that doesn't require a separate model.
Attributes:
recorded_dt: DateTime, time of insertion.
value: Text, value inserted.
"""
recorded_dt = ndb.DateTimeProperty(auto_now_add=True)
value = ndb.JsonProperty()
| google/upvote_py2 | upvote/gae/datastore/models/cache.py | cache.py | py | 312 | python | en | code | 449 | github-code | 6 | [
{
"api_name": "google.appengine.ext.ndb.Model",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "google.appengine.ext.ndb",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "google.appengine.ext.ndb.DateTimeProperty",
"line_number": 11,
"usage_type": "... |
21804891349 | import numpy as np
import matplotlib.pyplot as plt
from scipy.io.wavfile import read, write
from numpy.fft import fft, ifft
from scipy import signal
FRAME_SIZE = 1024
ZP_FACTOR = 2
FFT_SIZE = FRAME_SIZE * ZP_FACTOR
################## YOUR CODE HERE ######################
def ece420ProcessFrame(frame):
curFft = np... | katherineyun/ECE420 | lab3/lab3.py | lab3.py | py | 1,096 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.zeros",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "scipy.signal.hamming",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "scipy.signal",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "numpy.fft.fft",
"li... |
17193747083 | import datetime
import gensim.downloader as api
import io
import json
import math
import nltk
import numpy as np
import os
import pandas as pd
import pdfminer
import pickle
import PyPDF2
import re
import sys
import pdfrw
import textract
import tldextract
import traceback
from collections import Counter
from nltk impor... | manuel-lang/Autonomous-Semantic-Search-Engine | backend/process.py | process.py | py | 18,604 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "re.findall",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "sklearn.base.BaseEstimator",
"line_number": 43,
"usage_type": "name"
},
{
"api_name": "numpy.array",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "nltk.tokenize.word_... |
8035063730 | import numpy as np
import matplotlib.pyplot as plt
from sklearn.linear_model import Ridge, RidgeCV # Ridge岭回归,RidgeCV带有广义交叉验证的岭回归
from sklearn.linear_model import Lasso, LassoCV, LassoLarsCV # Lasso回归聚类分析的方法对数据进行离散化,并对相关代码进行分析,绘出结果。
# 样本数据集,第一列为x,第二列为y,在x和y之间建立回归模型
data = [
[0.067732, 3.176513], [0.427810, 3.8... | Zichuana/Python-Data-analysis-and-mining-practice-Data | test/lasso_ridge.py | lasso_ridge.py | py | 4,326 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.array",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "sklearn.linear_model.Ridge",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "sklearn.linear_model.RidgeCV",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "m... |
7156687336 | #!/usr/bin/python
import apt_inst
from debian import deb822
import os
from pprint import pprint
import json
package_dict = dict()
package_dir = '../sample_packages/'
#structue is like ['package_name'] = [{package_1_control_dict},{package_2_control_dict}]
for package in os.listdir(package_dir):
#still need t... | Harsh1-1/internalrepo-package_management | extract_control_information.py | extract_control_information.py | py | 1,171 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.listdir",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "apt_inst.DebFile",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "debian.deb822.Deb822",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "debian.deb822",
... |
6953694486 | import abc
import functools
import itertools
from collections import defaultdict
from datetime import datetime
from typing import Dict, Generic, Iterable, List, NamedTuple, Optional, Tuple, TypeVar
class _Coords3D(NamedTuple):
z: int
y: int
x: int
class _Coords4D(NamedTuple):
w: int
z: int
y... | smetanin-av/advent_of_code | 2020/task_17/task_17.py | task_17.py | py | 6,197 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "typing.NamedTuple",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "typing.NamedTuple",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "typing.TypeVar",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "abc.ABC",
"line... |
27301155840 | # -----------------------------------------------------------------------------------------------------------------------
# Creado 12/05
# Última actualizacion
# Nombre: Juanjo
# -----------------------------------------------------------------------------------------------------------------------
# location =
# env = ... | juanjo-lab/tfg_deep_learning | Notebooks___________________________/Re_Entre_red.py | Re_Entre_red.py | py | 13,352 | python | es | code | 0 | github-code | 6 | [
{
"api_name": "datetime.datetime.now",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "datetime.datetime.now",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "da... |
34042215074 | import os
from setuptools import setup
from pybind11.setup_helpers import Pybind11Extension, build_ext
FILE_DIR = os.path.dirname(os.path.abspath(__file__))
VERSION = '1.0.1'
ext_modules = [
Pybind11Extension('mapbox_earcut',
['src/main.cpp'],
include_dirs=['include'],
define_macros = [('... | skogler/mapbox_earcut_python | setup.py | setup.py | py | 1,250 | python | en | code | 33 | github-code | 6 | [
{
"api_name": "os.path.dirname",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pybind11.setup_helpers.Pybi... |
74197332989 | from django.contrib.auth.models import Group, User
from django.db import models
from django.db.models.signals import post_save
from django.dispatch import receiver
class Profile(models.Model):
class Meta:
verbose_name_plural = "profile"
user = models.OneToOneField(User, on_delete=models.CASCADE)
... | linea-it/pzserver_app | backend/core/models/user_profile.py | user_profile.py | py | 1,538 | python | en | code | 5 | github-code | 6 | [
{
"api_name": "django.db.models.Model",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.db.models.OneToOneField",
"line_number": 11,
"usage_type": "call"
},
{
"api_nam... |
27408002568 | """Tests the xonfig command.
Actually, just a down payment on a full test.
Currently exercises only these options:
- xonfig info
- xonfig jupyter_kernel
"""
import io
import json
import os
import re
import sys
import pytest # noqa F401
from xonsh.tools import ON_WINDOWS
from xonsh.webconfig import main ... | sudojarvis/xonsh | tests/test_xonfig.py | test_xonfig.py | py | 5,585 | python | en | code | null | github-code | 6 | [
{
"api_name": "pytest.raises",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "xonsh.xonfig.xonfig_main",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "re.MULTILINE",
... |
5128556456 | import requests
Ticket_id = "1234"
subdomain = "company"
url = f"https://{subdomain}.zendesk.com/api/services/jira/links/?ticket_id={Ticket_id}"
payload = ""
headers = {
'Authorization': ' '
}
response = requests.get(url, headers=headers, data=payload)
print(response.text)
| tokoyamy/automacao-Zendesk-Task_Jira | Queries/Zendesk/consult_task_link.py | consult_task_link.py | py | 283 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 13,
"usage_type": "call"
}
] |
71054349628 | import datetime
from haystack import indexes
from .models import Lot
class LotIndex(indexes.SearchIndex, indexes.Indexable):
text = indexes.CharField(
document=True,
use_template=True,
)
author = indexes.CharField(
model_attr='author'
)
def get_model(self):
retur... | CH1979/turkey | market/search_indexes.py | search_indexes.py | py | 326 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "haystack.indexes.SearchIndex",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "haystack.indexes",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "haystack.indexes.Indexable",
"line_number": 8,
"usage_type": "attribute"
},
{
"a... |
73116212989 | from datetime import datetime, timezone
import pytest
from mock import ANY
from phenoback.functions import documents
from phenoback.utils import firestore as f
@pytest.fixture
def doc_nots():
f.write_document("collection", "doc_id", {"data": "some data"})
return ("collection", "doc_id")
@pytest.fixture
de... | globe-swiss/phaenonet-functions | test/functions/test_documents.py | test_documents.py | py | 5,115 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "phenoback.utils.firestore.write_document",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "phenoback.utils.firestore",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "pytest.fixture",
"line_number": 10,
"usage_type": "attribute"
},
{... |
73944979068 | import json
import logging
import time
import boto3
import uuid
import requests
logger = logging.getLogger(__name__)
def transcode_aws(s3_file_name):
transcribe = boto3.client('transcribe')
job_name = str(uuid.uuid4())
job_uri = "https://s3-us-east-1.amazonaws.com/cconnon-410-videos/{}".format(
... | colanconnon/cs410project | cs410videosearchengine/videosearchengine/video_transcode.py | video_transcode.py | py | 2,099 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "boto3.client",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "uuid.uuid4",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_num... |
32683977646 | from datasource.models import Complaint
from rest_framework import serializers
class ComplaintSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Complaint
fields = ('record_number', 'record_type', 'record_type_map', 'record_type_desc', 'description',
'open_da... | CodyPitts/api-demo-project | api/serializers.py | serializers.py | py | 540 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "rest_framework.serializers.HyperlinkedModelSerializer",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.serializers",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "datasource.models.Complaint",
"line_number": 7,
"usag... |
41749708051 | import argparse
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torchvision import datasets, transforms
from torch.optim.lr_scheduler import StepLR
import os
import torch.distributed as dist
from torch.nn.parallel import DistributedDataParallel as DDP
from socket imp... | PrincetonUniversity/multi_gpu_training | 02_pytorch_ddp/mnist_classify_ddp.py | mnist_classify_ddp.py | py | 7,084 | python | en | code | 142 | github-code | 6 | [
{
"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.Conv2d",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_nu... |
36477036358 | from ops import mlpconv, conv, batch_norm_layer, residual_block, dense_block, transition_layer
import tensorflow as tf
import numpy as np
def NIN(image, is_train, num_classes=10, reuse=False, name='NIN-cifar'):
with tf.variable_scope(name):
if reuse:
tf.get_variable_scope().reuse_varia... | PremiLabXJTLU/MinMaxObject | model.py | model.py | py | 8,937 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "tensorflow.variable_scope",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "tensorflow.get_variable_scope",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "tensorflow.get_variable_scope",
"line_number": 11,
"usage_type": "call"
},
{
... |
18891718236 | import os
import re
import matplotlib.pyplot as plt
import numpy as np
from scipy.signal import savgol_filter
from tabulate import tabulate
p = re.compile("n = ([0-9]+), thread count: ([0-9]+), time: (.*)ms")
Ys = []
X = []
N = 8000
labels = []
Pes = []
for log in os.listdir('results'):
if '.txt' not ... | RamneekSingh24/Parallel-LUD | plot.py | plot.py | py | 1,444 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "re.compile",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "re.search",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "scipy.signal.savgol_filter",
"line... |
8702242908 | # =============================================================================
# IMPORTS
# =============================================================================
import os
import pdb
import sys
import glob
from itertools import chain
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
import... | kammerje/spaceKLIP | spaceKLIP/plotting.py | plotting.py | py | 37,810 | python | en | code | 14 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "jdaviz.configs.imviz.wcs_utils.get_compass_info",
"line_number": 70,
"usage_type": "call"
},
{
... |
25837247011 | from Katana import NodegraphAPI, DrawingModule, Utils, PyXmlIO as XIO, UniqueName
import logging
import ScriptActions as SA
log = logging.getLogger('Light_AOV_X.Node')
direct = "'%s'"%('C[DSV]')
indirect = "'%s'"%('C[DSV][DSVOB].')
diffuse = "'%s'"%('C<RD>.')
specular = '"'+'%s'%("C<RS[^'coat']>.")+'"'
coat = '"'+'%s'... | SParksLz/stTools | stForKatana/SuperTools/Light_AOV_X/v1/Node.py | Node.py | py | 7,302 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "Katana.NodegraphAPI.SuperTool",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "Katana.NodegraphAPI",
"line_number": 18,
"usage_type": "name"
},
{
"api_name"... |
43632931313 |
from __future__ import division
from __future__ import absolute_import
from __future__ import print_function
import copy
from numpy.testing import assert_allclose
import torch
from allennlp.commands.train import train_model_from_file
from allennlp.common import Params
from allennlp.common.testing.test_case import A... | plasticityai/magnitude | pymagnitude/third_party/allennlp/common/testing/model_test_case.py | model_test_case.py | py | 9,757 | python | en | code | 1,607 | github-code | 6 | [
{
"api_name": "itertools.izip",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "allennlp.common.testing.test_case.AllenNlpTestCase",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "allennlp.common.Params.from_file",
"line_number": 32,
"usage_type": "ca... |
31233973432 | from fabric import Connection
from loguru import logger
import shutil
import os
import time
class TaosadapterPerftest():
def __init__(self):
self.ip = "192.168.1.85"
self.port = "22"
self.user = "root"
self.passwd = "tbase125!"
self.telnetCreateStbJmxFile... | AntarcticPresident/TDengine | tests/perftest-scripts/taosadapter_perftest/taosadapter_perftest.py | taosadapter_perftest.py | py | 10,108 | python | en | code | null | github-code | 6 | [
{
"api_name": "loguru.logger.add",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "loguru.logger",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "fabric.Connection",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "loguru.logger.error... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.