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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
24932031239 | from django.shortcuts import render
from django.template.context_processors import request
from principal import forms,models
from principal.models import Noticia, Diario
from django.http import HttpResponseRedirect
def inicio(request):
return render(request,'inicio.html')
def formularios(request):
return ren... | que-si-que-yo-acabo-este-ano/AII | django_evaluable/principal/views.py | views.py | py | 3,297 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "django.shortcuts.render",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.template.context_processors.request",
"line_number": 8,
"usage_type": "argument"
},
{
"api_name": "django.shortcuts.render",
"line_number": 11,
"usage_type": "call"
... |
4415178142 | import unittest
from lib.gpt_utils import GptUtil
from database.schema_feed import SchemaFeed
class TestGptUtils(unittest.TestCase):
def setUp(self):
self.q1 = 'Write a SQL query to list all the films that actor "Julia Zellweger" was in and sort the films by category.\nUse the following table schemas as a... | ochsec/english-web-api | tests/gpt_utils_test.py | gpt_utils_test.py | py | 929 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "unittest.TestCase",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "database.schema_feed.SchemaFeed",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "lib.gpt_utils.GptUtil",
"line_number": 10,
"usage_type": "call"
},
{
"api_na... |
20474609952 | import sqlite3
VeriTabani=sqlite3.connect("kitaplar.sqlite")
imlec=VeriTabani.cursor()
imlec.execute("CREATE TABLE kitaplik (yazar,kitap)")
# Eğer tablo birkere oluşturulduysa birdaha oluşturmaz hata verir.
# rm *sqlite # terminale yazılarak sqlite ile oluşturulmuş olanlar kaldırılır (remain)
# SQLite uygula... | SadettinKayali/Python | Python_A_Z_Udemy/Udemy104_TabloOlusturma_sqlite.py | Udemy104_TabloOlusturma_sqlite.py | py | 397 | python | tr | code | 0 | github-code | 18 | [
{
"api_name": "sqlite3.connect",
"line_number": 3,
"usage_type": "call"
}
] |
25561746789 | import numpy as np
import os
from collections import OrderedDict
from tqdm import tqdm
import torch
import torch.optim as optim
from torch.utils.data import DataLoader
import torch.nn.functional as F
import torch.backends.cudnn as cudnn
from dataset import BrainDataset, FACE_OBJECT, MALE_FEMALE, ARTIFICIAL_NATURAL, CL... | masaki-takeda/dld | dld/main_combined.py | main_combined.py | py | 17,901 | python | en | code | 3 | github-code | 18 | [
{
"api_name": "model.train",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "torch.Tensor",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "tqdm.tqdm",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "torch.nn.functional.binary_cross_e... |
39212826983 | import urllib.request
import html.parser
import json
import os
from bs4 import BeautifulSoup
from bs4 import SoupStrainer
from datetime import datetime
def get_sports_info(sport):
# Lists
dates = []
opponents = []
locations = []
times = []
final = []
# Bounds checking
date_len = 0
... | logan-waite/web_scraper | deployment/byu_scores.py | byu_scores.py | py | 2,662 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "bs4.SoupStrainer",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "urllib.request.request.urlopen",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "urllib.request.request",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_n... |
26970846881 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
import struct
import os
import time
import math
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
from ROOT import *
from datetime import datetime
from array import array
from rawdata import get_ra... | darkmatter-ucsd/SanDP | sandp/waveform.py | waveform.py | py | 11,294 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "sys.setdefaultencoding",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "configparser.ConfigParser",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "sandp.full_path",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "rawda... |
11169604051 | from django.db import DEFAULT_DB_ALIAS
from django.contrib.admin.utils import NestedObjects
from drf_spectacular.utils import extend_schema
from drf_yasg.utils import swagger_auto_schema
from rest_framework.decorators import action
from rest_framework import status
from rest_framework.authtoken.models import Token
from... | DefectDojo/django-DefectDojo | dojo/api_v2/mixins.py | mixins.py | py | 1,950 | python | en | code | 3,128 | github-code | 18 | [
{
"api_name": "django.contrib.admin.utils.NestedObjects",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "django.db.DEFAULT_DB_ALIAS",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "itertools.chain.from_iterable",
"line_number": 34,
"usage_type": "cal... |
31985356503 | from bs4 import BeautifulSoup
import requests
import pandas as pd
data = []
for i in range(200):
# url of arXiv web page
url = "https://arxiv.org/search/?query=cs.LG&searchtype=all&order=-announced_date_first&size=50&abstracts=show&start="
# get html content
r = requests.get(url + str(i)) # range(200... | C-Ritam98/Latent-Dirichlet-Allocation | webCrawl.py | webCrawl.py | py | 794 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "requests.get",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 24,
"usage_type": "call"
}
] |
18105128741 | import tkinter as tk
from tkinter import ttk
import tkcalendar as tkc
root = tk.Tk()
#Task Description section
task_description_frame = tk.Frame(root)
task_description_frame.pack()
task_label = tk.Label(task_description_frame, text='Task Description')
task_label.pack(side=tk.LEFT)
task_description = tk.Text(task_de... | ZafodBiblbrox/task_manager | gui.py | gui.py | py | 2,084 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "tkinter.Tk",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "tkinter.Frame",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "tkinter.Label",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "tkinter.LEFT",
"line_number"... |
28337267348 | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^cart/$',views.cart),
url(r'^detail/$',views.detail),
url(r'^index/$',views.index),
url(r'^list/$',views.list),
url(r'^login/$',views.login),
url(r'^place_order/$',views.place_order),
url(r'^register/$',views.registe... | Someoneshmily/TTSX | ttsx/booktest/urls.py | urls.py | py | 496 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "django.conf.urls.url",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.co... |
1377170055 | import pandas as pd
from sklearn import model_selection
if __name__=="__main__":
data_dir = '../input/'
df = pd.read_csv(f"{data_dir}mnist_train.csv")
df['kfold'] = -1
y = df.label.values
kf = model_selection.StratifiedKFold(n_splits=5)
for f, (t,v) in enumerate(kf.split(X=df... | tankasalamanisha/supervised-learning | project_mnist/src/create_folds.py | create_folds.py | py | 464 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pandas.read_csv",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.StratifiedKFold",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection",
"line_number": 15,
"usage_type": "name"
}
] |
10658533474 | import os
from conan import ConanFile
from conan.tools.cmake import CMakeToolchain, CMake
from conan.tools.files import apply_conandata_patches, rmdir
from conan.tools.system.package_manager import Apt
from conans.tools import get, remove_files_by_mask
class VtkConan(ConanFile):
name = "vtk"
version = "9.1.0"... | paulharris/conan-vtk | conanfile.py | conanfile.py | py | 18,989 | python | en | code | null | github-code | 18 | [
{
"api_name": "conan.ConanFile",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "conans.tools.get",
"line_number": 152,
"usage_type": "call"
},
{
"api_name": "conans.tools.remove_files_by_mask",
"line_number": 176,
"usage_type": "call"
},
{
"api_name": "o... |
1874117888 | from dataclasses import dataclass
from typing import List, Optional
import pandas as pd
from app.models import cypher_diagram_models
from app.utils import hex_to_rgb
from app.utils.meta_graph import (
color_palette,
line_color_dict,
meta_node_def,
meta_rel_explore_url,
)
from app.utils.visjs_config im... | MRCIEU/epigraphdb_web | backend/app/funcs/cypher_diagram.py | cypher_diagram.py | py | 3,913 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "app.utils.meta_graph.color_palette",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "ap... |
2118746570 | from json import dumps
from flask import Flask,Response, request
from neo4j import GraphDatabase, basic_auth
import string
import random
app = Flask(__name__)
url = "bolt://localhost:7687"
username = ""
password = ""
driver = GraphDatabase.driver(url, auth=basic_auth(username, password))
def get_db():
return dr... | GiovanniGiacometti/neo4j-ui | contact-tracing.py | contact-tracing.py | py | 12,873 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "flask.Flask",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "neo4j.GraphDatabase.driver",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "neo4j.GraphDatabase",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "neo4j.basic... |
4441827876 | import discord
from discord.ext import commands
import traceback
from configparser import ConfigParser
from utils.utils import con
parser = ConfigParser()
parser.read('config.ini')
try:
logchannel = int(parser.get('CONFIG', 'log_channel'))
except Exception as e:
print(f"Couldn't define logchannel: {e}")
lo... | Smudge-Studios/HypixelBot | events/commanderror.py | commanderror.py | py | 2,995 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "configparser.ConfigParser",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "discord.ext.commands.Cog",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "discord.ext.commands",
"line_number": 15,
"usage_type": "name"
},
{
"api_n... |
24468794484 | from __future__ import absolute_import
from __future__ import print_function
import os,sys,codecs,numpy as np,random,imp,time,random
#try:
#import ujson as json
import simplejson as json
#except ImportError:
# import json
from datetime import datetime as dt
import unicodecsv as csv
from collections import defaultdi... | quadrismegistus/slingshot | mpi_slingshot/slingshot.py | slingshot.py | py | 22,034 | python | en | code | 3 | github-code | 18 | [
{
"api_name": "config.CONFIG.get",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "config.CONFIG",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "config.CONFIG.get",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "config.CONFIG",
... |
35911895875 | import torch
import torch.nn as nn
class NeuralNetwork(torch.nn.Module):
def __init__(
self, hidden_layers=[20, 20], dim_in=2,
dim_out=1, activation=torch.tanh):
'''Initialiser method for Neural Network
Args:
'''
super().__init__() # Call from superclass
... | mmadianos/ANN--PDE-solver | main/model.py | model.py | py | 841 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "torch.nn",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "torch.tanh",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "torch.nn.ModuleList",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_... |
2313986697 | # This file will need to use the DataManager, FlightSearch, FlightData, NotificationManager
# classes to achieve the program requirements.
from data_manager import DataManager
from flight_search import FlightSearch
from notification_manager import NotificationManager
import dotenv
import os
dotenv.load_dotenv()
API_... | Abhilash-Bee/flight-search-project | main.py | main.py | py | 1,103 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "dotenv.load_dotenv",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "data_manager.DataManager",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "flight_search.F... |
32827229741 | import sys
import yaml
from fitter.storage.s3 import S3Storage
from fitter.utils.print import eprint
class _CacheStoreConfig:
_class = 'cache_store'
def as_dict(self):
return self.__dict__
class InMemoryCacheStoreConfig(_CacheStoreConfig):
def __init__(self, **kwargs):
self.TYPE = 'in... | mingrammer/fitter | config.py | config.py | py | 6,403 | python | en | code | 10 | github-code | 18 | [
{
"api_name": "fitter.storage.s3.S3Storage.is_valid_region",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "fitter.storage.s3.S3Storage",
"line_number": 52,
"usage_type": "name"
},
{
"api_name": "fitter.utils.print.eprint",
"line_number": 53,
"usage_type": "cal... |
27863606771 | import os
import albumentations as albu
import detectron2.data.transforms as T
import detectron2.utils.comm as comm
import wandb
from detectron2.config.config import get_cfg
from detectron2.data import MetadataCatalog, build_detection_train_loader
from detectron2.data.catalog import DatasetCatalog
from detectron2.data... | MamatShamshiev/ai-train | src/train_dt2.py | train_dt2.py | py | 5,199 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "detectron2.engine.defaults.DefaultTrainer",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "os.path.join",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 34,
"usage_type": "attribute"
},
{
"api_name": "d... |
8341254661 | # -*- coding: utf-8 -*-
"""
LightTwinSVM Program - Simple and Fast
Version: 0.2.0-alpha - 2018-05-30
Developer: Mir, A. (mir-am@hotmail.com)
License: GNU General Public License v3.0
Module: setup.py
Building C++ extension module for Windows OS using Cython
Externel dependencies:
- Armadillo C++ Linear Agebra Library... | mir-am/LIBTwinSVM | libtsvm/optimizer/setup.py | setup.py | py | 3,746 | python | en | code | 17 | github-code | 18 | [
{
"api_name": "ctypes.util.find_library",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "sys.platform",
"line_number": 45,
"usage_type": "name"
},
{
"api_name": "sys.platform",
"li... |
30450676530 | import matplotlib.pyplot as plt
import os
import sys
sys.path.append(os.path.abspath("../../Python02/ex03"))
from csvreader import *
import numpy as np
class KmeansClustering:
def __init__(self, max_iter=20, ncentroid=5):
self.ncentroid = ncentroid # number of centroids
self.max_iter = max_iter # number of max ... | thoberth/Python-Module-42 | Python03/ex04/Kmeans.py | Kmeans.py | py | 3,731 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "sys.path.append",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number... |
40045282624 | from __future__ import annotations
import unittest
import subprocess
import shutil
import pathlib
from tests.support import *
class TestCommandLine(unittest.TestCase):
# Sources to test: normal dry_run force backup filter update python_folder
# - single dyn file ... | infeeeee/dyn2py | tests/test_CommandLine.py | test_CommandLine.py | py | 8,975 | python | en | code | 3 | github-code | 18 | [
{
"api_name": "unittest.TestCase",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "subprocess.run",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "subprocess.run",
"line_number": 63,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
... |
17918967216 | import pickle
import numpy as np
import pandas as pd
import torch
import torch.nn as nn
import torch.optim as optim
from torch.utils.data import DataLoader
from albumentations import Compose, ShiftScaleRotate, GridDistortion
from albumentations.pytorch import ToTensor
from utils import prepare_data, AudioDataset, Ta... | sainathadapa/dcase2019-task5-urban-sound-tagging | 03-train-system-1.py | 03-train-system-1.py | py | 5,724 | python | en | code | 30 | github-code | 18 | [
{
"api_name": "pickle.load",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pandas.merge",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "pandas.concat",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "pandas.concat",
"line_numb... |
29951490614 | #!/usr/bin/env python
# encoding=utf-8
# maintainer: rgaudin
import sys
import locale
import logging
from nosmsd.utils import import_path
from nosmsd.database import Inbox
from nosmsd.settings import settings as nosettings
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
handler = logging.StreamHa... | yeleman/nosmsd | nosmsd/nosmsd_incoming.py | nosmsd_incoming.py | py | 2,011 | python | en | code | 4 | github-code | 18 | [
{
"api_name": "logging.getLogger",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "logging.StreamHandler",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "nosmsd.set... |
38907807961 | # weather/service.py
import socket
import json
import sys
from . import configurator as config
from .geocoder import Place, PlaceNotFound
from .station import find_nearest_station
class WeatherServiceRequest:
def __init__(self, bytes_arr):
self._data = decode(bytes_arr)
@property
def city(self):
... | jgf-osu/CS361-public | weather/service.py | service.py | py | 2,808 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "geocoder.PlaceNotFound",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "geocoder.Place",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "station.find_nearest_station",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "sy... |
11716039890 | from django.urls import path
from . import views
urlpatterns = [
path('news', views.news_list, name='news'),
path('', views.index_list, name='index'),
path('entertainment', views.entertainment_list, name='entertainment'),
path('sports', views.sports_list, name='sports'),
path('world_news', views.w... | zeriky/Olofofo | Olofofo/urls.py | urls.py | py | 433 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
12798175683 | import boto3
import requests
import json
import pprint
SECRET_NAME = 'fitbit'
REGION_NAME = 'us-west-1'
DATE = '2021-12-04' # I ran this day by using running mode, so GPS should have worked
PERIOD = '1d'
# RESOURCE = 'steps'
# RESOURCE = 'calories' # Calories burned
RESOURCE = 'distance'
RESPONSE_JSON = f'data/acti... | yukikitayama/fitbit | get_activity_time_series_by_date.py | get_activity_time_series_by_date.py | py | 1,486 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "boto3.session.Session",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "boto3.session",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "json.loads",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "requests.request"... |
24177311468 | # Create fastq files as simulated reads output
# Start from half-sampled reads coordinates
#BAMfile_halfsampled_coordinates.txt
## JOBS:
## For each referenced peak region, find shift length from true peak
## Write mates for each read, and fill in read end position
## Separate read1 and read2
## Input true and ref pe... | Dominic7227/scReadSim_source | 10x_scRNA-seq/Synthetic data generation/NOINPUT_RNA_GenerateBAMCoord_20221011_UMITranscriptLevel2.py | NOINPUT_RNA_GenerateBAMCoord_20221011_UMITranscriptLevel2.py | py | 13,305 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pandas.options",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "collections.Iterable",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "random.choice",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "numpy.sum... |
33656559521 | from django.db import models
from django.utils.dateformat import *
from django.utils import timezone
import re
# Create your models here.
class Block(models.Model):
position = models.IntegerField(
verbose_name='Позиция',
null=True,
blank=True
)
title = models.CharField(
... | ezra-wick/school | main/models.py | models.py | py | 3,608 | python | en | code | 1 | github-code | 18 | [
{
"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.IntegerField",
"line_number": 9,
"usage_type": "call"
},
{
"api_name"... |
4329593105 | #Import statements
from datetime import datetime
from block import Block
from transaction import Transaction
from transaction_list import TransactionList
from util import *
import hashlib
import json
#Blockchain object declaration
class Blockchain:
def __init__(self):
self.genesis_block = self.create_genes... | gbburleigh/Marketbox | MarketCoin/common/blockchain.py | blockchain.py | py | 3,185 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "transaction_list.TransactionList",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 21,
"usage_type": "name"
},
{
"api_name... |
23291230775 | import argparse
import os
import time
import numpy as np
import torch
import torch.backends.cudnn as cudnn
from torch.cuda.amp import autocast
from torch.utils.data import DataLoader
from tqdm import tqdm
from checkpoints import EarlyStopping, load_checkpoint
from data import ClusterDataset, parse_data_structure
from... | 742617000027/deep-feature-clustering | train.py | train.py | py | 7,502 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "model.eval",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "torch.no_grad",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "tqdm.tqdm",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "hparams.hparams.training",
"li... |
41767972072 | import os
from setuptools import setup, find_packages
requires = [
'setuptools',
'Pillow',
'ptah >= 0.2.1',
]
setup(name='ploud.themegallery',
version='0.1dev',
description='ploud theme gallery',
classifiers=[
"Programming Language :: Python",
"Topic :: Internet ... | cleder/ploud.themegallery | setup.py | setup.py | py | 836 | python | en | code | null | github-code | 18 | [
{
"api_name": "setuptools.setup",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "setuptools.find_packages",
"line_number": 23,
"usage_type": "call"
}
] |
74598491561 | from discord.ext.commands import Cog
from discord.ext.commands import command
from discord.utils import get
from discord import Embed
class Roles(Cog):
def __init__(self, bot):
self.bot = bot
@Cog.listener()
async def on_ready(self):
if not self.bot.ready:
self.bot.cogs_ready.ready_up("roles")
... | lona9/pececito | lib/cogs/roles.py | roles.py | py | 4,545 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "discord.ext.commands.Cog",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "discord.ext.commands.Cog.listener",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "discord.ext.commands.Cog",
"line_number": 10,
"usage_type": "name"
},
{
... |
18698392025 | import os
import re
import glob
import argparse
from math import sqrt
from config import get_settings, write_test_log, on_finish_test
from utils import write_json
from label_wav_syllable_test import get_cdf
from phoneme import get_syllable
*_, settings = get_settings()
training_set_settings = settings['training_set_s... | msn9110/ezTalk-server | label_for_test_v7.py | label_for_test_v7.py | py | 11,474 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "config.get_settings",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 38,
"usage_type": "attribute"
},
{
"api_name": "label_wav.AcousticModels",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "os.maked... |
16094267656 | from setuptools import setup, find_packages
long_description = open('README.md').read()
with open('requirements.txt') as f:
requirements = f.read().splitlines()
version = '0.2.0'
setup(
name='HuBMAPy',
version=version,
url='https://github.com/ccb-hms/HuBMAPy',
description='A package to query th... | ccb-hms/HuBMAPy | setup.py | setup.py | py | 1,096 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "setuptools.setup",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "setuptools.find_packages",
"line_number": 22,
"usage_type": "call"
}
] |
3147300347 | import requests
import random
steamApiKey = "YOUR-STEAM-API-KEY"
steamID = "YOUR-STEAM-USER-ID"
#Steam API link formatting for "GetOwnedGames"
slink1 = "https://api.steampowered.com/IPlayerService/GetOwnedGames/v0001/?key="
slink2 = "&steamid=" + steamID + "&include_appinfo=1&format=json"
slink = slink1 + steamApiKey... | Geezam/SteamApiPython | SteamApi.py | SteamApi.py | py | 1,124 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "requests.get",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "random.sample",
"line_number": 39,
"usage_type": "call"
}
] |
7591562324 | import ast
from oslo_log import log
from oslo_utils import strutils
from oslo_utils import uuidutils
import six
import webob
from webob import exc
from manila.api import common
from manila.api.openstack import wsgi
from manila.api.views import shares as share_views
from manila import db
from manila import exception
f... | suhaibchishti/sample_scripts | manila/api/v1/shares.py | shares.py | py | 11,896 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "oslo_log.log.getLogger",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "oslo_log.log",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "manila.api.openstack.wsgi.Controller",
"line_number": 23,
"usage_type": "attribute"
},
{
"api... |
28102597128 | import cv2, os
class FaceDetector(object):
def __init__(self, xml_path):
self.classifier = cv2.CascadeClassifier(xml_path)
def detect(self, image, biggest_only=True):
scale_factor = 1.2
min_neighbors = 5
min_size = (10, 10)
faces_coord = self.classifier.detectMultiScale... | shiningsunnyday/yang | yang/detect_yang/process_faces.py | process_faces.py | py | 2,417 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "cv2.CascadeClassifier",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "cv2.CASCADE_SCALE_IMAGE",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "cv2.resize",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "cv2.INTE... |
40985378273 | #----------------------------------------
#
# Author Perry Evans
# evansjp@mail.med.upenn.edu
# 2008
#
#----------------------------------------
"""
Functions here help with network loading,
printing, and searching.
"""
import sys
from collections import defaultdict
def getNodes(afile):
""" Make a {... | samesense/bio_tools | utils_graph.py | utils_graph.py | py | 13,145 | python | en | code | 3 | github-code | 18 | [
{
"api_name": "collections.defaultdict",
"line_number": 366,
"usage_type": "call"
}
] |
37340067815 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
__doc__ = """
Part of the MSFC ART-XC analysis package.
This script takes an image file and compute
based on a given event file. \n
Currently calculate on a box with a given RA/DEC range that can be specified.\n
Since Eulerian distance is used instead of angular distance,... | CTJChen/martxc | martpoisson.py | martpoisson.py | py | 3,185 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "numpy.random.poisson",
"line_number": 74,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 74,
"usage_type": "attribute"
},
{
"api_name": "astropy.io.fits.open",
"line_number": 78,
"usage_type": "call"
},
{
"api_name": "astropy.i... |
71427409960 | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
seed = 13
np.random.seed(seed)
import os
os.listdir('/kaggle/input/bitsf312-lab1')
df = pd.read_csv("/kaggle/input/bitsf312-lab1/train.csv", sep=",")
df_test = pd.read_csv("/kaggle/input/bitsf312-lab1/test.csv", sep=",")... | aorursy/new-nb-3 | ishitamed_kernel52effce624.py | ishitamed_kernel52effce624.py | py | 13,661 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "numpy.random.seed",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "os.listdir",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
... |
74793275558 | from math import radians, cos, sin, asin, sqrt
from zerver.lib import avatar
from zerver.models import UserProfile, ZgDepartmentAttendance, ZgAttendance, ZgPurchase, JobsPlease, ProjectProgress, \
ZgLeave, ZgReview, ZgReimburse, ZgWorkNotice, Attachment, ZgCorrectzAccessory
from django.http import JsonResponse
impo... | ty-xy/zg13 | zerver/views/zg_tools.py | zg_tools.py | py | 10,055 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "datetime.datetime.utcnow",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "datetime.timezone.utc",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": ... |
25120212954 | from django.db import migrations, transaction
from client.models import Client
from delivery_location.models import DeliveryLocation
from supplier_product.models import SupplierProduct
from product.models import Product
from supplier.models import Supplier
from ordered_product.models import OrderedProduct
import dateti... | redhat-beyond/BuyTogether | ordered_product/migrations/0002_test_data.py | 0002_test_data.py | py | 2,612 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "django.db.transaction.atomic",
"line_number": 23,
"usage_type": "call"
},
{
... |
35595266733 | import sqlite3
import csv
def initialize(file):
'''
Initializes the database for the preset food data table and the internal tables for ingredients and meals.
:param file: CSV File provided for the preset food data table
:return: None
'''
# Open CSV-File for reading standard food table data
... | silviomarx/tracknut | database/initialize.py | initialize.py | py | 1,498 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "csv.reader",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "sqlite3.OperationalError",
"line_number": 26,
"usage_type": "attribute"
}
] |
14158242377 | from django.urls import path, re_path
from . import views
urlpatterns = [
# 首頁
re_path(r'^$', views.post_list),
# path('', views.post_list, name='post_list'),
# 已發佈文章
re_path(r'^post/(?P<pk>[0-9]+)/$', views.post_detail, name='post_detail'),
# path('post/<int:pk>/', views.post_detail, name='po... | z-zora0331/djangogirls | blog/urls.py | urls.py | py | 1,323 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "django.urls.re_path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.urls.re_path",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.urls.re_path",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "django.url... |
8830369201 | """This module contains the library utilities and the bindings
to all the C functions
"""
import ctypes
import logging
import os
import time
from ctypes import c_double
from ctypes import c_int
from ctypes import c_long
from ctypes import c_uint8
from ctypes import c_void_p
from pathlib import Path
import numpy as np
... | hkjeldsberg/ap_features | src/python/ap_features/lib.py | lib.py | py | 2,470 | python | en | code | null | github-code | 18 | [
{
"api_name": "logging.getLogger",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.ctypeslib.load_library",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "numpy.cty... |
43246000468 | import time
import os
import numpy as np
import cPickle as pickle
import theano.tensor as T
from lasagne.layers import InputLayer
import opt.sgd.train
import opt.sgd.updates
from sklearn.metrics import roc_auc_score
from datasets.main import load_dataset
from utils.monitoring import performance
from utils.misc import... | GRSEB9S/deepSVDD | src/neuralnet.py | neuralnet.py | py | 32,952 | python | en | code | 7 | github-code | 18 | [
{
"api_name": "utils.patches.patch_lasagne",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "datasets.main.load_dataset",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "config.Configuration.learning_rate.get_value",
"line_number": 68,
"usage_type": "c... |
69805344359 | #!/usr/bin/env python
LICENSE="""
Copyright (C) 2011 Michael Ihde
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This progra... | maihde/quant | config.py | config.py | py | 1,817 | python | en | code | 273 | github-code | 18 | [
{
"api_name": "os.path.expanduser",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "pycommando.commando.command",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "os.path.j... |
26191034799 | from ...language.base import parse
from ...utils.ast_to_code import ast_to_code
from ..compiled import GraphQLCompiledDocument
from .schema import schema
def test_compileddocument_from_module_dict():
# type: () -> None
document_string = "{ hello }"
document_ast = parse(document_string)
document = Grap... | graphql-python/graphql-core-legacy | graphql/backend/tests/test_compileddocument.py | test_compileddocument.py | py | 1,692 | python | en | code | 377 | github-code | 18 | [
{
"api_name": "language.base.parse",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "compiled.GraphQLCompiledDocument.from_module_dict",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "schema.schema",
"line_number": 12,
"usage_type": "argument"
},
... |
20537529052 | # -*- coding: utf-8 -*-
"""
Created on Sat Feb 9 07:11:16 2019
Checks the randomness of interger pseudo-random number generators
@author: Thomas
"""
import numpy as np
import matplotlib.pyplot as plt
import math
numbers = input("Input numbers as follows: 1,2,3...")
data = numbers.split(",")
data_len =... | tautomeric/Projects_python | randomcheck.py | randomcheck.py | py | 1,701 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "numpy.array",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "numpy.max",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "numpy.mean",
"line_number": 37,... |
5996174361 | import numpy as np
import matplotlib.pyplot as plt
gauss_samples=1000
n_points=1000
a,b=0,1
uniform_matrix=np.random.uniform(a,b,(gauss_samples,n_points));
gaussians=np.mean(uniform_matrix,axis=0)
plt.hist(gaussians)
plt.show()
| Sourav1429/Python_coding | Central_limit_theorem.py | Central_limit_theorem.py | py | 241 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "numpy.random.uniform",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "numpy.mean",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.hist... |
39799435359 | from terminaltables import SingleTable
from vendingmachineworks import print_inventory
from term_io import y_or_n as yes_or_no
from account_manage import account
import term_io
# from press_any_key import press_any_key_to_continue
def cal_att(team):
if len(team) == 0:
return [0] * 5
attribute_table =... | GaryDoooo/emoji_game | team.py | team.py | py | 2,801 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "terminaltables.SingleTable",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "terminaltables.SingleTable",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "vendingmachineworks.print_inventory",
"line_number": 62,
"usage_type": "call"
},
... |
29985153371 | """
Written by Jonny Hyman, 2020
www.jonnyhyman.com
www.github.com/jonnyhyman
MIT License
This code renders the logistic map and zooms in to show its fractal nature.
There is also infrastructure to plot rulers and labels where each bifurcation
occurs; to hint at the emerging feigenbau... | jonnyhyman/Chaos | logistic_zoom.py | logistic_zoom.py | py | 13,325 | python | en | code | 1,800 | github-code | 18 | [
{
"api_name": "pathlib.Path",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "numpy.empty",
"line_number": 96,
"usage_type": "call"
},
{
"api_name": "numpy.float64",
"line_number": 96,
"usage_type": "attribute"
},
{
"api_name": "numpy.linspace",
"lin... |
37067543911 | """A module for looking for nearby obs. in lat/long and time space.
This module uses a driver function in conjunction with multiprocessing to find
observations in a DataFrame that are within a certain distance and time period
from a given observation. Distance is defined as plus/minus some distance in
lat/long spa... | sallamander/forest-fires | code/feature_engineering/geo_featurization.py | geo_featurization.py | py | 17,068 | python | en | code | 42 | github-code | 18 | [
{
"api_name": "multiprocessing.Pool",
"line_number": 74,
"usage_type": "call"
},
{
"api_name": "multiprocessing.cpu_count",
"line_number": 74,
"usage_type": "call"
},
{
"api_name": "functools.partial",
"line_number": 75,
"usage_type": "call"
},
{
"api_name": "nump... |
15506093875 | import pytest
from keywords.MobileRestClient import MobileRestClient
from libraries.testkit.cluster import Cluster
from requests import Session
from keywords.utils import log_info
from keywords.SyncGateway import SyncGateway
from keywords.SyncGateway import sync_gateway_config_path_for_mode
from utilities.cluster_conf... | couchbaselabs/mobile-testkit | testsuites/syncgateway/functional/tests/test_changes.py | test_changes.py | py | 3,990 | python | en | code | 14 | github-code | 18 | [
{
"api_name": "keywords.SyncGateway.sync_gateway_config_path_for_mode",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "pytest.skip",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "utilities.cluster_config_utils.copy_to_temp_conf",
"line_number": 44,
... |
4669081691 | import matplotlib.pyplot as plt
import numpy as np
from tqdm import tqdm
# Parameters
n_action = 20 # Even number
n_observation = n_action # Even number
eps = 0.1 # prior count (small: white paper, large: stick to the prior)
temperature = 1
n_trial = 300
# Environment
def env_prob(action, is_deterministic=False):
... | ugo-nama-kun/kl-exploration | main.py | main.py | py | 2,175 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "numpy.random.choice",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "numpy.random.choice",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "numpy.rando... |
70787649961 | import logging
import math
import json
from heapq import heappush
from components.disk import Disk
from components.rack import Rack
from policies.policy import Policy
from helpers.common_math import ncr
from .pdl import slec_local_dp_pdl
from .repair import slec_local_dp_repair
class SLEC_LOCAL_DP(Policy):
#----... | ucare-uchicago/mlec-sim | src/policies/slec_local_dp/slec_local_dp.py | slec_local_dp.py | py | 12,611 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "policies.policy.Policy",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "components.disk.Disk.EVENT_FAIL",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "components.disk.Disk",
"line_number": 27,
"usage_type": "name"
},
{
"... |
3087130520 | """
Purpose: Declare schema for order's item model.
"""
from django.db import models
from django.core.validators import MinValueValidator
from utils.models import TimeStampMixin
from core.models import Order, MenuItem
class OrderItemManager(models.Manager):
def bulk_create(self, objs, batch_size=None, ignor... | raviteja2250/tabletop-backend-develop | core/models/order_item.py | order_item.py | py | 2,107 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "django.db.models.Manager",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "utils.models.TimeStampMixin",
"line_number": 22,
"usage_type": "name"
},
{
"api_na... |
71210619559 | import sys
import os
import re
import os.path
import shutil
import glob
import stat
import subprocess
import logging
import time
log=logging.getLogger(__name__)
import cpc.util
class IterateError(cpc.util.CpcError):
pass
class iterations:
"""Decide what inputs to iterate over, given a set of inputs."""
... | gromacs/copernicus | cpc/lib/gromacs/iterate.py | iterate.py | py | 3,514 | python | en | code | 17 | github-code | 18 | [
{
"api_name": "logging.getLogger",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "cpc.util.util",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "cpc.util",
"line_number": 17,
"usage_type": "name"
}
] |
35523968107 | import numpy as np
import matplotlib.pyplot as plt
from scipy.interpolate import make_interp_spline
def sigmoid(x):
"""
sigmoid函数
Param:
x: 输入
Return:
y: 对应的sigmoid函数值
"""
y = 1./(1+np.exp(-x))
return y
def mse(x, y):
"""
计算均方误差
Param:
... | JaceyHuang/ISEE-zju | 大三下/人工智能实验/lab7/nn.py | nn.py | py | 4,129 | python | en | code | 16 | github-code | 18 | [
{
"api_name": "numpy.exp",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "numpy.dot",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "numpy.dot",
"line_number": 65,
... |
20984128233 |
# coding: utf-8
# In[8]:
import csv
txt_file=r"SemEval2018-T3-train-taskA_emoji_ironyHashtags.txt"
csv_file=r"data1.csv"
in_txt= csv.reader(open(txt_file,'r',errors='ignore'),delimiter='\t')
out_csv=csv.writer(open(csv_file,'w'))
out_csv.writerows(in_txt)
# In[22]:
import emoji
import re
import nltk
from nltk.t... | Sharath-Ramachandran/IR-Project | Project.py | Project.py | py | 867 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "csv.reader",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "csv.writer",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "emoji.demojize",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 25,
... |
32779256372 | from django.db import models
from django.conf import settings
from django.utils.translation import gettext_lazy as _
from polymorphic.models import PolymorphicModel
# from djmoney.models.fields import MoneyField
# from djmoney.money import Money
# from djmoney.models.validators import MaxMoneyValidator,MinMoneyValidat... | shady-elnady/Nady_Django | Payment/models.py | models.py | py | 6,848 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "GraphQL.models.BaseModelNative",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "django.db.models.CharField",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "django.db.models",
"line_number": 20,
"usage_type": "name"
},
{
"api_na... |
4115834771 | """Este modulo desarrolla una API del núcleo de la aplicación"""
# Conexiones por arquitectura
import ibmq_chemical_core
import ibmq_chemical_comun
# Dependencias
from ibmq_chemical_api import la_api
from flask import Response, abort, request
import json
# Recursos comunes
@la_api.route("/servidores", methods=["GE... | Albertojuanse/ibmq_chemical_core | ibmq_chemical_api/api.py | api.py | py | 3,785 | python | es | code | 1 | github-code | 18 | [
{
"api_name": "ibmq_chemical_core.orquestador.obtener_backends",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "ibmq_chemical_core.orquestador",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "flask.Response",
"line_number": 24,
"usage_type": "ca... |
22745916662 | from sklearn.preprocessing import MinMaxScaler, StandardScaler, MaxAbsScaler, RobustScaler
from sklearn.model_selection import train_test_split
import numpy as np
from torch.utils.data import TensorDataset, DataLoader
import torch
def get_scaler(scaler):
scalers = {
"minmax": MinMaxScaler,
"standar... | liukts/tskone-eeg | data_utils.py | data_utils.py | py | 1,862 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "sklearn.preprocessing.MinMaxScaler",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "sklearn.preprocessing.StandardScaler",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "sklearn.preprocessing.MaxAbsScaler",
"line_number": 11,
"usage_typ... |
38579988342 | from lyricsgenius import Genius
from requests.exceptions import HTTPError, Timeout
import json
keyjson = json.load(open("keys.json", "r"))
key = keyjson["genius-access"]
genius = Genius(key)
search_term = input("search...")
songsearch = genius.search_songs(search_term)
hits = songsearch["hits"]
c = 0
for hit in hi... | TrvsF/song-sentiment-comparer | src/tests/genius.py | genius.py | py | 1,428 | python | en | code | 5 | github-code | 18 | [
{
"api_name": "json.load",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "lyricsgenius.Genius",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "requests.exceptions.HTTPError",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "requests.ex... |
1091973664 | #!/usr/bin/python
"""
Module to test RO manager manifest and aggregation commands
See: http://www.wf4ever-project.org/wiki/display/docs/RO+management+tool
"""
__author__ = "Graham Klyne (GK@ACM.ORG)"
__copyright__ = "Copyright 2011-2013, University of Oxford"
__license__ = "MIT (http://opensource.org/lice... | wf4ever/ro-manager | src/rocommand/test/TestManifest.py | TestManifest.py | py | 12,846 | python | en | code | 16 | github-code | 18 | [
{
"api_name": "logging.getLogger",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "sys.path.insert",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "sys.path.insert",
... |
18787315522 | """
This project takes an image from the computer's hard drive, finds the faces in the image, then swaps the faces if two faces are found!
Version 2:
This version uses code adapted from pysource's face swap method using Delaunay triangulation
https://pysource.com/2019/05/28/face-swapping-explained-in-8-steps-opencv-wi... | kirapeters/face_swap | prj_images.py | prj_images.py | py | 9,902 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "numpy.zeros",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "numpy.uint8",
"line_number": 39,
"usage_type": "attribute"
},
{
"api_name": "cv2.imread",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_numb... |
11172294051 | import hashlib
import json
from dojo.models import Finding
class RetireJsParser(object):
def get_scan_types(self):
return ["Retire.js Scan"]
def get_label_for_scan_types(self, scan_type):
return "Retire.js Scan"
def get_description_for_scan_types(self, scan_type):
return "Retire... | DefectDojo/django-DefectDojo | dojo/tools/retirejs/parser.py | parser.py | py | 2,884 | python | en | code | 3,128 | github-code | 18 | [
{
"api_name": "json.load",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "hashlib.md5",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "dojo.models.Finding",
"line_numb... |
14115275102 | import datetime
import enum
import ipaddress
from cnaas_nac.db.session import sqla_session
from sqlalchemy import Column, Integer, Unicode, UniqueConstraint
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
class NasPort(Base):
__tablename__ = 'nas_port'
__table_args__ = (
... | SUNET/cnaas-nac | src/cnaas_nac/db/nas.py | nas.py | py | 2,838 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "sqlalchemy.ext.declarative.declarative_base",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.UniqueConstraint",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 19,
"usage_type": "call"
},
... |
22338661493 | import csv, requests, bs4
s=requests.get('https://clutch.co/web-designers')
a=bs4.BeautifulSoup(s.text, "html.parser")
b=a
company_name=b.select('.company-name .field-content a')
tagline=a.select('.col-xs-12 .tagline')
i=0
t=0
while t<len(tagline) and i<len(company_name):
name1=company_name[i].getText()
print('... | vermillion23/all | python/parser.py | parser.py | py | 436 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "requests.get",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 3,
"usage_type": "call"
}
] |
33557656194 | import logging
import argparse
import ast
from collections import OrderedDict
import torch
import os
from datetime import datetime
import numpy as np
import json
irange = range
import networkx as nx
def mylogger(logpath='./param.log'):
logger = logging.getLogger('mylogger')
logger.setLevel('DEBUG... | zhouxiaowei1120/Co-Pooling | src/myutils.py | myutils.py | py | 11,243 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "logging.getLogger",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "logging.Formatter",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "logging.FileHandler",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "logging.Strea... |
12127760434 | import sqlite3
import csv
from io import StringIO
import o9k.o9k_utils.utils as utils
import requests
from bs4 import BeautifulSoup
DEBUG = True
NULL = "NULL"
DATABASE = "over9000.db"
USERS_TABLE = "USERS"
RESULTS_TABLE = "RESULTS"
USER_HEADERS = ["ID", "NAME", "CSV", "SOCIALS", "TEAM"]
RESULTS_HEADERS = ["Name", "S... | fueg0/over9000 | o9k/database/db.py | db.py | py | 8,754 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "sqlite3.connect",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 128,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 131,
"usage_type": "call"
},
{
"api_name": "requests.get",
"... |
39924961443 | from datetime import *
import xml.etree.ElementTree as ET
resdict={}
tree = ET.parse('orders.xml')
root = tree.getroot()
n=len(root)
it=datetime.now()
print("Processing started at: ",it)
initialtimestamp=it.timestamp()
for i in range(n):
p=root[i].attrib['book']
if p in resdict.keys():
i... | Chethan-30/Aurodigitaltest | orders.py | orders.py | py | 2,088 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "xml.etree.ElementTree.parse",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "xml.etree.ElementTree",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "datetime.now",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "datetime.... |
40755649579 | import datetime
from email.Header import Header
from twisted.mail import smtp
from twisted.mail import relaymanager
from twisted.internet import protocol
from twisted.internet import reactor
from twisted.internet import defer
from twisted.internet import threads
from twisted.application import internet
from twisted.ent... | hcvst/mailreactor | mailreactor.py | mailreactor.py | py | 8,031 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "twisted.enterprise.adbapi.ConnectionPool",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "twisted.enterprise.adbapi",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "twisted.mail.relaymanager.MXCalculator",
"line_number": 19,
"usage_typ... |
35882827732 | import re
import feedparser
RSS_URL = 'http://blog.rss.naver.com/saskinio'
def release_rss_crawl(version):
versions = []
content = feedparser.parse(RSS_URL)
for feed in content.entries:
if feed.category == '릴리즈':
versions.append([re.sub('[^0-9.]', '', feed.title).strip(), feed.link])
... | rheehot/sesm | version_crawler.py | version_crawler.py | py | 819 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "feedparser.parse",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "feedparser.parse",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 2... |
23326440181 | import logging
log = logging.getLogger(__name__)
class StubParser(object):
def parse(self, body, url_args):
pass
def update_args(self, payload, url_args):
args = payload.get('args', {})
args.update(url_args)
payload['args'] = args
return payload
class JSONStubParser... | romeuflores/mirage | stubo/model/stub_parser.py | stub_parser.py | py | 2,989 | python | en | code | null | github-code | 18 | [
{
"api_name": "logging.getLogger",
"line_number": 3,
"usage_type": "call"
}
] |
8025365270 | #读取配置文件config.ini
import configparser
import os
path = os.path.join(os.path.dirname(os.path.split(os.path.realpath(__file__))[0]),"conf")#获取项目绝对路径
path1 = os.path.dirname(path)
config_path = os.path.join(path,'config.ini')#在项目路径下加上config.ini的路径
conf = configparser.ConfigParser()#实例化ConfigParaser类
conf.read(config_path,... | yanwei111/-_api_test | conf/readConfig.py | readConfig.py | py | 916 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "os.path.join",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "os.path.split",
"line_numb... |
23149572850 | # aoc202111.py
import pathlib
import sys
def create_matrix(height, width):
return [[0 for i in range(width)] for j in range(height)]
def parse(puzzle_input):
"""Parse input"""
input = puzzle_input.split()
grid = create_matrix(len(input), len(input[0]))
for j,y in enumerate(input):
for i,x... | talvalin/adventofcode | 2021/11/aoc202111.py | aoc202111.py | py | 2,935 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "sys.argv",
"line_number": 106,
"usage_type": "attribute"
},
{
"api_name": "pathlib.Path",
"line_number": 108,
"usage_type": "call"
}
] |
14468684517 | from os import path
import requests
import pandas as pd
import env
BASE_URL = 'https://python.zach.lol'
API_BASE = BASE_URL + '/api/v1'
def get_store_data_from_api():
url = API_BASE + '/stores'
response = requests.get(url)
data = response.json()
return pd.DataFrame(data['payload']['stores'])
def get... | CodeupClassroom/bayes-methodologies-exercises | time_series/acquire.py | acquire.py | py | 3,286 | python | en | code | 5 | github-code | 18 | [
{
"api_name": "requests.get",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_n... |
37983884345 |
import tkinter as tk
import soundfile as sf
import sounddevice as sd
class Mixer:
"""
mixer class
"""
def __init__(self):
self.root = tk.Tk()
self.root.title("Matrix Multiplication")
self.root.geometry("600x200")
self.fs=44100
"""
Setting sampling Rate
... | finalyearProjct/math-visualisation | Documentation-Matrix Mixer/source/mixer.py | mixer.py | py | 4,697 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "tkinter.Tk",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "soundfile.read",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "soundfile.read",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "soundfile.read",
"line_n... |
74669770918 | import hashlib, os, requests, struct, wx, webbrowser
import winreg as reg
from bs4 import BeautifulSoup
# path = input("Enter file path")
# print("Remove same files")
class FilePro:
path = None
name = None
full_path = None
type = None
def __init__(self, path, name):
self.path = path
... | JerryLinLinLin/VirusTotalSmartScanner | main.py | main.py | py | 15,783 | python | en | code | 3 | github-code | 18 | [
{
"api_name": "hashlib.md5",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "hashlib.sha256",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number"... |
3493847588 | #!/usr/bin/env python
from __future__ import print_function
import click
import os
import time
import tqdm
from filestore import FileStore
import logging
DEFAULT_EXT = "pdf;png;jpg;txt"
def typefilter(f):
global EXTENSIONS
for ext in EXTENSIONS:
if f.lower().endswith(ext.lower()):
return ... | kbrafford/PrintWatcher | printd.py | printd.py | py | 2,256 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "os.path.join",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "os.getcwd",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 2... |
43770642007 | from __future__ import print_function
from __future__ import absolute_import
import os
import cv2
import random
import torch
import PIL.Image as Image
import numpy as np
from torchvision.utils import save_image
from config import settings
#random.seed(1385)
class all_voc_train():
"""Face Landmarks dataset."""
... | ZRT1998JULY/FESA | data/all_voc_train.py | all_voc_train.py | py | 5,472 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "random.Random",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 77,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 77,
"usage_type": "attribute"
},
{
"api_name": "PIL.Image.open",
"line_nu... |
15153300373 | #!/usr/bin/env python
#
# Available device: Liquid level sensor
# Manufacturer: AQUAS Inc.
# Product number: SMR02
# Serial communication protocol: RS485
# Purpose:
# Measure ground water level every 10 mins (Unit in meter)
#
# Including
from statistics import median
import minimalmodbus
import time
from time import g... | gtra389/modbus | LLS_modbus_taipei.py | LLS_modbus_taipei.py | py | 4,237 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "minimalmodbus.BAUDRATE",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "RPi.GPIO.setmode",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "RPi.GPIO",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "RPi.GPIO.BCM",
... |
33656368531 | import scipy.io
import pandas as pd
import subprocess
import os
mat = scipy.io.loadmat('imagelabels.mat')
print(mat['labels'][0])
for i in range(1,103):
process = subprocess.run(['mkdir', "flowerclasseddataset/" + str(i)])
directory = 'jpg/'
j = 0
for filename in sorted(os.listdir(directory)):
f = os.path.j... | emilyzhu23/CNN_project | matlabread.py | matlabread.py | py | 650 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "scipy.io.io.loadmat",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "scipy.io.io",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "scipy.io",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "subprocess.run",
"line... |
7281243930 | import discord, sqlite3, json, re, os, asyncio, aiohttp
from discord.ext import commands
from imgurpython import ImgurClient
class Owner(commands.Cog):
"""Exclusive commands for EliteBOY"""
def __init__(self, client):
self.client = client
@commands.command(hidden = True, aliases = ['imgur'])
@... | EliteB0Y/TESBot | cogs/owner.py | owner.py | py | 15,286 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "discord.ext.commands.Cog",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "discord.ext.commands",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "re.findall",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "discord.E... |
27186805454 | import json
from dataclasses import asdict
from falcon import Request, Response, falcon
from mmlp.data import Result
from mmlp.data.utils import DataclassJSONEncoder
from mmlp.manager import ResultManager
from mmlp.utils import get_params_to_query
SORT_ATTRIBUTES = ['id', 'name', 'description', 'license', 'origin', '... | magreiner/MMLP | backend/mmlp/endpoint/result/ResultCollection.py | ResultCollection.py | py | 1,937 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "mmlp.manager.ResultManager",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "mmlp.manager.ResultManager",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "falcon.Request",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "... |
31630881923 | # -*- coding: utf-8 -*-
""" A program to detect the encoding of an file """
# Importing chardet module
# It is universal encoding detector module of python
# Install it using pip install chardet
import chardet
# Creating a class for fetching the encoding of the file
class detect_encoding():
# Inintializing the f... | piyush546/Machine-Learning-Bootcamp | Data preprocessing and analytics/pandas and matplotlib/Encoding_fetcher.py | Encoding_fetcher.py | py | 760 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "chardet.detect",
"line_number": 16,
"usage_type": "call"
}
] |
11196630484 | from fastapi import FastAPI
from core.schemas.schema import Task, User
app = FastAPI()
@app.get("/tasks/{task_id}", response_model=Task)
async def read_task(task_id: int):
task = {"task_id": task_id, "task_name": "Ejemplo de artículo"}
return task
@app.post("/users/", response_model=User)
async def create_us... | MatiasColatto/FastAPI-Boilerplate | app/main.py | main.py | py | 353 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "fastapi.FastAPI",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "core.schemas.schema.Task",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "core.schemas.schema.User",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "core.... |
24230406615 | import streamlit as st
import pandas as pd
class ShowClasters:
def _display_content(self, df, cluster_count: int):
# Чтение данных из CSV строки
# df = pd.read_csv(pd.compat.StringIO(csv_data))
i = 0
grouped = df.groupby('cluster_id')
for cluster_id, group_data in groupe... | Baltsat/users-rosatom | pages_views/claster.py | claster.py | py | 862 | python | ru | code | 1 | github-code | 18 | [
{
"api_name": "streamlit.expander",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "streamlit.write",
"line_number": 20,
"usage_type": "call"
}
] |
16031469604 | from pathlib import Path
from django.apps import AppConfig, apps
from django.conf import settings
from django.conf.locale.en import formats as en_formats
from django.db.models import signals
from .constants import EDIT_ALL_GROUP_NAME, EDIT_ONLY_ASSETS_GROUP_NAME
class TomatoConfig(AppConfig):
default_auto_field... | dtcooper/tomato | server/tomato/apps.py | apps.py | py | 2,960 | python | en | code | 19 | github-code | 18 | [
{
"api_name": "django.apps.AppConfig",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "pathlib.Path",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "django.conf.settings.MEDIA_ROOT",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name"... |
16319894019 | #!/usr/bin/env python3.8
import os
import grpc
import pickle
import json
import logging
import asyncio
from pathlib import Path
from WDL import values_to_json
from WDL.Value import digest_env
import WDL.runtime.workflow as runtime
from services import routine_pb2, routine_pb2_grpc
from state import StateMachine
f... | perezja/routines | routines/controller.py | controller.py | py | 4,300 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "os.path.exists",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "logging.info",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.makedirs",
"line_numb... |
12934273469 | '''
Copied and modified from
https://github.com/pytorch/examples/blob/master/mnist/main.py
'''
import argparse
import numpy as np
import os
import statistics
import random
import time
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import torchvision.models as models
from... | ruipeterpan/cs759-sp21 | workloads/cv_benchmark.py | cv_benchmark.py | py | 22,458 | python | en | code | 7 | github-code | 18 | [
{
"api_name": "datetime.datetime.now",
"line_number": 59,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 59,
"usage_type": "name"
},
{
"api_name": "torch.cuda.amp.autocast",
"line_number": 63,
"usage_type": "call"
},
{
"api_name": "torch... |
7232759292 | import cv2
face_cascade = cv2.CascadeClassifier('haarcascade_frontalface_default.xml')
eye_cascade = cv2.CascadeClassifier('haarcascade_eye.xml')
cap = cv2.VideoCapture(0)
cap.set(3, 640) #WIDTH
cap.set(4, 480) #HEIGHT
blue = (255,0,0)
green = (0,255,0)
while(True):
# Capture frame-by-frame
re... | khashishin/Noc-Naukowc-w-2020 | python_opencv/3_opencv_facevideo.py | 3_opencv_facevideo.py | py | 2,391 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "cv2.CascadeClassifier",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "cv2.CascadeClassifier",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "cv2.VideoCapture",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColo... |
72263958441 | from django.shortcuts import render, redirect
from django.http import Http404
from django.contrib.auth import authenticate, login
from django.contrib.auth.decorators import login_required, user_passes_test
from django.utils import timezone
from datetime import timedelta
from .forms import CustomizedUserCreationForm
... | bitRondo/human-tracking-surveillance | accountManagement/views.py | views.py | py | 4,785 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "django.shortcuts.render",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "videoAnalysis.videoAnalysis.getNotifications",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "videoAnalysis.videoAnalysis",
"line_number": 25,
"usage_type": "name... |
17942475126 | # This is the code for training data to
# calculate the prob for the n-grams
from __future__ import division
from model import NgramModel
import pickle
import os
def training():
""" Trains the n-gram language model and returns dict"""
from nltk.corpus import brown
# all the text from brown corpus
raw_... | sainathadapa/pandakey | plugin/prediction_engine/training.py | training.py | py | 767 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "nltk.corpus.brown.categories",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "nltk.corpus.brown",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "nltk.corpus.brown.words",
"line_number": 15,
"usage_type": "call"
},
{
"api_name":... |
43475204782 | # -*- coding: utf-8 -*-
"""
@Author: xiezizhe
@Date: 8/8/2020 下午8:41
"""
from typing import List
class Solution:
def maxSumTwoNoOverlap(self, A: List[int], L: int, M: int) -> int:
ng_L, ng_M = [], []
cur_L, cur_M = sum(A[:L]), sum(A[:M])
for i in range(L, len(A) + 1):
ng_L.app... | forrest0402/leetcode | python/1031. Maximum Sum of Two Non-Overlapping Subarrays.py | 1031. Maximum Sum of Two Non-Overlapping Subarrays.py | py | 1,374 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "typing.List",
"line_number": 11,
"usage_type": "name"
}
] |
24798531998 | from env import ButtonPanel
from ray.rllib.agents import ppo
import numpy as np
from tqdm import tqdm
env_config = {
'random': True,
'n_buttons': 6,
'mode': 'all_exclu'
}
config = {
"num_workers": 3,
"env": ButtonPanel,
"env_config": env_config,
"gamma": 0.9,
"framework": "torch",
... | ccetaw/Reinforcement-Learning | menu_search_test/test5/temp.py | temp.py | py | 665 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "env.ButtonPanel",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "ray.rllib.agents.ppo.DEFAULT_CONFIG",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "ray.rllib.agents.ppo",
"line_number": 25,
"usage_type": "name"
},
{
"api... |
73027124840 | from contacts_management.entities.contact import Contact
from contacts_management.google_contacts import util
from unified.core.util import google_profile
import json
class GoogleContactsApi:
def contacts(self, context, payload):
access_token = util.get_access_token(context['headers'])
url = "http... | dipendrabaidawa/unified_api | unified/modules/main/categories/contacts_management/google_contacts/api.py | api.py | py | 2,135 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "contacts_management.google_contacts.util.get_access_token",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "contacts_management.google_contacts.util",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "contacts_management.google_contacts.util.rest",
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.