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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
10348040262 | import torch
import torch.nn as nn
from fairseq import utils
from fairseq.models import FairseqEncoder, FairseqDecoder, FairseqEncoderDecoderModel, register_model, register_model_architecture
class SimpleLSTMEncoder(FairseqEncoder):
def __init__(
self, args, dictionary, embed_dim=128, hidden_dim=128, drop... | li-aolong/TemplateGEC | fairseq-0.12.2/fairseq/models/simple_lstm.py | simple_lstm.py | py | 10,329 | python | en | code | 18 | github-code | 21 | [
{
"api_name": "fairseq.models.FairseqEncoder",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "torch.nn.Embedding",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "torch.nn.Dro... |
19589720869 | # coding=utf-8
from django.template import Library, Node, TemplateSyntaxError, Variable, resolve_variable
from django import template
register = template.Library()
@register.tag(name="editable")
def do_editable(parser, token):
"""
Make node editable for admin
Usage::
{% editable [object] %}
... | liberation/django-quickedit | quickedit/templatetags/quickedit.py | quickedit.py | py | 1,283 | python | en | code | 5 | github-code | 21 | [
{
"api_name": "django.template.Library",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "django.template",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "django.template.TemplateSyntaxError",
"line_number": 26,
"usage_type": "call"
},
{
"api_nam... |
28642275651 | from fastapi import FastAPI, Request, HTTPException
from asyncio import create_task, Task
from colorama import init as colorama_init
from json import dumps
from threading import Thread
from threading import Event
import db
from . import utils
from . import core
class ProxyFastAPI(FastAPI):
def __init__(self, *a... | ivashkoNadia/newtask | computenode/app.py | app.py | py | 3,389 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "fastapi.FastAPI",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "colorama.init",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "threading.Thread",
"line_number": 34,
"usage_type": "name"
},
{
"api_name": "threading.Event",
... |
6638395933 | import io
import pandas as pd
from pyarrow import fs
# class HDFSUtil:
# def __init__(self, node_name):
# self.client = Client(node_name, session=False, timeout=20)
#
# def read_hdfs(self, file_path):
# with self.client.read(file_path) as f:
# df = pd.read_csv(f, nrows=5)
# ... | Seceum/SeceumFL | fateflow/python/fate_flow/web_server/utils/hdfs_util.py | hdfs_util.py | py | 1,781 | python | en | code | 15 | github-code | 21 | [
{
"api_name": "pyarrow.fs.HadoopFileSystem.from_uri",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pyarrow.fs.HadoopFileSystem",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "pyarrow.fs",
"line_number": 19,
"usage_type": "name"
},
{
"... |
17732111861 | from django.db import models
from django.contrib.auth.models import User
from storages.backends.s3boto3 import S3Boto3Storage
#! tuples here
GENDER_CHOICES = (
('Male', 'Male'),
('Female', 'Female')
)
HEALTH_STATUS_CHOICES = (
('Good health', 'Good Health'),
('Needs medication', 'Needs Medication'),
... | KyleBarter/Adoptly | main_app/models.py | models.py | py | 5,551 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django.db.models.Model",
"line_number": 80,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 80,
"usage_type": "name"
},
{
"api_name": "django.db.models.ForeignKey",
"line_number": 81,
"usage_type": "call"
},
{
"api_name... |
30637650570 | """
Solution for 1273. Delete Tree Nodes
https://leetcode.com/problems/delete-tree-nodes/
"""
from collections import defaultdict
from typing import List
class Solution:
"""
Runtime: 244 ms, faster than 83.40% of Python3 online submissions for Delete Tree Nodes.
Memory Usage: 27.3 MB, less than 100.00% of Python... | KKosukeee/CodingQuestions | LeetCode/1273_delete_tree_nodes.py | 1273_delete_tree_nodes.py | py | 2,713 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "typing.List",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "collections.defaultdict",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "typing.List",
"line_number": 39,
"usage_type": "name"
},
{
"api_name": "collections.defaultdi... |
70533458932 | from curses import window
import tkinter as tk
def switch():
if button_1.cget("state") == tk.DISABLED:
button_1.config(state=tk.NORMAL)
button_1.flash()
else:
button_1.flash()
button_1.config(state=tk.DISABLED)
def mouse_over(ev):
button_1["fg"] = "green"
def mouse_out(ev)... | eferroni/python-tkinter | widgets/button_1.py | button_1.py | py | 615 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "tkinter.DISABLED",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "tkinter.NORMAL",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "tkinter.DISABLED",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "curses.... |
41921412314 | import requests
from common import config
from django.conf import settings
def send_verify_code(phone,code):
if settings.DEBUG:
print('send verify code:',phone,code)
return True
params = config.YZX_SMS_PARAMS.copy()
params['mobile'] = phone
params['param'] = code
resp = requests.p... | Hy-Oy/Swipter | libs/sms.py | sms.py | py | 495 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django.conf.settings.DEBUG",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "django.conf.settings",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "common.config.YZX_SMS_PARAMS.copy",
"line_number": 11,
"usage_type": "call"
},
{
... |
33292551277 | import numpy as np
import os
import logging
from sklearn.metrics import roc_auc_score
from sklearn.metrics import accuracy_score
def calculate_auc(target, pred):
right_index = (target != -1.)
right_target = target[right_index]
right_pred = pred[right_index]
try:
return roc_auc_score(right_ta... | heonseok/ITS | DKVMN/dkvmn_utils.py | dkvmn_utils.py | py | 1,926 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "sklearn.metrics.roc_auc_score",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "sklearn.metrics.accuracy_score",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "numpy.sum",
"line_number": 45,
"usage_type": "call"
},
{
"api_name":... |
22894186890 | import numpy as np
from astropy.io import fits, ascii
from astropy.table import Table
import fitsio
import os
def postcard_names(loc):
files = os.listdir(loc)
files = [i for i in files if '.fits' in i]
return np.array(files)
def get_headers(cards):
for i in range(len(cards)):
hdu = fits.open... | megbedell/ELLIE | make_guide.py | make_guide.py | py | 1,264 | python | en | code | null | github-code | 21 | [
{
"api_name": "os.listdir",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "astropy.io.fits.open",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "astropy.io.fits",
"lin... |
71534173174 | # importing the requests library
import requests
import pandas as pd
import time
base_url = "http://10.xx6.x03.1x1:xxx/"
## MMI geocoding prod API
endpoint = "advancedmaps/v1/geo_code"
URL = base_url + endpoint
# Importing records in batches in a dataframe
## Fetch the Customer Address column to f... | biswasum/GeoTagging | Geocode_py_chunksize.py | Geocode_py_chunksize.py | py | 1,847 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "time.time",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_n... |
4830124048 | import plotly.graph_objects as go
import RabinKarp
with open ("../../textfile/Taipei.txt", encoding="utf8") as myfile:
data=myfile.read()
wordstring = str(data)
wordstring = wordstring.lower()
wordlist = wordstring.split()
finalTEXT = " "
for i in range(len(wordlist)):
while(wordlist[i][0].isalnum()==False o... | Raihansatar/Algorithm-Assignment | ExperimentingFolder/DONE/TestingPlotly.py | TestingPlotly.py | py | 1,773 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "plotly.graph_objects.Figure",
"line_number": 64,
"usage_type": "call"
},
{
"api_name": "plotly.graph_objects",
"line_number": 64,
"usage_type": "name"
},
{
"api_name": "plotly.graph_objects.Bar",
"line_number": 64,
"usage_type": "call"
}
] |
37089515958 | from PyCommerce.models import productSpecifications
from django.http.response import JsonResponse
from django.views.decorators.csrf import csrf_exempt
from abc import ABC, abstractmethod
class ICopyProductSpecifications(ABC):
@abstractmethod
def copy_product_specifications():
pass
class CopyProductS... | abdullah-ezzat/pycommerce | api/add/copyProSpec.py | copyProSpec.py | py | 1,176 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "abc.ABC",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "abc.abstractmethod",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "PyCommerce.models.productSpecifications.objects.filter",
"line_number": 17,
"usage_type": "call"
},
{
"a... |
73525191731 | import subprocess
import random
import time
import datetime
IP = "192.168.1.11"
HTTP_PORT = 5000
MESSAGE_TYPE = 1101
samples = ["http://html5demos.com/assets/dizzy.mp4",
"https://devimages.apple.com.edgekey.net/"
+ "streaming/examples/bipbop_4x3/gear0/fileSequence0.aac",
"https://devi... | josejuansanchez/android-playground | python/exomedia_test.py | exomedia_test.py | py | 1,386 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "random.randint",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.fromtimestamp",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "datetime.dat... |
20439513474 | from BTE import *
from copy import deepcopy
import pandas as pd
import gc
from time import perf_counter, strftime,localtime
import os
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import rc
rc('font',**{'family':'sans-serif','sans-serif':['Helvetica']})
rc('text', usetex=Tru... | jderide/DeJoRo-Bilateral | Ex2/Final.py | Final.py | py | 11,713 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "matplotlib.rc",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "matplotlib.rc",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.rc",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
... |
73824979572 | import pygame
from config.config import read_config
from chunks.chunk import Chunk
from utils.utils import create_surfaces, singleton
config: dict = read_config()
@singleton
class DynamicChunk:
def __init__(self):
self._virtual_surfaces: dict[(int, int), pygame.surface.Surface] = {}
self._is_loa... | hrdasdominik/nautical-nightmares | chunks/dynamic_chunk.py | dynamic_chunk.py | py | 812 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "config.config",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "config.config.read_config",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pygame.surface",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "pygame.surf... |
20727451072 | import io
from operator import mod
import sys
_INPUT = """\
7
0 1 1 0 1 0 0
3
2 5
2 7
5 7
"""
sys.stdin = io.StringIO(_INPUT)
# --------------------------------
n = int(input())
an = list(map(int, input().split()))
q = int(input())
sums = [0]
tmp = 0
for a in an:
tmp += a if a != 0 else -1
sums.append(tmp)... | makima333/Atcoder-ganbaru | tessoku/B06.py | B06.py | py | 544 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "sys.stdin",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "io.StringIO",
"line_number": 14,
"usage_type": "call"
}
] |
7541313093 | """
URL configuration for VirtualWife project.
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/4.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='... | yakami129/VirtualWife | domain-chatbot/VirtualWife/urls.py | urls.py | py | 1,603 | python | en | code | 535 | github-code | 21 | [
{
"api_name": "drf_yasg.views.get_schema_view",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "drf_yasg.openapi.Info",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "drf_yasg.openapi",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": ... |
25284262650 | # -*- coding:utf8 -*-
import base64
import hashlib
import hmac
import time
import copy
from .utils import (HTTP_HEADER, TIME_GMT_FORMAT,
USER_AGENT)
class RequestMetaData(object):
"""
Used to generate authorization header and request url
"""
def __init__(self, access_key_id, acc... | NetEase-Cloudsearch/stream-python-sdk | stream/client/auth.py | auth.py | py | 3,929 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "copy.deepcopy",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "utils.HTTP_HEADER.DATE",
"line_number": 46,
"usage_type": "attribute"
},
{
"api_name": "utils.HTTP_HEADER",
"line_number": 46,
"usage_type": "name"
},
{
"api_name": "time.strf... |
29538790860 | #!/usr/bin/env python3
import logging
import configargparse
import redis
import backoff
from kfailb import IncidentParser
from kfailb import Incident
from kfailb import StreamEmitter
from prometheus_client import Counter
class KFailB:
"""
Downloads website data, parses it and emits transformed data.
"... | soerenschneider/kfailb-parser | kfailb/cmd.py | cmd.py | py | 4,531 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "kfailb.IncidentParser",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "logging.info",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "kfailb.StreamEmitter",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "prometheus_cl... |
25300249322 | import serial
ser = serial.Serial(
port='/dev/cu.usbmodem14521',\
baudrate=9600,\
parity=serial.PARITY_NONE,\
stopbits=serial.STOPBITS_ONE,\
bytesize=serial.EIGHTBITS,\
timeout=0) # open serial port
print(ser.name) # check which port was really used
line = ""
while True:
for c ... | obviateio/microProjects | serial.py | serial.py | py | 576 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "serial.Serial",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "serial.PARITY_NONE",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "serial.STOPBITS_ONE",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "serial.EI... |
43249441195 | #Nathaniel Brown
#November 23, 2022
#CSC 201 Fall 22'
#Assignment 12: Cleaning, sumarizing and Visualizing dataframes
#Title: Cleaning Summarizing and Visualizign My Dataframe
###
#Description: I will write a modularized python program that reads all the records from the data
# set that I found online into a Pandas Dat... | NathanielJBrown97/Undergrad-Classwork | CSC-201/assignments/dataset-analysis.py | dataset-analysis.py | py | 13,319 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "pandas.read_csv",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "numpy.average",
"line_number": 115,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot.scatter",
"line_number": 124,
"usage_type": "call"
},
{
"api_name": "matplo... |
29418295002 | """Classes for representing parts of a TED device."""
from __future__ import annotations
from dataclasses import dataclass
from enum import Enum
from typing import TYPE_CHECKING, List, NamedTuple
if TYPE_CHECKING:
from . import TED
class MtuType(Enum):
"""TED Defined MTU configuration types."""
NET = 0... | rianadon/the-energy-detective-py | src/tedpy/dataclasses.py | dataclasses.py | py | 2,634 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "typing.TYPE_CHECKING",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "enum.Enum",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "typing.NamedTuple",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "typing.NamedTuple",
... |
14782795954 | '''
https://leetcode.com/problems/non-overlapping-intervals/
Given a collection of intervals, find the minimum number of intervals you need to remove to make the rest of the intervals non-overlapping.
Note:
You may assume the interval's end point is always bigger than its start point.
Intervals like [1,2] and [2,3] h... | irachex/leetcode | non-overlapping-intervals.py | non-overlapping-intervals.py | py | 2,006 | python | en | code | 4 | github-code | 21 | [
{
"api_name": "utils.Interval.make_list",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "utils.Interval",
"line_number": 58,
"usage_type": "name"
},
{
"api_name": "utils.Interval.make_list",
"line_number": 59,
"usage_type": "call"
},
{
"api_name": "util... |
23654130813 | #!/usr/bin/env python
# Extract fasta files by their descriptors stored in a separate file.
# Requires biopython
from Bio import SeqIO
import sys, six
import argparse
def get_keys(args):
"""Turns the input key file into a list. May be memory intensive."""
separator = ";size="
with open(args.ke... | BPerezLamarque/HOME | tutorial_HOME/fasta_extract.py | fasta_extract.py | py | 3,695 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 37,
"usage_type": "attribute"
},
{
"api_name": "sys.stderr",
"line_number": 38,
"usage_type": "attribute"
},
{
"api_name": "sys.exit",
... |
32069860282 | #!/usr/bin/env python3
import os
import sys
import glob
import django
import hashlib
import logging
import paramiko
# Initialize Django
django.setup()
# Import from installed Apps
from dbApp.models import Submission
from symportal_kitchen.utils.utils import (
generate_lock_file, remove_lock_file, lock_file_exists... | reefgenomics/symportal-2.0 | symportal_framework/cron/transfer_from_sftp_server_to_symportal_framework.py | transfer_from_sftp_server_to_symportal_framework.py | py | 6,885 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "django.setup",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "logging.basicConfig",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
... |
72956026294 | from lxml import etree
import csv
import argparse
arg_parser = argparse.ArgumentParser()
arg_parser.add_argument("csv", help="CSV file to process")
arg_parser.add_argument("xml", help="XML file to process")
args = arg_parser.parse_args()
ns = {'tei': 'http://www.tei-c.org/ns/1.0'}
# Se servir du script level2to3.py q... | alexbartz/temp_ | scripts/csv_to_xml.py | csv_to_xml.py | py | 707 | python | fr | code | 0 | github-code | 21 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "lxml.etree.XMLParser",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "lxml.etree",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "lxml.etree.par... |
15626718890 | import os
import dj_database_url
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = 'neverusethis'
DEBUG = True
ALLOWED_HOSTS = []
INSTALLED_APPS = ['scripts']
MIDDLEWARE = []
ROOT_URLCONF = 'scripts.urls'
DATABASES = {'default': dj_database_url.config()}
| bencord0/rds-modification-experiment | scripts/settings.py | settings.py | py | 290 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "os.path.dirname",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "dj_database_url.config",
... |
41844728400 | """
Test the best network and produce a movie of sample runs.
"""
import os
import pickle
import sys
import warnings
from pathlib import Path
import neat
import gym.wrappers
import util.argparsing as argutils
import gymex.visualize as visualize
from gymex.config import make_config, RewardDiscountGenome
from gymex.evo... | ntraft/synaptic-exuberance | gymex/test.py | test.py | py | 3,968 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "gym.wrappers.make",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "gym.wrappers",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "os.environ.get",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_... |
18207483286 | import fiftyone.utils.data as foud
import fiftyone.core.metadata as fom
import eta.core.serial as etas # Package comes with FiftyOne
import numpy as np
import math
from enum import Enum
import fiftyone.types as fot
import fiftyone as fo
class Substring(Enum):
HEIGHT = 'Height'
WIDTH = 'Width'
HTTPS = 'http... | cviquez-sama/Voxel51DatasetImporter | sama.py | sama.py | py | 13,084 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "enum.Enum",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "enum.Enum",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "fiftyone.utils.data.LabeledImageDatasetImporter",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name... |
2373634961 | from rest_framework.routers import DefaultRouter
from maintenance.views import TaskAPI, RecordAPI, IssueAPI
router = DefaultRouter()
router.register("tasks", TaskAPI, basename="service-tasks")
router.register("records", RecordAPI, basename="service-records")
router.register("issues", IssueAPI, basename="service-issu... | redbird504/fms_backend | src/maintenance/urls.py | urls.py | py | 352 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "rest_framework.routers.DefaultRouter",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "maintenance.views.TaskAPI",
"line_number": 7,
"usage_type": "argument"
},
{
"api_name": "maintenance.views.RecordAPI",
"line_number": 8,
"usage_type": "argument"... |
21250266114 | # -*- coding: utf-8 -*-
import telebot, bs4, requests
bot = telebot.TeleBot("1239157216:AAHgozkrePKPvaIxIRx_qNkfZd8WCKntYEg")
def getanekdot():
z=''
s=requests.get('http://anekdotme.ru/random')
b=bs4.BeautifulSoup(s.text, "html.parser")
p=b.select('.anekdot_text')
for x in p:
s=... | bendaho/botbotbot | botbotbot.py | botbotbot.py | py | 1,242 | python | ru | code | 0 | github-code | 21 | [
{
"api_name": "telebot.TeleBot",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "telebot.types.ReplyKeyboa... |
4418852720 | import collections
class Solution:
def findBlackPixel(self, picture, N):
"""
:type picture: List[List[str]]
:type N: int
:rtype: int
"""
width, height = len(picture), len(picture[0])
rows, cols = [0] * width, [0] * height
#build array counnter storin... | Taoge123/LeetCode | Leetcode/Leetcode 533 Lonely Pixel II.py | Leetcode 533 Lonely Pixel II.py | py | 1,417 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "collections.defaultdict",
"line_number": 21,
"usage_type": "call"
}
] |
40015116914 | #dyna agent without backward search control heuristic
import numpy as np
from time import sleep,time
import matplotlib.pyplot as plt
import random
rows = 16
cols = 19
start = (5,0)
goal = (0,18)
blocks = [(1,1),(2,1),(3,1),(4,1),(5,1)]#,(0,17),(1,17),(2,17),(3,17),(4,17),(5,17),(9,17),(10,17),(11,17),(12,17)]
doors = [... | mateo3264/RL | linear_sarsa_agent.py | linear_sarsa_agent.py | py | 10,323 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "numpy.array",
"line_number": 103,
"usage_type": "call"
},
{
"api_name": "numpy.random.randn",
"line_number": 116,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 116,
"usage_type": "attribute"
},
{
"api_name": "numpy.sqrt",
... |
38557779917 | import telebot
import os
import redis
token = os.environ["TELEGRAM_TOKEN"]
bot = telebot.TeleBot(token)
REDIS_URL=os.environ.get("REDIS_URL")
dict_db={}
def save(key,value):
if REDIS_URL:
redis_db = redis.from_url(REDIS_URL)
redis_db.set(key,value)
else:
dict_db[key]=value
d... | Kylmakalle/looser_or_wise_bot | bot_instance.py | bot_instance.py | py | 1,270 | python | ru | code | null | github-code | 21 | [
{
"api_name": "os.environ",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "telebot.TeleBot",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.environ.get",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_n... |
10937152954 | from flask import Flask, jsonify
from flask_cors import CORS
# config
DEBUG = True
# create the app
app = Flask(__name__)
app.config.from_object(__name__)
# cors enable
CORS(app, resources={r'/*' : {'origins': '*'}})
@app.route('/', methods=['GET'])
def home_page():
return jsonify('Hello, World!')
if __name__ ... | ariasadeghi530/tree-traversal-visualizer | server/app.py | app.py | py | 348 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "flask.Flask",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "flask_cors.CORS",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "flask.jsonify",
"line_number": 16,
"usage_type": "call"
}
] |
20439898144 | from code.classes import grid
from code.algorithms import simulated_annealing
from code.visualisation import visualise, output, distribution
import argparse
import json, copy
from time import process_time
def main(district, algorithm, price_type, amount=1):
"""
Creates a grid based on the algorithm and distric... | JDeutr/SmartGrid-Team-11 | main.py | main.py | py | 1,972 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "time.process_time",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "code.classes.grid.Grid",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "code.classes.grid",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "copy.deepc... |
42971281653 | import pathlib
import pluggy
import pytest
from render_engine.collection import Collection
from render_engine.page import Page
from render_engine.parsers import BasePageParser
pm = pluggy.PluginManager("fake_test")
def test_collection_information_parser_passes_to_page(tmp_path):
"""
Tests that information ... | kjaymiller/render_engine | tests/test_collections.py | test_collections.py | py | 3,942 | python | en | code | 19 | github-code | 21 | [
{
"api_name": "pluggy.PluginManager",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "render_engine.parsers.BasePageParser",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "render_engine.collection.Collection",
"line_number": 21,
"usage_type": "name"
... |
337600689 | from flask import Flask, request, jsonify
from datetime import datetime
import json
app = Flask(__name__)
# File path for data persistence
DATA_FILE_PATH = 'event_data.json'
# Load existing data from the file
try:
with open(DATA_FILE_PATH, 'r') as file:
# Check if the file is empty
file_contents... | dantonic81/hub | api.py | api.py | py | 3,480 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "flask.Flask",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "flask.request.get_json",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "flask.request",
"lin... |
37089680048 | from abc import ABC, abstractmethod
from django.http.response import JsonResponse
from api.resources import getHomeProductsResource
from PyCommerce.models import getHomeProducts, productSpecifications, categories
from api.encrypt import encrypt
import math
class IGetHomeProducts(ABC):
@abstractmethod
def get_... | abdullah-ezzat/pycommerce | api/get/items/homeProducts.py | homeProducts.py | py | 3,862 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "abc.ABC",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "abc.abstractmethod",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "PyCommerce.models.getHomeProducts.objects.all",
"line_number": 24,
"usage_type": "call"
},
{
"api_name"... |
2571207304 | import paddle.fluid as fluid
import numpy as np
x = fluid.layers.data(name='x',shape=[1],dtype='float32',lod_level=1)
y = fluid.layers.data(name='y',shape=[1],dtype='float32',lod_level=2)
out = fluid.layers.sequence_expand(x=x,y=y,ref_level=1)
place = fluid.CPUPlace()
exe = fluid.Executor(place)
exe.run(fluid.default... | cournnnnnn/train_test_daily | test/sequence_expand.py | sequence_expand.py | py | 676 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "paddle.fluid.layers.data",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "paddle.fluid.layers",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "paddle.fluid",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "paddle.fl... |
72808987252 | # %%
import datadotworld as dw
import pandas as pd
import altair as alt
# import sys
# !{sys.executable} -m pip install tabulate
# %%
# Grand Question 1
#
# Write an SQL query to create a new dataframe about baseball players who attended BYU-Idaho.
# The new table should contain five columns: playerID, schoolID, sal... | jacobpad/CSE250 | week06/project3.py | project3.py | py | 4,515 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "datadotworld.query",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "datadotworld.query",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "datadotworld.query",
"line_number": 70,
"usage_type": "call"
},
{
"api_name": "datadotworld... |
15525130870 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import random
import numpy as np
from collections import namedtuple, deque
import os
import sys
import math
import torch
import torch.nn.functional as F
import torch.optim as optim
from agent import Agent
from dqn_model import DQN, DuelingDQN
import csv
"""
you can impor... | dennyboby/rl_temp | agent_dqn.py | agent_dqn.py | py | 10,161 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "torch.manual_seed",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.random.seed",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "random.seed",
... |
214681226 | from contextlib import asynccontextmanager
from fastapi import FastAPI, UploadFile, File, HTTPException, status
from fastapi.responses import HTMLResponse
import os
from uuid import uuid4
import magic
import whisper
from loguru import logger
import boto3
import os
from dotenv import load_dotenv
KB = 1024
MB = KB * K... | renatex333/whisper-audio-transcription | app/main.py | main.py | py | 3,822 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "dotenv.load_dotenv",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 59,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number":... |
11986812640 | #!/usr/bin/python
from __future__ import print_function
from __future__ import absolute_import
from ansible.module_utils.basic import AnsibleModule
import os
import six
import tempfile
import shutil
import tarfile
import base64
import sys
import pprint
# Allows modules to trigger errors
def error(msg, **kwargs):
... | openshift/openshift-client-python | ansible/roles/openshift_client_python/library/openshift_client_python.template.py | openshift_client_python.template.py | py | 4,242 | python | en | code | 60 | github-code | 21 | [
{
"api_name": "openshift.OpenShiftPythonException",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "openshift.ansible.reset",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "openshift.ansible",
"line_number": 28,
"usage_type": "attribute"
},
{
... |
71007239734 | """
처음에는 1부터 n까지 수를 증가하며 -1, // 2, // 3을 비교하며 제일 작은 count에 1을 더해줬다.
훨씬 더 빠른 코드를 봐서 그것을 참고하여 풀어보았다.
reference: https://www.acmicpc.net/source/36468391
해당 풀이는 //3, //2, -1을 queue에 넣고 하나씩 꺼내 올 때 그 값이 1이면 while문을 그만둔다.
왜냐하면 1이 나왔을 때 그것이 가장 최소 횟수로 찾은 것이기 때문이다.
또한, nums[//3, //3, -1]이 0일 때, 즉 이전에 방문한 적이 없을 때 큐에 넣어줘서 중복을 피한... | c0natus/Practice | Algorithm-practice/BaekJoon/Sliver or less/B12852.py | B12852.py | py | 1,268 | python | ko | code | 0 | github-code | 21 | [
{
"api_name": "sys.stdin",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "collections.deque",
"line_number": 19,
"usage_type": "call"
}
] |
74988523251 | import torch
import os
from pathlib import Path
from DistributionMatching.NoahArc.src.NoahArc import NoahArc
"""NoahArcCE implementation
inherits from 'NoahArc' , based on Cross entropy metric
"""
class NoahArcCE(NoahArc):
def __init__(
self,
dataframe,
similarity_matrix,
... | HodBadichi/Bias-Mitigation-Through-Topic-Aware-Distribution-Matching | DistributionMatching/NoahArc/src/NoahArcCE.py | NoahArcCE.py | py | 3,162 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "DistributionMatching.NoahArc.src.NoahArc.NoahArc",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "pathlib.Path",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "os.path.isfile",
"line_number": 36,
"usage_type": "call"
},
{
"api_... |
7822375137 | import math
import random
import matplotlib.pyplot as plt
EPSILON = 0.01
PLOT = True
class Stats:
def __init__(self, accuracy, precision, recall, f_score):
self.accuracy = accuracy
self.precision = precision
self.recall = recall
self.f_score = f_score
def __str__(self):
... | caprapaul/assignments | semester_4/ai/Assignment6/main.py | main.py | py | 6,945 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "random.sample",
"line_number": 172,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.scatter",
"line_number": 233,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 233,
"usage_type": "name"
},
{
"api_name": "matplotl... |
6278256043 | import pandas as pd
import re
import pickle
import numpy as np
import os
from tqdm import tqdm
import time
"""
提取100万360_DGA 域名作 与100万top-1m域名 作为训练数据
提取特征与替换目标值 构造为[(目标值, 特征值), ()....] 的数据集
将重要参数 与 数据集 保存为 pki文件方便调用
"""
def get_alexa(filename):
"""
提取alexa 域名 全部为正面域名 结构为 [[域名1, 目标值], [域名2, 目标值]..........]
... | ChenDolph7in/DGA-Generated_Random_Domain_Name_Detection_Based_on_BiLSTM | data_new.py | data_new.py | py | 2,690 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "tqdm.tqdm",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "os.path.isfile",
"line_numbe... |
23193748073 | import util
import numpy as np
import logging
import random
import itertools
np.set_printoptions(formatter={'float_kind': lambda x: "%.3f" % x})
logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger(__name__)
logger.info("Program started")
def neural_net(iterations, learning_rate, random_weights = True,... | DeastinY/NeuralNetworks | simple_neural_network/main.py | main.py | py | 2,818 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "numpy.set_printoptions",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "logging.basicConfig",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "logging.ge... |
21342247885 | # -*- coding: utf-8 -*-
"""
Created on Sun Dec 4 12:55:41 2022
@author: danie
"""
import requests
import json
def check_city():
url = "https://api.openaq.org/v1/cities?limit=3000&offset=0&sort=asc&order_by=city"
headers = {"accept": "application/json"}
response = requests.get(url, heade... | danieljaenal/Python_project_0 | available_cities.py | available_cities.py | py | 469 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "requests.get",
"line_number": 17,
"usage_type": "call"
}
] |
26092704491 | import argparse
import pwd
import os
import re
import sys
VARS = [
b"SSH_AUTH_SOCK",
b"SSH_AGENT_PID",
]
def process(pid, uid):
"""
Looks for an ssh key in /proc/`pid`/environ.
`pid`
The process number, which can be a string.
`uid`
The userid that must own the process for... | renpytom/ssh-vampire | ssh_vampire.py | ssh_vampire.py | py | 1,737 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "os.path.join",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "os.stat",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "sys.stdout.buffer.write",
"line... |
24510384623 | import dash
from dash.dependencies import Input, Output, State
import dash_core_components as dcc
import dash_html_components as html
from collections import deque
import plotly.graph_objs as go
import plotly.express as px
import utilities as u
import secrets
from flask_caching import Cache
import datetime as dt
from... | nick88msn/cmfg | batch_run.py | batch_run.py | py | 22,145 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "cmfg.model.SMfgModel",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "secrets.MAPBOX_PUBLIC_TOKEN",
"line_number": 37,
"usage_type": "attribute"
},
{
"api_name": "utilities.getPointFromDistance",
"line_number": 50,
"usage_type": "call"
},
{
... |
31576842377 | import pytest
import xarray as xr
from pymech.neksuite.field import read_header
import snek5000
from snek5000.output import _make_path_session
from snek5000.params import load_params
from snek5000.util.restart import SnekRestartError, get_status, load_for_restart
def test_too_early(sim_data):
assert get_status(s... | snek5000/snek5000 | tests/test_restart.py | test_restart.py | py | 5,463 | python | en | code | 20 | github-code | 21 | [
{
"api_name": "snek5000.util.restart.get_status",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pytest.raises",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "snek5000.util.restart.SnekRestartError",
"line_number": 14,
"usage_type": "argument"
},
... |
12214381175 | from django import forms
import datetime
from calendars.models import Task, Event, Habit, Reward
from bootstrap_modal_forms.forms import BSModalModelForm, BSModalForm
from tempus_dominus.widgets import DatePicker, DateTimePicker
class TaskForm(BSModalModelForm):
date = forms.DateField(input_formats=['%d/%m/%Y'],
... | moonshoes/dailytaskmanager | calendars/forms.py | forms.py | py | 6,290 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "bootstrap_modal_forms.forms.BSModalModelForm",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.forms.DateField",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.forms",
"line_number": 8,
"usage_type": "name"
},
{
"api... |
38077367255 | #!/usr/bin/env python
# coding: utf-8
from PyQt5.QtWidgets import QApplication, QWidget, qApp, QPushButton
from PyQt5.QtWidgets import QGraphicsScene, QStyleOptionGraphicsItem, QComboBox
from PyQt5.QtWidgets import QGraphicsView, QHBoxLayout, QVBoxLayout, QGraphicsLineItem
from PyQt5.QtWidgets import QGraphicsEllipseI... | ikegami5/VisibleGraph | src/main.py | main.py | py | 11,827 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "PyQt5.QtGui.QVector2D",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtGui.QVector2D",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "math.sqrt",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtWidgets... |
70865991413 | from crypt import methods
from flask import Flask, render_template, session, request, jsonify
from boggle import Boggle
app = Flask(__name__)
app.config['SECRET_KEY'] = "abcd1234"
boggle_game = Boggle()
current_words = []
@app.route('/')
def home_page():
"""Return a page that shows Boggle game board"""
sessi... | brianelizondo/python-flask-testing | app.py | app.py | py | 1,555 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "flask.Flask",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "boggle.Boggle",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "flask.session",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "flask.render_template",
"li... |
21013634794 | """Exception example
"""
import math
import logging
logger = logging.getLogger(__file__)
class OutsideRangeException(Exception):
pass
def range_check_user_input(parameter: int) -> float:
"""This funtions performs a range check on the user input
Arguments:
parameter {int} -- The parameter to ... | societa/the-well-grounded-python-developer | examples/CH_06/examples/03.py | 03.py | py | 1,578 | python | en | code | null | github-code | 21 | [
{
"api_name": "logging.getLogger",
"line_number": 8,
"usage_type": "call"
}
] |
3319021840 | import pickle
import os
import numpy as np
import pandas as pd
import tensorflow as tf
import re
import string
import spacy
import gensim.downloader as gen
from tqdm import tqdm
import nltk
# nltk.download('all')
from nltk.stem import WordNetLemmatizer, SnowballStemmer
from tensorflow.keras.layers import TextVectoriza... | omidrajabi6868/eBay_ML_Challenge | utils.py | utils.py | py | 23,637 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "numpy.arange",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "numpy.newaxis",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "numpy.arange",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "numpy.newaxis",
"lin... |
32582905152 | import sys
import json
resolved_input = sys.argv[1]
with open(resolved_input) as fp:
resolveds = {kv[0]: kv[1] for kv in json.loads(fp.read())}
unresolved_input = sys.argv[2]
with open(unresolved_input) as fp:
unresolveds = json.loads(fp.read())
output_filename = argv[3]
for idx, unresolved in unresolveds:
... | choihun123/TrumpCoverage | combine_resolved_and_unresolved.py | combine_resolved_and_unresolved.py | py | 437 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "sys.argv",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "json.loads",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "json.loads",
"line_number": 1... |
74638395892 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import numpy as np
import argparse
import cv2
import cv2 as CV #eğer python2 kullanıyorsanız eklemek zorundasınız aksi halde hata alırsınız
import time
import threading
from pymavlink import mavutil
mode = 'STABILIZE'
master = mavutil.mavlink_connection( # aracin baglant... | enisgetmez/BAUROV-Autonomous | Autonomous/test.py | test.py | py | 2,066 | python | en | code | 16 | github-code | 21 | [
{
"api_name": "pymavlink.mavutil.mavlink_connection",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pymavlink.mavutil",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "pymavlink.mavutil.mavlink",
"line_number": 49,
"usage_type": "attribute"
},
{
... |
6438932436 | from django.shortcuts import render
from cars.models import *
def car_detail(request, pk):
owner = Driver.objects.get(pk=pk)
cars = Car.objects.filter(owner_id=owner.id)
context = {
"vehicles": cars,
"drivers": owner,
}
return render(request, 'car_detail.html', context)
| MotasemZiad/first_django_rest | cars/views.py | views.py | py | 309 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "cars.models",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "cars.models",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "django.shortcuts.render",
"line_number": 12,
"usage_type": "call"
}
] |
5709474284 | # This code is taken from an old project of mine (Jake Hattwell)
# and can probably be cleaned up/optimized at some point
# For now though, it gets the job done fast enough that enhancements
# would be purely cosmetic.
import csv
import os
import yaml
class ModelSystem:
"""Class for reading SBtab files"""
... | wormjam-consortium/wormjam | .github/tests/support/helper_classes.py | helper_classes.py | py | 6,144 | python | en | code | 3 | github-code | 21 | [
{
"api_name": "os.path.isdir",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "os.listdir",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "csv.reader",
"line_number":... |
31355331816 | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import streamlit as st
from sklearn.model_selection import train_test_split
import time
import seaborn as sns
from PIL import Image
def _sigmoid(z):
return 1/(1+np.exp(-z))
def _relu(z):
return np.maximum(0,z)
def start_layers(architectu... | parismollo/Beisa | net.py | net.py | py | 11,434 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "numpy.exp",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.maximum",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.random.seed",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_nu... |
11906919646 | # from django.contrib import admin
from django.urls import path
from testapp import views
app_name='testapp'
urlpatterns = [
path('api/',views.EmployeeListCreateModelMixin.as_view()),
path('api/<pk>',views.EmployeeRetriveUpdateDestroyModelMixin.as_view()),
] | pythondjangoproj/APIView_with_mixin | APIMIXIN_proj/testapp/urls.py | urls.py | py | 268 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "testapp.views.EmployeeListCreateModelMixin.as_view",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "testapp.views.EmployeeListCreateModelMixin",
"line_number": 7,
"usage_t... |
3312576774 | from dataclasses import dataclass
from functools import cached_property
import numpy as np
from type_alias import Array
@dataclass
class TrussInputs:
coords: Array
incidences: Array
boundary_conditions: Array
loads: Array
young_modulus: float
section_area: float
poisson: float = 0.3
... | ruy-sevalho/im382 | truss2d.py | truss2d.py | py | 3,921 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "type_alias.Array",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "type_alias.Array",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "type_alias.Array",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "type_alias.Array",... |
23305240417 | from typing import Optional
from indi.message.base import IndiMessage
@IndiMessage.register_message
class GetProperties(IndiMessage):
from_device = True
from_client = True
def __init__(
self,
version: str,
device: Optional[str] = None,
name: Optional[str] = None,
... | wlatanowicz/indipy | indi/message/get_properties.py | get_properties.py | py | 423 | python | en | code | 5 | github-code | 21 | [
{
"api_name": "indi.message.base.IndiMessage",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "indi.mes... |
41467108976 | #!/usr/bin/python
"""Example Velociraptor api client.
This example demonstrates how to connect to the Velociraptor server
and issue a server side VQL query.
In this example we may issue event queries which stream results slowly
to the api client. This demonstrates how to build reactive post
processing scripts as req... | Velocidex/pyvelociraptor | pyvelociraptor/client_example.py | client_example.py | py | 5,241 | python | en | code | 12 | github-code | 21 | [
{
"api_name": "grpc.ssl_channel_credentials",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "grpc.secure_channel",
"line_number": 63,
"usage_type": "call"
},
{
"api_name": "pyvelociraptor.api_pb2_grpc.APIStub",
"line_number": 65,
"usage_type": "call"
},
{
... |
15570739902 | # Basics
import numpy as np
import time
# Data
import xarray as xr
import h5py
# Helpful
from tqdm import tqdm
# My Methods
import data.raw.load_data_raw as ldr
# My Methods
import data.raw.load_data_raw as ldr
from dask.distributed import Client
def main():
# Start a Dask Client
client = Client()
#... | cleveryangcong/Bachelor_Thesis | src/data/make_ws10_train_data.py | make_ws10_train_data.py | py | 2,867 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "dask.distributed.Client",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "h5py.File",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "data.raw.load_data_raw.load_data_raw",
"line_number": 32,
"usage_type": "call"
},
{
"api_name":... |
44273220051 | import numpy as np
import cv2
import os
from os import listdir
from os.path import isfile, join
from skimage.segmentation import slic
import scipy
from PIL import Image
# # Functions of the process
class ZurichDataset():
def read_video(self,directory, sample_rate, preprosessing):
cam = cv2.VideoCapture(di... | zgxsin/semester-project | samples/mask_extraction/mask_extraction.py | mask_extraction.py | py | 11,467 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "cv2.createCLAHE",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2RGB",
... |
10707133744 | import json
from datetime import datetime
from httpx import get
from ..utils.download_resource.RESOURCE_PATH import PLAYER_PATH
from .get_gachalogs import save_gachalogs
INT_TO_TYPE = {
"100": "新手祈愿",
"200": "常驻祈愿",
"301": "角色祈愿",
"400": "角色祈愿",
"302": "武器祈愿",
}
async def import_gachalogs(histo... | qwerdvd/nonebot_plugin_ark | src/plugins/ark/ark_gachalog/export_and_import.py | export_and_import.py | py | 2,705 | python | en | code | 3 | github-code | 21 | [
{
"api_name": "json.loads",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "httpx.get",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "get_gachalogs.save_gachalogs",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "utils.download_reso... |
9149058840 | from abc import ABC
import torch
from torch.nn import functional as F
import torch
# 二分类
class Focal_loss(torch.nn.Module):
def __init__(self, alpha=None, gamma=0, size_average=True):
super(Focal_loss, self).__init__()
self.gamma = gamma
self.alpha = torch.tensor([alpha])
self.si... | Luxhr47/A-Controlled-Attention-for-Nested-Named-Entity-Recognition | CA/boundary/model/loss.py | loss.py | py | 4,254 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "torch.nn",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "torch.tensor",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "abc.ABC",
"line_number": 42,
"usage_type": "name"
},
{
"api_name": "torch.nn.utils.clip_grad_norm_",
... |
28777375692 | import os
import json
import fitz
from utils import *
class PdfContensMaker():
def __init__(self, inputpath, bid, outputpath = "OutputPdf"):
self.bid = bid
self.inputPath = inputpath
mkdir(outputpath)
self.outputPath = outputpath + "/" +os.path.basename(inputpath)
self.... | BillXuce/wqxt_pdf_maker | pdfmaker.py | pdfmaker.py | py | 2,265 | python | en | code | 6 | github-code | 21 | [
{
"api_name": "os.path.basename",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "json.loads",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "fitz.open",
"line_number... |
70728640054 | import pytest
from django.contrib.auth.models import User
from django.test import Client
from booking.models import Order
from booking.models import Rooms
@pytest.mark.django_db
class TestOrderDel:
def test_order_del(self):
client = Client()
user = User.objects.create(
username="tes... | m0shanya/hotel | tests/test_order_del.py | test_order_del.py | py | 834 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django.test.Client",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.models.User.objects.create",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.models.User.objects",
"line_number": 15,
"usage_typ... |
3185482343 | import os
from setuptools import find_packages, setup, Command
import sys
__author__ = 'taufik'
class RunTests(Command):
description = 'Run the django test suite from the tests dir.'
user_options = []
extra_env = {}
extra_args = []
def run(self):
for env_name, env_value in self.extra_env... | senseobservationsystems/django-gruveo | setup.py | setup.py | py | 1,890 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "setuptools.Command",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "os.environ",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "django.core.management.execute_from_command_line",
"line_number": 20,
"usage_type": "call"
},
{
... |
19701062746 | from platform import python_version as y
from telegram import __version__ as o
from pyrogram import __version__ as z
from telethon import __version__ as s
from pyrogram.types import Message, InlineKeyboardMarkup, InlineKeyboardButton
from pyrogram import filters
from LorcanRobot import pbot
from LorcanRobot.utils.error... | accounttool/LorcanRobot | LorcanRobot/modules/carbon.py | carbon.py | py | 2,019 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "LorcanRobot.utils.functions.make_carbon",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "LorcanRobot.pbot.send_photo",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "LorcanRobot.pbot",
"line_number": 22,
"usage_type": "name"
},
{
... |
21981878692 |
import numpy as np
import matplotlib.pyplot as plt
a = 1
t = np.linspace(0 , 2 * np.pi, 1024)
X = a*(2*np.cos(t)-np.cos(2*t))
Y = a*(2*np.sin(t)-np.sin(2*t))
plt.plot(Y, X,color='r')
plt.show()
def pdf(X, mu, sigma):
a = 1. / (sigma * np.sqrt(2. * np.pi))
b = -1. / (2. * sigma ** 2)
return a * np.exp(b *... | shushanxingzhe/python_learning | numpy_matplotlib_pandas/matplot.py | matplot.py | py | 1,329 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "numpy.linspace",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "numpy.pi",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "numpy.cos",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.sin",
"line_number": 8,... |
42256879439 | from PySide2 import QtCore,QtGui,QtWidgets
import sys
mainWidget = QtWidgets.QApplication(sys.argv)
class myWindow(QtWidgets.QMainWindow):
def __init__(self):
QtWidgets.QMainWindow.__init__(self)
self.initUI()
def initUI(self):
self.mainLayout = QtWidgets.QGridLayout()
self.... | onexeno/Maya_Scripts | python/test.py | test.py | py | 1,583 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "PySide2.QtWidgets.QApplication",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "PySide2.QtWidgets",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "sys.argv",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "PySide2.Q... |
4244123771 | import os, sys
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
import socket
import json
import hashlib
import copy
class Client:
def __init__(self, sys_argv):
self.USER_HOME = '%s/var/users' % BASE_DIR
self.args = sys_argv
self.argv_parse()
self.response_... | caijingkuangmo/FTP-socketserver | FTP/FTPClient/modules/client.py | client.py | py | 9,669 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "os.path.dirname",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number... |
36035789241 | import torch
import torch.nn as nn
import torch.nn.functional as F
# torchvision 包收录了若干重要的公开数据集、网络模型和计算机视觉中的常用图像变换
import torchvision
import torchvision.transforms as transforms
import cv2
class ConvNet(nn.Module):
def __init__(self):
super(ConvNet, self).__init__()
self.layer1 = nn.Sequential(
... | longhun199706/pytorch-MNIST- | new.py | new.py | py | 8,632 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "torch.nn.Module",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "torch.nn.Sequential",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_... |
6504344990 | from collections import Counter, OrderedDict
from axcell.models.linking.acronym_extractor import AcronymExtractor
from axcell.models.linking.probs import get_probs, reverse_probs
from axcell.models.linking.utils import normalize_dataset, normalize_dataset_ws, normalize_cell, normalize_cell_ws
from scipy.special import... | paperswithcode/axcell | axcell/models/linking/context_search.py | context_search.py | py | 20,659 | python | en | code | 365 | github-code | 21 | [
{
"api_name": "pandas.DataFrame",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number"... |
15424804712 | import argparse
import os
import sys
import urllib.request
from subprocess import call, CalledProcessError
from cliff.lister import Lister
from cliff.command import Command
from bmcmanager import nagios, exitcode
from bmcmanager.commands.base import (
BMCManagerServerCommand,
BMCManagerServerListCommand,
... | grnet/BMCManager | bmcmanager/commands/firmware.py | firmware.py | py | 6,632 | python | en | code | 8 | github-code | 21 | [
{
"api_name": "bmcmanager.commands.base.BMCManagerServerListCommand",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "bmcmanager.commands.base.BMCManagerServerCommand",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "bmcmanager.commands.base.BMCManagerServerCo... |
28062171765 | import asyncio
import datetime
import random
import time
def run_task(task_id, factor):
start = datetime.datetime.now()
print(f"Starting task{task_id} at {start.strftime('%H:%M:%S')}")
# simulate i/o operation using sleep
time.sleep(random.random()*factor)
finish = datetime.datetime.now()
time... | meko0019/ucw-asyncio | example.py | example.py | py | 1,416 | 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": "time.sleep",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "random.random",... |
37685727556 | '''
A Framework of Back Propagation Neural Network(BP) model
dependency:
- numpy.
author: Stephen Lee
github : https://github.com/RiptideBo
2017.11.23
'''
import numpy as np
import matplotlib.pyplot as plt
def sigmoid(x):
return 1 / (1 + np.exp(-1 * x))
def relu(x):
return np.where(x > 0, x, 0)
def sof... | RiptideBo/simpy | deep_learning/models/bpnn.py | bpnn.py | py | 7,329 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "numpy.exp",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.where",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.exp",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "numpy.sum",
"line_number": 25,
... |
14643260184 | import socket
import logging
from robot.board import Board
logging.basicConfig(format='%(asctime)s %(levelname)s (%(process)d) %(filename)s %(funcName)s %(message)s')
class WiFiController(object):
def __init__(self, port=5005, **kwargs):
self._label = 'wifi.controller'
self._run = True
... | rmontenegroo/custom-robot-rpi4 | yahboom-g1-tank/robot/controller/wifi.py | wifi.py | py | 4,307 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "logging.basicConfig",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "socket.socket",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "socket.AF_INET",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "socket.SOCK_DGRA... |
21456599871 | from flask import Flask, jsonify
from flask_restful import Resource
from pymongo import MongoClient
from requests import get
from datetime import date
from app import API_KEY
from .apod_views import api
# setting db table
client = MongoClient('mongodb://localhost:27017/')
db = client['nasa_apod']
collection = db['neo'... | mwdev22/daily_satelite | backend/app/neo_views.py | neo_views.py | py | 1,715 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pymongo.MongoClient",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "flask_restful.Resource",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "datetime.date.today",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "dateti... |
72731672372 | import math, csv, re
from matplotlib import pyplot as plt
from collections import Counter
from datetime import datetime as dt
import sys
from sklearn import linear_model
import numpy as np
import pandas as pd
from bokeh.plotting import figure, output_file, show
data_file = "311_StreetCondition_2015.csv"
potholes = []... | aurorakp/CMP464Project | potholes_2015_dates_only.py | potholes_2015_dates_only.py | py | 1,295 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "csv.DictReader",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.strptime",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "datetime.... |
39806493877 | import streamlit as st
import numpy as np
import pandas as pd
# Main
st.title ("Esta es mi primera aplicación")
datos = pd.DataFrame(
np.random.randn(20, 3),
columns = ['a', 'b', 'c'])
st.write('aaa')
st.line_chart(datos)
aa = st.number_input(label='titulo')
st.dataframe(datos)
| sergiovillanueva/datamecum2 | Ejercicio1.py | Ejercicio1.py | py | 302 | python | es | code | 0 | github-code | 21 | [
{
"api_name": "streamlit.title",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.random.randn",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"... |
41924492452 | import math
import bpy
import re
oops = bpy.ops.object
pops = bpy.ops.pose
def set_array_indices(array, indices):
for i in range(len(array)):
array[i] = True if i in indices else False
def switch_to_layer(arm, index):
arm.layers[index] = True
for i in range(len(arm.layers)):
if i == index... | artempoletsky/blender_1_click_rig | one_click_rig/bone_functions.py | bone_functions.py | py | 4,341 | python | en | code | 29 | github-code | 21 | [
{
"api_name": "bpy.ops",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "bpy.ops",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "math.acos",
"line_number": 25,
"usage_type": "call"
}
] |
19766112414 | from datetime import date
import requests, json
def parse_date(d) -> date:
if type(d) is date:
return d
split = d.split("/")
return date(
month=int(split[0]),
day=int(split[1]),
year=int(split[2])
)
class Edition:
def __init__(self, name: str, start, end):
... | FoxSamu/nfc_countdown | countdown.py | countdown.py | py | 1,013 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "datetime.date",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "datetime.date",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "datetime.date.today",
"lin... |
1324020999 | import cv2
import torch
import numpy as np
from scipy.ndimage import binary_dilation
from PIL import Image
from tqdm import tqdm
from torchvision import transforms
from .inpaint_model import InpaintModel
# Retouch new approach
from .model.modules.flow_comp_raft import RAFT_bi
from .model.recurrent_flow_completion imp... | wladradchenko/wunjo.wladradchenko.ru | portable/src/deepfake/src/retouch/__init__.py | __init__.py | py | 21,569 | python | en | code | 404 | github-code | 21 | [
{
"api_name": "numpy.stack",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "numpy.expand_dims",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "numpy.stack",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_num... |
70809973813 | #!/usr/bin/env python3
'''
##genomes_data_fetch.py
T. R. Allnutt 2021. Collects all current green plant (or any other group you specify) genome data from NCBI.
Requires taxonkit, https://github.com/Royal-Botanic-Gardens-Victoria/taxonkit. In order to make local taxonomy database. Install and add to PATH.
NCBI taxo... | Royal-Botanic-Gardens-Victoria/genomes_update | genomes_data_fetch.py | genomes_data_fetch.py | py | 10,414 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "re.compile",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "subprocess.Popen",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "subprocess.Popen",
"line_number": 64,
"usage_type": "call"
},
{
"api_name": "subprocess.Popen",
"... |
18390892776 | #!/usr/bin/env python3
import logging
import json
from collections import defaultdict
import sys
from bottle import route, run, request, response, hook, static_file, redirect
logger = logging.getLogger('server')
next_client_id = 1
created_offers = {}
created_answers = {}
ices = defaultdict(list)
@hook('after_reque... | magicleap/UnityTemplate | Assets/MagicLeap/WebRTC/ExampleSetup/Server/server.py | server.py | py | 2,253 | python | en | code | 21 | github-code | 21 | [
{
"api_name": "logging.getLogger",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "bottle.response.headers",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name":... |
37816337905 | import logging
import sys
def configure_logging(filename=None, filemode=None, fmt=None, datefmt=None,
level=logging.INFO, stream=None, handler=None):
if handler is None:
if filename is None:
handler = logging.StreamHandler(stream or sys.stderr)
else:
handler = loggin... | teepark/divconq | divconq/__init__.py | __init__.py | py | 590 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "logging.INFO",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "logging.StreamHandler",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sys.stderr",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "logging.FileHand... |
26889953160 | import netCDF4
import numpy as np
from keras.models import load_model
from utils.evaluation.reconstruction_models_evaluator import evaluate_single_case
from matplotlib import pyplot as plt
import cmocean
def myround(x, base=5):
return base * round(x/base)
plt.rcParams.update({'font.size': 14})
model_path = r'C:... | mahmoud-al-najar/bathymetry_estimation | utils/visualization/raw_data_reader.py | raw_data_reader.py | py | 4,425 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "matplotlib.pyplot.rcParams.update",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.rcParams",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 13,
"usage_type": "name"
},
{
... |
37486740097 | from collections import deque
import sys
times = int(input())
que = deque()
# queue 로직 함수화
def order_logic(order, number=None, data=que):
if order == 'push':
data.appendleft(int(number))
elif order == 'pop':
if len(data) == 0:
return print(-1)
else:
print(data[-... | DrunkJin/CosMos | 220627-220703/b10845/DrunkJin_b10845.py | DrunkJin_b10845.py | py | 1,055 | python | en | code | 3 | github-code | 21 | [
{
"api_name": "collections.deque",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sys.stdin.readline",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "sys.stdin",
"line_number": 36,
"usage_type": "attribute"
}
] |
31742707955 | import nengo
import numpy as np
import nengo_brainstorm
import redis
r = redis.StrictRedis(host = '10.0.0.2',password='neuromorph')
good = [0,1,5]
N = len(good)
n_neurons = 256
model = nengo.Network()
nengo_brainstorm.add_params(model)
with model:
def redis_WTA_in(t):
global r
WTA_in_0 = float(r.... | Neuromorphs18/AmyRobot | central_brd.py | central_brd.py | py | 1,792 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "redis.StrictRedis",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "nengo.Network",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "nengo_brainstorm.add_params",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "nengo.Node... |
39064400978 | """
Purpose: This class is used to perform all data related
operations for all blog post model objects.
Date created: 2/5/2020
"""
# Used to print the exception stack trace to console window.
import sys
import traceback
from django.db import IntegrityError, transaction
from services.utils.slugifyutil impor... | AcePro-Engineer/JBBlogsv2 | ENV/root/backend/services/blogservices/dataservices/postdataservice.py | postdataservice.py | py | 6,380 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "headingdataservice.HeadingDataService",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "blog.models.blog.Post.blogposts.get_post_by_slug",
"line_number": 65,
"usage_type": "call"
},
{
"api_name": "blog.models.blog.Post.blogposts",
"line_number": 65,
... |
27660979790 | import networkx as nx
import numpy as np
import random
import torch
class S2VGraph(object):
def __init__(self, g, label, node_tags=None, node_features=None):
'''
g: a networkx graph
label: an integer graph label
node_tags: a list of integer node tags
node_fea... | nathanlucaussy/provably-powerful-GNNs | legacy/GIN_old/util_GIN.py | util_GIN.py | py | 1,917 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "numpy.zeros",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "torch.from_numpy",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "networkx.Graph",
"line_number": 40,
"usage_type": "call"
}
] |
43038768467 | import itertools
def main():
x0, y0, a0, b0, c0 = map(int, input().split())
# 横に切るのか、縦に切るのかを判定
# とりあえず常に右端を切り落とす
def step1(x, y, a, b, c):
# 右端を切り落として、cをあてがう
w = (c+y-1)//y
return x-w, y, a, b
def step2(x, y, a, b):
# 右端を切り落として、bをあてがう
if y == 0:
... | batamorphism/coding | Python/AtCoder/old/abc223_e_0327.py | abc223_e_0327.py | py | 924 | python | ja | code | 0 | github-code | 21 | [
{
"api_name": "itertools.permutations",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "itertools.permutations",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "itertools.permutations",
"line_number": 28,
"usage_type": "call"
}
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.