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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
27924886180 | #код с регуляркой, присваивающий 0/1 в зависимости от динамики эпидемситуации
import re
import json
import os
dirname = os.path.dirname(__file__)
filename = os.path.join(dirname, 'Covid_dict.json')
countgooddyn = 0
countbaddyn = 0
sample_json = ''
with open("data1.json", "r", encoding="utf-8") as file:
... | stefikh/map_COVID | code/4_dynamic_good_or_bad.py | 4_dynamic_good_or_bad.py | py | 1,709 | python | ru | code | 1 | github-code | 6 | [
{
"api_name": "os.path.dirname",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 8... |
70994868668 | from django import template
register = template.Library()
#background: -webkit-gradient(linear, 0% 0%, 0% 100%, from({{ COLOR_H1_BACK_STOP }}), to({{ COLOR_H1_BACK_START }}));
#background: -webkit-linear-gradient(top, {{ COLOR_H1_BACK_START }}, {{ COLOR_H1_BACK_STOP }});
#background: -moz-linear-gradient(top, {{ CO... | chiara-paci/santaclara-css | santaclara_css/templatetags/css_tags.py | css_tags.py | py | 3,207 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.template.Library",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "django.template",
"line_number": 3,
"usage_type": "name"
}
] |
44844122583 | import torch
import numpy as np
class KBinsDiscretizer:
# simplified and modified version of KBinsDiscretizer from sklearn, see:
# https://github.com/scikit-learn/scikit-learn/blob/7e1e6d09b/sklearn/preprocessing/_discretization.py#L21
def __init__(self, dataset, num_bins=100, strategy="uniform"):
... | Howuhh/faster-trajectory-transformer | trajectory/utils/discretization.py | discretization.py | py | 3,344 | python | en | code | 90 | github-code | 6 | [
{
"api_name": "torch.from_numpy",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.linspace",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "numpy.linspace",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "numpy.percentile",
... |
14493893608 | # -*- coding: utf-8 -*- #
'''
--------------------------------------------------------------------------
# File Name: PATH_ROOT/train.py
# Author: JunJie Ren
# Version: v1.0
# Created: 2021/06/14
# Description: — — — — — — — — — — — — — — — — — — — — — — — — — — —
... | jjRen-xd/PyOneDark_Qt_GUI | app/train.py | train.py | py | 9,258 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "configs.cfgs.model",
"line_number": 58,
"usage_type": "attribute"
},
{
"api_name": "configs.cfgs",
"line_number": 58,
"usage_type": "name"
},
{
"api_name": "networks.MsmcNet.MsmcNet_RML2016",
"line_number": 59,
"usage_type": "call"
},
{
"api_name": ... |
29195553298 | """
Title: Explicit finger tapping sequence learning task [replication of Walker et al. 2002]
Author: Julia Wood, the University of Queensland, Australia
Code adapted from Tom Hardwicke's finger tapping task code: https://github.com/TomHardwicke/finger-tapping-task
Developed in Psychopy v2022.1.1
See my GitHub for furt... | jrwood21/sleep_tacs_study_jw_gh | finger_tapping_task_jw.py | finger_tapping_task_jw.py | py | 36,526 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "os.chdir",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path.abspath",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "psychopy.core.Clock",
"line... |
28315455311 | from typing import Union, Tuple
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
import numpy as np
from gym import Env
from gym.spaces import Box
from ..agent import Agent
from . import ReplayBuffer
from .actor import Actor
from .critic import Critic
from .polyak_update ... | schobbejak/QMIX-Active-Wake-Control | agent/deep/td3.py | td3.py | py | 6,983 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "agent.Agent",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "gym.Env",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "typing.Union",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "typing.Tuple",
"line_number": 28... |
43269450493 | from django.conf.urls import include, url
from provisioner.views import ProvisionStatus, login
urlpatterns = [
url(r'^$', ProvisionStatus, name='home'),
url(r'login.*', login),
url(r'^events/', include('events.urls')),
url(r'^provisioner/', include('provisioner.urls')),
]
| uw-it-aca/msca-provisioner | msca_provisioner/urls.py | urls.py | py | 291 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "django.conf.urls.url",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "provisioner.views.ProvisionStatus",
"line_number": 6,
"usage_type": "argument"
},
{
"api_name": "django.conf.urls.url",
"line_number": 7,
"usage_type": "call"
},
{
"api_... |
20823393672 | from flask import Flask, render_template, request, redirect, session, flash
from mysqlconnection import MySQLConnector
import re, md5
app = Flask(__name__)
app.secret_key = "MySessionSecretKey1"
mysql = MySQLConnector( app, "the_wall")
email_regex = re.compile(r'^[a-zA-Z0-9.+_-]+@[a-zA-Z0-9._-]+\.[a-zA-Z]+$')
@app.rou... | ruslanvs/The_Wall | server.py | server.py | py | 5,933 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "mysqlconnection.MySQLConnector",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "flask.session",
... |
17815024172 | #!/usr/bin/env python3
"""Tool to update Conan dependencies to the latest"""
import argparse
import json
import os
import re
import subprocess
def main():
"""
Read Conan dependencies, look for updates, and update the conanfile.py with updates
"""
parser = argparse.ArgumentParser()
parser.add_arg... | ssrobins/tools | update_conan_packages.py | update_conan_packages.py | py | 2,066 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "os.getcwd",
"li... |
6501962901 | from flask import request
from mobile_endpoint.backends.manager import get_dao
from mobile_endpoint.case.case_processing import process_cases_in_form
from mobile_endpoint.extensions import requires_auth
from mobile_endpoint.form.form_processing import create_xform, get_instance_and_attachments, get_request_metadata
f... | dimagi/mobile-endpoint | prototype/mobile_endpoint/views/receiver.py | receiver.py | py | 1,434 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "mobile_endpoint.views.ota_mod.route",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "mobile_endpoint.views.ota_mod",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "mobile_endpoint.extensions.requires_auth",
"line_number": 13,
"usage_ty... |
19240299148 |
import numpy as np
import torch
import random
import time
smp = torch.nn.Softmax(dim=0)
smt = torch.nn.Softmax(dim=1)
def get_T_global_min(args, record, max_step = None, T0 = None, p0 = None, lr = 0.1, NumTest = None, all_point_cnt = 15000):
if max_step is None:
max_step = args.max_iter
if NumTest... | UCSC-REAL/fair-eval | hoc.py | hoc.py | py | 7,838 | python | en | code | 5 | github-code | 6 | [
{
"api_name": "torch.nn.Softmax",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "torch.nn.Softmax",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_num... |
32766695147 | from django.shortcuts import render, reverse, redirect
from django.views.generic import View
from django.views.generic.edit import CreateView
import requests
import re
count = 6
# Create your views here.
def home(request):
template_name = 'home.html'
return render(request, template_name=template_name... | SaahilS468/Serverless-API | image/views.py | views.py | py | 1,598 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.shortcuts.render",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "re.search",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "requests.get",
"l... |
74773385148 | import numpy as np
import os
import torch
from typing import List, Tuple
from tqdm import tqdm
from datetime import datetime, timedelta
import pickle
import matplotlib.pyplot as plt
# -------------------- Colorize ------------------------------------------
"""A set of common utilities used within the environments. Th... | hannahbull/slrtp2022_t3 | utils.py | utils.py | py | 2,912 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "six.u",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "six.u",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "six.u",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "six.u",
"line_number": 46,
"usage_type": "c... |
43600893416 | # -*- coding: utf-8 -*-
from django.contrib import admin
from adminsortable2.admin import SortableAdminMixin, SortableInlineAdminMixin
from modeltranslation.admin import (
TranslationAdmin, TranslationTabularInline, TranslationStackedInline,
TabbedTranslationAdmin
)
from .models import (
SiteSettings, Foo... | CrazyChief/acidbro | core/admin.py | admin.py | py | 2,524 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.contrib.admin.ModelAdmin",
"line_number": 38,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 38,
"usage_type": "name"
},
{
"api_name": "django.contrib.admin.register",
"line_number": 37,
"usage_type": "call"
},
... |
12981024226 | #!/usr/bin/env python
"""
Pymodbus Synchronous Client Example to showcase Device Information
--------------------------------------------------------------------------
This client demonstrates the use of Device Information to get information
about servers connected to the client. This is part of the MODBUS specificati... | renatosperlongo/pymodbus | examples/contrib/deviceinfo_showcase_client.py | deviceinfo_showcase_client.py | py | 5,108 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "logging.basicConfig",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "pymodbus.cli... |
40986191942 | import random , sys , traceback
from time import sleep
from selenium import webdriver
import datetime
c=1;
browser = webdriver.Chrome('D:\\Python\\Bot Insta\\chromedriver')
browser.get('https://google.com')
while c== 1:
c=0
try:
browser.find_element_by_xpath('/html/body/ytd-app/div/div/ytd... | mirceah99/Python-Bot-Insta | Teste.py | Teste.py | py | 779 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "time.sleep",
"line_number": 17,
"usage_type": "call"
}
] |
32704679818 | from django.urls import path
from .views import *
urlpatterns = [
path('', PostList.as_view(), name="post_list_url"),
path("search/", Search.as_view(), name='search_form_url'),
path("filter/<int:pk>", DateFilter.as_view(), name='date_filter_url'),
path("<slug:category>/", PostList.as_view(), name='post... | djaffic/blog_project | news/urls.py | urls.py | py | 429 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.urls.path",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
69958393149 | import typing as T
import asyncio
import logging
import inspect
from functools import lru_cache
from . import types
from . import transport as _transport
from . import errors
from . import stub
from . import utils
from . import spec
logger = logging.getLogger('pjrpc.server')
class Service:
"""Receive request, r... | magiskboy/pjrpc | pjrpc/core.py | core.py | py | 4,436 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "inspect.iscoroutinefunction",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "inspect.getmembers",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "func... |
5824663901 | """
Flask app for testing the SMART on FHIR OAuth stuff
Build from this tutorial: http://docs.smarthealthit.org/tutorials/authorization/
And using requests-oauthlib: http://requests-oauthlib.readthedocs.io/en/latest/index.html
"""
from flask import Flask, redirect, request, session
from requests_oauthlib import OAuth2S... | ahatherly/SMART-on-FHIR-testclient | app.py | app.py | py | 6,659 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "http.client.client",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "http.client",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "logging.basicConfig",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "logging.getLo... |
11221441363 | import os, bcrypt
from datetime import datetime
from flask import Flask, request, jsonify, render_template
from flask_sqlalchemy import SQLAlchemy
app = Flask(__name__, static_folder='.')
app.config['UPLOAD_FOLDER'] = 'uploads'
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///app.db'
app.config['SQLALCHEMY_TRACK_MOD... | tran-simon/hackatown | app.py | app.py | py | 3,082 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "flask_sqlalchemy.SQLAlchemy",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.utcnow",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "... |
71144565947 | #!/usr/bin/env python3
from dotenv import load_dotenv
from pet_posts import bot
import logging
import os
def main():
load_dotenv() # take environment variables from .env.
api_token = os.getenv("API_TOKEN")
logging.basicConfig(
format="%(asctime)s - %(name)s - %(levelname)s - %(message)s",
... | dawngerpony/pet-posts | app.py | app.py | py | 483 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "dotenv.load_dotenv",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "logging.basicConfig",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"... |
26628419049 | import cv2
import numpy as np
import urllib.request
from threading import Thread
import socket
import time
import requests
import json
class Streamer:
'''
description:-
Class responsible for connecting to the anrdroid app and managing the data communication.
How it works:
- every m... | MohamedEshmawy/DeepRoasters | streamer/streamer_v2.py | streamer_v2.py | py | 7,791 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "socket.socket",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "socket.AF_INET",
"line_number": 39,
"usage_type": "attribute"
},
{
"api_name": "socket.SOCK_STREAM",
"line_number": 39,
"usage_type": "attribute"
},
{
"api_name": "threading.T... |
42123556181 | # Partie1: Récupération des infos à partir d'un lien article
# Choisissez n'importe quelle page Produit sur le site de Books to Scrape. Écrivez un script Python qui visite cette page et en extrait les informations suivantes :
import sys
import requests
from bs4 import BeautifulSoup
import csv
import os
import urllib.re... | glgstyle/MyBookScraper | scrap_article.py | scrap_article.py | py | 3,256 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sys.argv",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "requests.get",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.makedirs",
"line_... |
43040033841 | # -*- coding: utf-8 -*-
"""
@author: lucianavarromartin
PRODUCTOR CONSUMIDOR 3(limited)
El almacén ahora tiene espacio infinito, y cada productor tiene k subalmacenes
que pueden estar llenos simultaneamente.
Añadimos el objeto Lock, en este código, para tener un acceso controlado a
los subalmacenes.
El... | lucnav01/ProductorConsumidor | ProductorConsumidor3NavarroMartinLucia.py | ProductorConsumidor3NavarroMartinLucia.py | py | 3,451 | python | es | code | 0 | github-code | 6 | [
{
"api_name": "time.sleep",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "multiprocessing.current_proc... |
70941003388 | '''
Created on 8/03/2016
@author: EJArizaR
'''
import unittest
from apps.DaneUsers.tests.test_base import test_base
from django.core.urlresolvers import reverse
class IsUsernameRegisteredTest(test_base):
def setUp(self):
test_base.setUp(self)
def test_returns_False_if_user_doe... | diegopuerto/kiosco_universitario | source/apps/DaneUsers/tests/test_is_username_registered.py | test_is_username_registered.py | py | 852 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "apps.DaneUsers.tests.test_base.test_base",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "apps.DaneUsers.tests.test_base.test_base.setUp",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "apps.DaneUsers.tests.test_base.test_base",
"line_numb... |
32628012198 | import pandas as pd
import glob
from datetime import datetime, timedelta
# Leitura dos arquivos da pasta dataset
def readCSV():
listCSV = []
namePath = 'dataset'
# Select all csv in folder selected
namesFiles = glob.glob(namePath + "/*.csv")
# join all them
for filename in namesFiles:
... | lfmaster780/dataCovid | utils.py | utils.py | py | 3,138 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "glob.glob",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pandas.concat",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pandas.to_datetime",
"lin... |
37429761663 | import os
from bs4 import BeautifulSoup
import requests
import requests.exceptions
import urllib.parse
from collections import deque
import re
# Create the directory to store the scraped data if it does not already exist
if not os.path.exists("scraped_data"):
os.makedirs("scraped_data")
user_url = str(input('[+] ... | opemi-aa/email_phone_scrape | email_phone_scrape.py | email_phone_scrape.py | py | 2,267 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.path.exists",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "os.makedirs",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "collections.deque",
"line... |
5555757977 | import copy
from typing import Dict, List, Tuple
import torch
from data.low_res import SingleDomain
from data.geography import frequency_encoded_latitude
import numpy as np
from data.vars import FIELD_MASK, FORCING_MASK, get_var_mask_name
import xarray as xr
from utils.xarray_oper import tonumpydict
def determine_nd... | CemGultekin1/cm2p6 | data/low_res_dataset.py | low_res_dataset.py | py | 12,208 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.amax",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "data.low_res.SingleDomain",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "data.geography.frequency_encoded_latitude",
"line_number": 27,
"usage_type": "call"
},
{
"ap... |
11472792272 | import re
import time
import datetime
import json
import copy
import random
import os
from pathlib import Path
from urllib.parse import quote
from amiyabot import PluginInstance
from core.util import read_yaml
from core import log, Message, Chain
from core.database.user import User, UserInfo
from core.database.bot imp... | hsyhhssyy/amiyabot-arknights-hsyhhssyy-wifu | main.py | main.py | py | 6,170 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.path.dirname",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "amiyabot.PluginInstance",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "database.AmiyaBo... |
75341615226 | """Train an EfficientNetB4 model to predict GBM vs PCNSL.
This requires TensorFlow >= 2.3.0.
"""
import argparse
import math
from pathlib import Path
import pickle
from typing import Tuple, Union
import h5py
import numpy as np
import tensorflow as tf
PathType = Union[str, Path]
def augment_base(x, y):
x = tf.... | kaczmarj/classification-of-gbm-vs-pcnsl-using-cnns | step1_train_model.py | step1_train_model.py | py | 6,476 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "typing.Union",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "pathlib.Path",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "tensorflow.image.random_brightness",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "tensorfl... |
20363546350 | #%%
from dataclasses import dataclass, field
from functools import wraps
from typing import List, Optional, Protocol, Union
import time
from .controller import Controller
from . import commands
from .acceptance_scheme import AcceptanceScheme, UnconditionalAcceptance
from .scattering_simulation import ScatteringSimulat... | lestercbarnsley/SasRMC | sas_rmc/simulator.py | simulator.py | py | 3,355 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "time.time",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "functools.wraps",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "typing.Union",
"line_number":... |
73831992187 |
import os
os.environ['OPENCV_IO_MAX_IMAGE_PIXELS'] = pow(2, 40).__str__()
import sys
import copy
from pathlib import Path
from collections import Counter
import numpy as np
import pandas as pd
import cv2
import bioformats.formatreader
import cellprofiler_core.pipeline
import cellprofiler_core.preferences
import cell... | BGI-Qingdao/4D-BioReconX | Preprocess/cellsegmentation/objseg.py | objseg.py | py | 19,716 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "os.environ",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "numpy.ndarray",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "cv2.imread",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line... |
32481834912 | import matplotlib.pyplot as plt
import pandas as pd
import tensorflow as tf
from constants import nb_class
from tracking import get_dataframes
tf.compat.v1.enable_eager_execution() # Remove when switching to tf2
pd.plotting.register_matplotlib_converters()
###############################
# Methods for data formattin... | benoitkoenig/blobWar-image | faster_rcnn/visualization.py | visualization.py | py | 3,864 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "tensorflow.compat.v1.enable_eager_execution",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "tensorflow.compat",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "pandas.plotting.register_matplotlib_converters",
"line_number": 9,
"usag... |
14408997276 | from announcement.models import AnnouncementModel
from UslugiProfi.utils import create_file_absolute_url
from rest_framework import serializers
class GetAnnouncementsSeriaizer(serializers.ModelSerializer):
image = serializers.SerializerMethodField()
class Meta:
model = AnnouncementModel
field... | Johudo-old/UslugiProfi | announcement/serializers.py | serializers.py | py | 1,075 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "rest_framework.serializers.ModelSerializer",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.serializers",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "rest_framework.serializers.SerializerMethodField",
"line_number": 7,... |
34632215573 | import cv2
import numpy as np
img = cv2.imread('img\\ttt.jpg')
#定义结构元素
kernel = cv2.getStructuringElement(cv2.MORPH_RECT, (3, 3))
#腐蚀图像
eroded = cv2.erode(img, kernel)
cv2.imshow("fs_eroded", eroded)
#膨胀图像
dilated = cv2.dilate(img, kernel)
cv2.imshow("pz_dilated", dilated)
#NumPy定义的结构元素
NpKernel = np.uint8(np.one... | liuyuhua-ha/opencvStudy | opencvStudy/structTest.py | structTest.py | py | 527 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "cv2.imread",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "cv2.getStructuringElement",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "cv2.MORPH_RECT",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "cv2.erode",
... |
34780751946 | import datetime
import csv
import re
from Classes import Contact
contact_list = list()
contact_list_csv = "contact_list.csv"
# Создание нового контакта и запись его в csv файл
def create_contact():
print("Для того чтобы пропустить пункт и оставить его пустым введите: _")
new_contact = Contact("", "", "", ""... | NAS371/contactListTestWork | Program.py | Program.py | py | 5,649 | python | ru | code | 0 | github-code | 6 | [
{
"api_name": "Classes.Contact",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.strptime",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 37,
"usage_type": "attribute"
},
{
"api_name": "csv... |
6178538714 | """
Implement class ``SkyDictionary``, useful for marginalizing over sky
location.
"""
import collections
import itertools
import numpy as np
import scipy.signal
from scipy.stats import qmc
from cogwheel import gw_utils
from cogwheel import utils
class SkyDictionary(utils.JSONMixin):
"""
Given a network of d... | 2lambda123/cogwheel1 | cogwheel/likelihood/marginalization/skydict.py | skydict.py | py | 7,143 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "cogwheel.utils.JSONMixin",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "cogwheel.utils",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "numpy.random.default_rng",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": ... |
9988571316 | import websockets, json, traceback, os, asyncio, inspect, logging
import websockets.client
import websockets.server
from websockets.exceptions import ConnectionClosedOK, ConnectionClosedError
from .client_management.client import Client
from .session_management.client_state import Client_State
from .inventory_manage... | colinhartigan/valorant-inventory-manager | server/src/server.py | server.py | py | 5,848 | python | en | code | 150 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "client_management.client.Client",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "c... |
17690019803 | #!/usr/bin/env python3
""" Module for view definition """
from flask import Flask, render_template, request
from flask_babel import Babel, _
from typing import Optional
class Config(object):
""" Config class """
# ...
LANGUAGES = ['en', 'fr']
BABEL_DEFAULT_LOCALE = 'en'
BABEL_DEFAULT_TIMEZONE = 'U... | dnjoe96/alx-backend | 0x02-i18n/4-app.py | 4-app.py | py | 1,140 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "flask_babel.Babel",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "flask.request.args.get",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "flask.request.ar... |
8631452934 | import pytest
import numpy as np
from abito.lib.significance import *
def test_t_test():
np.random.seed(0)
treatment = np.random.normal(100, size=100)
control = np.random.normal(100, size=100)
r = t_test(treatment, control)
assert r.p_value == pytest.approx(0.9, 0.1)
r = t_test_1samp(treatmen... | avito-tech/abito | tests/test_significance.py | test_significance.py | py | 376 | python | en | code | 14 | github-code | 6 | [
{
"api_name": "numpy.random.seed",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "numpy.random.normal",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.random",
... |
26112361495 | __authors__ = ["V. Valls"]
__license__ = "MIT"
__date__ = "14/02/2018"
import enum
import logging
from silx.gui import qt
from silx.gui.dialog.ImageFileDialog import ImageFileDialog
from silx.gui.dialog.DataFileDialog import DataFileDialog
import silx.io
logging.basicConfig()
class Mode(enum.Enum):
DEFAULT_FIL... | silx-kit/silx | examples/fileDialog.py | fileDialog.py | py | 7,386 | python | en | code | 106 | github-code | 6 | [
{
"api_name": "logging.basicConfig",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "enum.Enum",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "silx.gui.qt.QMainWindow",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "silx.... |
41243183736 | from flask import Blueprint, request, jsonify, make_response
from tabledef import Technician
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from sqlalchemy import update
from tabledef import Technician, Call
import config
# create a query that extracts the information of the table "tech... | fmauri90/call_center | dataservice/api_technician_company.py | api_technician_company.py | py | 8,617 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.Blueprint",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.create_engine",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "config.TECH_ID",
"line_number": 54,
"usage_type": "attribute"
},
{
"api_name": "config.T... |
25170385254 | # Django imports
from django.shortcuts import render, get_object_or_404
from django.db.models import Q
# Folder imports
from .utils.sky import quick_flight_search
from .models import *
from apps.authentication.models import Profile
from apps.trips.models import *
# Other imports
from datetime import datetime, date, tim... | sc19jwh/COMP3931 | apps/flights/views.py | views.py | py | 6,392 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.shortcuts.render",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.get_object_or_404",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "datetime.timedelta",
"line_number": 39,
"usage_type": "call"
},
{
"api... |
36229561780 | from typing import List
'''
452. 用最少数量的箭引爆气球
https://leetcode.cn/problems/minimum-number-of-arrows-to-burst-balloons/
每一箭射穿的气球满足:最左边的气球右端在最右边气球左端的右面。
可以贪心,按照气球右端排序
记录新开的一箭的气球的右端点end,一旦有一个气球的左端点在end右面,则这一箭已经射不到这个气球了,需要新的一箭。
'''
class Solution:
def findMinArrowShots(self, points: List[List[int]]) -> int:
poi... | z-w-wang/Leetcode-Problemlist | CS-Notes/Greedy/452.py | 452.py | py | 806 | python | zh | code | 3 | github-code | 6 | [
{
"api_name": "typing.List",
"line_number": 11,
"usage_type": "name"
}
] |
2704503307 | # -*- coding: utf-8 -*-
from django.test import Client, RequestFactory, TestCase
from tasks import views
from tasks.models import Task, TaskStatus
from users.models import CustomUser
class TaskTest(TestCase):
"""Test cases for tasks."""
def setUp(self):
"""Initial setup before tests."""
self... | altvec/python-project-lvl4 | tasks/tests.py | tests.py | py | 1,403 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.test.TestCase",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "django.test.RequestFactory",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "users.models.CustomUser.objects.create_user",
"line_number": 15,
"usage_type": "call"
},... |
19757717889 | # unit.test_shop.test_shopRepo.py
from unittest.mock import Mock
import tinydb as tdb
from fixtures.shop import ShopFixture, TEMP_SHOPS_TINYDB_TEST_PATH, \
PRODUCTS_URLS_9_VALID_TEST_PATH, PRODUCTS_URLS_TEST_DIR
from shop.shop import Shop
from shop.shopDao import TinyShopDao
from shop.shopRepo import ShopRepo
fro... | dbyte/WebtomatorPublicEdition | tests/unit/test_shop/test_shopRepo.py | test_shopRepo.py | py | 14,072 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "unit.testhelper.WebtomatorTestCase",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "fixtures.shop.TEMP_SHOPS_TINYDB_TEST_PATH",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "fixtures.shop.PRODUCTS_URLS_TEST_DIR",
"line_number": 16,
"u... |
36229750080 | from typing import List
'''
剑指 Offer II 119. 最长连续序列 == 128
一般想法是排序再遍历,时间复杂度为O(nlogn)
连续的数会有一个起始数字num,num - 1不在nums数组中
所以找到num - 1 不在nums中的那个数,查询其连续长度
'''
class Solution:
def longestConsecutive(self, nums: List[int]) -> int:
s = set(nums)
maxlen = 0
for num in s:
if num - 1 not ... | z-w-wang/Leetcode-Problemlist | FxxkOffer/Graph/Offer_2_119.py | Offer_2_119.py | py | 641 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "typing.List",
"line_number": 10,
"usage_type": "name"
}
] |
71791729148 | import numpy.linalg as LA
from sklearn.neighbors import KDTree
from sampler import Sampler
import networkx as nx
from shapely.geometry import LineString
def can_connect(p1, p2, polygons):
line = LineString([p1, p2])
for p in polygons:
if p.crosses(line) and p.height >= min(p1[2], p2[2]):
... | magnusja/udacity-flying-cars | FCND-Motion-Planning/prm.py | prm.py | py | 1,063 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "shapely.geometry.LineString",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "networkx.Graph",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "sklearn.neighbors.KDTree",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "s... |
29576976470 | # -*- coding: utf-8 -*-
"""
scikit-learnを用いたサンプルデータ生成
http://overlap.hatenablog.jp/entry/2015/10/08/022246
Created on Wed Jul 11 15:25:41 2018
@author: Akitaka
"""
### classification sample
from sklearn.datasets import make_classification
from sklearn.model_selection import train_test_split
from sklearn... | nakanishi-akitaka/python2018_backup | 0711/test4_make_sample.py | test4_make_sample.py | py | 1,780 | python | en | code | 5 | github-code | 6 | [
{
"api_name": "sklearn.datasets.make_classification",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "sklearn.linear_model.LogisticRegression",
"line_number": 35,
... |
33562082348 | import cv2 as cv
import numpy as np
from matplotlib import pyplot as plt
def thresholdingvivas(inp):
f, c = inp.shape
for i in range(f):
for j in range(c):
if(inp[i][j]>=195):
inp[i][j]=0
cv.imshow('vivas',inp)
def thresholdingmuertas(inp):
f, c = inp.sha... | renzovc987/CG | Thresholdingrenzo.py | Thresholdingrenzo.py | py | 1,044 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "cv2.imshow",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "cv2.imshow",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "cv2.imshow",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 30,
... |
40211307735 | from __future__ import division
import sys, os, math
import vtk
from pbrainlib.gtkutils import error_msg, simple_msg, make_option_menu,\
get_num_value, get_num_range, get_two_nums, str2int_or_err,\
OpenSaveSaveAsHBox, ButtonAltLabel
import pickle
from scipy import array, zeros, ones, sort, absolute, sqrt, ... | nipy/pbrain | eegview/mesh_manager.py | mesh_manager.py | py | 2,967 | python | en | code | 94 | github-code | 6 | [
{
"api_name": "vtk.vtkStructuredPointsReader",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "vtk.vtkContourFilter",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "vtk.vtkDecimatePro",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": ... |
5708829851 | import rename_tool
import torch
import torchaudio
from TTS.tts.configs.xtts_config import XttsConfig
from TTS.tts.models.xtts import Xtts
import os
current_dir = os.getcwd()
config_path = os.path.join(current_dir, "source", "model_v2", "config.json")
checkpoint_dir = os.path.join(current_dir, "source", "model_V2")
co... | douhaohaode/xtts_v2 | tts_v2.py | tts_v2.py | py | 1,627 | python | en | code | 16 | github-code | 6 | [
{
"api_name": "os.getcwd",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 10... |
1741698512 | import pytest
import numpy as np
import piquasso as pq
import strawberryfields as sf
pytestmark = pytest.mark.benchmark(
group="pure-fock",
)
@pytest.fixture
def theta():
return np.pi / 5
@pytest.fixture
def d():
return 5
@pytest.mark.parametrize("cutoff", range(3, 14))
def piquasso_benchmark(benc... | Budapest-Quantum-Computing-Group/piquasso | benchmarks/purefock_beamsplitter_increasing_cutoff_benchmark.py | purefock_beamsplitter_increasing_cutoff_benchmark.py | py | 1,353 | python | en | code | 19 | github-code | 6 | [
{
"api_name": "pytest.mark.benchmark",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pytest.mark",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "numpy.pi",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "pytest.fixture",
... |
72577662587 | from dataclasses import dataclass, field
from random import randint
maps = [
"de_anubis",
"de_inferno",
"de_ancient",
"de_mirage",
"de_nuke",
"de_overpass",
"de_vertigo",
]
@dataclass(frozen=True)
class Defaultsettings:
"""Sets basic match information. You can override the number of m... | Rogris/get5matchgen | tools.py | tools.py | py | 2,036 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "dataclasses.field",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "dataclasses.field",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "dataclasses.field"... |
30367946761 | import numpy as np
from chaco.api import ArrayPlotData, Plot
from enable.api import ComponentEditor
from traits.api import Array, HasStrictTraits, Instance, Range, on_trait_change
from traitsui.api import Item, VGroup, View
class PowerFunctionExample(HasStrictTraits):
""" Display a plot of a power function. """
... | enthought/chaco | examples/user_guide/power_function_example.py | power_function_example.py | py | 2,379 | python | en | code | 286 | github-code | 6 | [
{
"api_name": "traits.api.HasStrictTraits",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "traits.api.Instance",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "chaco.api.Plot",
"line_number": 13,
"usage_type": "argument"
},
{
"api_name": "trai... |
39403565414 | from functools import partial
import mmcv
import numpy as np
import torch
from six.moves import map, zip
def tensor2imgs(tensor, mean=(0, 0, 0), std=(1, 1, 1), to_rgb=True):
"""Convert tensor to images
Args:
tensor (torch.Tensor): Tensor that contains multiple images
mean (tuple[float], opti... | fundamentalvision/Parameterized-AP-Loss | mmdet/core/utils/misc.py | misc.py | py | 5,069 | python | en | code | 48 | github-code | 6 | [
{
"api_name": "numpy.array",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "numpy.float32",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "numpy.array",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "numpy.float32",
"line_... |
6969788756 | import os
import re
from PIL import Image
import numpy as np
import torch
import random
from torch.utils.data import Dataset, DataLoader
from torchvision import transforms, utils
from torchvision.datasets.folder import default_loader
class Celeb(Dataset):
def __init__(self, data_file, dst_path='cropped_... | ada-shen/icCNN | celeb.py | celeb.py | py | 3,923 | python | en | code | 18 | github-code | 6 | [
{
"api_name": "torch.utils.data.Dataset",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "re.compile",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "torchvision.transforms.Compose",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "to... |
36646912477 | import matplotlib
matplotlib.use('Agg') # noqa
from deepdecoder.data import generator_3d_tags_with_depth_map, DistributionHDF5Dataset
import diktya.distributions
from diktya.numpy import tile
import matplotlib.pyplot as plt
import os
import argparse
from keras.utils.generic_utils import Progbar
from scipy.ndimage.int... | berleon/deepdecoder | deepdecoder/scripts/generate_3d_tags.py | generate_3d_tags.py | py | 4,038 | python | en | code | 50 | github-code | 6 | [
{
"api_name": "matplotlib.use",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "deepdecoder.data.generator_3d_tags_with_depth_map",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "scipy.ndimage.filters.gaussian_filter1d",
"line_number": 22,
"usage_type"... |
36213639675 | #!/usr/bin/env python
# coding: utf-8
import os
import math
import numpy as np
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
from PIL import Image
import time
import os,glob
import matplotlib.pyplot as plt
from random import choice
VGG_MEAN=[103.939,116.779,123.68]
class VGGNet():
def __init__(se... | castleKing1997/Style_Transfer | StyleTransfer.py | StyleTransfer.py | py | 7,795 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "tensorflow.compat.v1.disable_v2_behavior",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "tensorflow.compat.v1",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "tensorflow.compat.v1.constant",
"line_number": 25,
"usage_type": "call"
},
... |
20426895808 | import matplotlib.pyplot as plt
import seaborn as sns
color_list = sns.color_palette('deep') + sns.color_palette('bright')
def DrawDoubleYLines(x, y1, y2, xlabel='', ylabel=['', ''], legend=['', ''], store_path=''):
'''
Draw the doulbe y-axis lines.
:param x: The vector of the x axis.
:param y1: The ve... | salan668/FAE | BC/Visualization/DrawDoubleLines.py | DrawDoubleLines.py | py | 1,322 | python | en | code | 121 | github-code | 6 | [
{
"api_name": "seaborn.color_palette",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "matpl... |
5361852132 | from kivy.app import App
from kivy.uix.screenmanager import ScreenManager, Screen
from kivy.lang import Builder
import wikipedia
from urllib import request
Builder.load_file(filename="search.kv")
class FirstScreen(Screen):
def get_img_link(self):
# get user search
query = self.manager.current_scre... | mido-99/Advanded-OOP | App-4-Webcam-Photo-Sharer/main.py | main.py | py | 4,504 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "kivy.lang.Builder.load_file",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "kivy.lang.Builder",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "kivy.uix.screenmanager.Screen",
"line_number": 9,
"usage_type": "name"
},
{
"api_name... |
42755033612 | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
from dat... | tpoisonooo/Documentation | source/conf.py | conf.py | py | 5,214 | python | en | code | null | github-code | 6 | [
{
"api_name": "datetime.datetime.now",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "megengine.__version__",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "lo... |
37228942399 | #!/usr/bin/env python3
import argparse
import bids
from bids import BIDSLayout
import os
from pathlib import Path
def _filter_pybids_none_any(dct):
import bids
return {
k: bids.layout.Query.NONE
if v is None
else (bids.layout.Query.ANY if v == "*" else v)
for k, v in dct.items()... | ftdc-picsl/pmacsPreps | bin/bidsFilterTest.py | bidsFilterTest.py | py | 4,368 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "bids.layout",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "bids.layout",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "pathlib.Path",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line... |
17499920257 | #TODO practice mode for the ones that required 10+, or 20+ s previously
#TODO prorgam to train two digits additions and subtractions
from random import random
from random import randint
import datetime
from matplotlib import pyplot as plt
import pandas as pd
# import numpy as np
import os
import mplcursors # need to in... | kouichi-c-nakamura/anzan_training | anzan.py | anzan.py | py | 13,926 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "matplotlib.pyplot.rcParams",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.rcParams",
"line_number": 20,
"usage_type": "attribute"
},
{
... |
32995735130 | #!/usr/bin/env python
# coding: utf-8
# In[2]:
## We'll be doing this from scratch, so all imports will come from
## the Python standard library or 3rd-party tools
import socket
import struct
import base64
import json
import hashlib
import time
import enum
import xml.etree.ElementTree as ET
from enum import Enum
i... | irods/iRODS-Protocol-Cookbook | iRODS Protocol Cookbook.py | iRODS Protocol Cookbook.py | py | 35,966 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "password_obfuscation.encode",
"line_number": 100,
"usage_type": "call"
},
{
"api_name": "enum.Enum",
"line_number": 117,
"usage_type": "name"
},
{
"api_name": "xml.etree.ElementTree.fromstring",
"line_number": 186,
"usage_type": "call"
},
{
"api_nam... |
71749351229 | from json import loads
from kafka import KafkaConsumer
consumer = KafkaConsumer(
'test-topic',
bootstrap_servers=['0.0.0.0:9092'],
auto_offset_reset='earliest',
enable_auto_commit=True,
group_id='test-json-group',
value_deserializer=lambda x: loads(x.decode('utf-8')))
for message in consumer:
... | makseli/kafka-docker-python | consumer-json.py | consumer-json.py | py | 522 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "kafka.KafkaConsumer",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 10,
"usage_type": "call"
}
] |
7725885886 | import pandas as pd
from sqlalchemy import create_engine
from influxdb import InfluxDBClient
import time
def connectSQL():
connection_str = 'mssql+pyodbc://royg:Welcome1@SCADA'
engine = create_engine(connection_str)
conn = engine.connect()
return conn
def getData(conn,interval):
if (interval==1):... | thongnbui/MIDS_251_project | python code/SendToInflux.py | SendToInflux.py | py | 2,797 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sqlalchemy.create_engine",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "influxdb.InfluxDBClient",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "infl... |
32483752873 | import torch
import torch.nn as nn
from mmdet.models import ResNet, FPN, MobileNetV2
import torch.nn.functional as F
from common import default_conv, ResBlock, BasicBlock
class MCNN(nn.Module):
'''
Implementation of Multi-column CNN for crowd counting
'''
def __init__(self, load_weights=False):
... | johnran103/mmdet | scale_map_net/s_net.py | s_net.py | py | 9,667 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "torch.nn.Module",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "torch.nn.Sequential",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"lin... |
2298089969 | import concurrent.futures
from datetime import datetime
import pymongo as pmg
import os
import uuid
from dotenv import load_dotenv
load_dotenv()
import pytz
tz_ind = pytz.timezone('Asia/Kolkata')
now = datetime.now(tz_ind)
class Logit:
"""
logger class
use this class to log the execution of the program.
... | sanjeevan121/ecommerce | logger/logit.py | logit.py | py | 3,100 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "dotenv.load_dotenv",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pytz.timezone",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "datetime.dateti... |
19521121631 | import socket
import threading
from queue import Queue
import sys
import time
import logging
import json
# pip install PyExecJS
#import execjs
# # 1. 在windows上不需要其他的依赖便可运行execjs, 也可以调用其他的JS环境
# # windows 默认的执行JS的环境
# execjs.get().name
# 返回值: JScript
# # 作者本人的windows上装有Node.js , 所以返回值不同
# execjs.get().name
# 返回值: Node.... | optimjiang/my_3d_game | comm_with_server.py | comm_with_server.py | py | 8,394 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "logging.Formatter",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "logging.FileHandler",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "logging.Strea... |
24955814708 | import shutil
import pytest
from repo2rocrate.snakemake import find_workflow, get_lang_version, make_crate
SNAKEMAKE_ID = "https://w3id.org/workflowhub/workflow-ro-crate#snakemake"
def test_find_workflow(tmpdir):
root = tmpdir / "snakemake-repo"
workflow_dir = root / "workflow"
workflow_dir.mkdir(paren... | crs4/repo2rocrate | test/test_snakemake.py | test_snakemake.py | py | 3,932 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "pytest.raises",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "repo2rocrate.snakemake.find_workflow",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "repo2rocrate.snakemake.find_workflow",
"line_number": 18,
"usage_type": "call"
},
... |
10230066135 | from typing import Optional
import tiktoken
from evals.elsuite.ballots.prompts import (
control_chat_prompt,
control_text_template,
manipulation_chat_template,
manipulation_text_template,
text_prompt,
voter_chat_prompt,
voter_text_prompt,
)
from evals.registry import is_chat_model
LOGIT_B... | openai/evals | evals/elsuite/ballots/utils.py | utils.py | py | 3,804 | python | en | code | 12,495 | github-code | 6 | [
{
"api_name": "typing.Optional",
"line_number": 59,
"usage_type": "name"
},
{
"api_name": "tiktoken.encoding_for_model",
"line_number": 63,
"usage_type": "call"
},
{
"api_name": "evals.elsuite.ballots.prompts.manipulation_chat_template",
"line_number": 92,
"usage_type": "... |
1828590890 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Author: Jackson O'Donnell
# jacksonhodonnell@gmail.com
from __future__ import division, print_function
import healpy as hp
import numpy as np
from .beam import r3_channel_beams
from .constants import (ffp8_nu4_central_freqs, ffp8_nu6_central_freqs)
def make_big_R(R4... | jhod0/lgmca_planck_tools | lgmca_planck_tools/planck/fitting.py | fitting.py | py | 4,829 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.zeros",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.complex",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "constants.ffp8_nu4_central_freqs",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "const... |
3367814266 | from datetime import date
import discord
from discord.utils import get
from commands import automoderation, send_by_bot
from constants import Channels, Members
from init_bot import bot
from utils.format import create_embed
from utils.guild_utils import check_for_beer, find_animated_emoji, get_referenced_author, get_m... | Traus/discord_bot | events/messages.py | messages.py | py | 6,311 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "discord.Message",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "constants.Channels.TODO",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "constants.Channels",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "... |
34711863736 | from fastapi import FastAPI
from fastapi import HTTPException
import models
app = FastAPI()
coffeeDescriptions = [
"A latte is a coffee drink made with espresso and steamed milk. It is a single shot of espresso served in a tall glass, with a layer of steamed milk on top, and a layer of microfoam on top of that.",... | ByteOfKathy/RESTAPI-example | backend.py | backend.py | py | 3,994 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "fastapi.FastAPI",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "fastapi.HTTPException",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "fastapi.HTTPException",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "fastapi.HT... |
19739382962 | import json
import mechanize
import sys
import logging
import time
import urllib
from constants import *
from excepciones import *
from imagen import *
from datetime import date, timedelta
from termcolor import colored
logger = logging.getLogger(__name__)
class Browser(object):
def __init__(self, config, login=T... | adrianlzt/ingdirect_cli | browser.py | browser.py | py | 20,033 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "mechanize.Browser",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "sys._getframe",
"line_number": 66,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"l... |
7212182080 | import torch
from torch import nn
from tqdm.auto import tqdm
from torchvision import transforms
from torchvision.utils import make_grid
from torch.utils.data import DataLoader
import matplotlib.pyplot as plt
#
import glob
import random
import os
from torch.utils.data import Dataset
from PIL import Image
#filesize
impor... | Zefyrus94/GAN_test | cyclegan.py | cyclegan.py | py | 25,719 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "torch.manual_seed",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "torchvision.utils.make_grid",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.imsave",
"line_number": 29,
"usage_type": "call"
},
{
"api_name":... |
23647554795 | from flask import render_template, request, flash, jsonify
from appInitialize import app, db
from model.client import Client
from model.product import Product
from model.order import Order
import json
@app.route('/')
def index ():
return render_template('layout.html')
#Consultar clientes
@app.route('/read/clients... | cesar-orozco-chr/tienda-online | read/app.py | app.py | py | 4,862 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.render_template",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "appInitialize.app.route",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "appInitialize.app",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "model.c... |
21509653092 | from fastapi import APIRouter, Depends, Request, Response
from sqlalchemy.orm import Session
from typing import List
from uuid import UUID
from api.models.node_threat import NodeThreatCreate, NodeThreatRead, NodeThreatUpdate
from api.routes import helpers
from db import crud
from db.database import get_db
from db.sche... | hollyfoxx/ace2-gui | backend/app/api/routes/node_threat.py | node_threat.py | py | 2,805 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "fastapi.APIRouter",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "api.models.node_threat.NodeThreatCreate",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "fastapi.Request",
"line_number": 27,
"usage_type": "name"
},
{
"api_nam... |
73739274748 | #!/usr/bin/env python3
""""
This module provides the interface to manage the state of configured workers.
It allows to setup the virtual environment, install dependencies into it and
then to execute BuildBot worker commands.
"""
import sys
import os.path
import argparse
import getpass
import socket
import paramiko
i... | dA505819/maxscale-buildbot | worker-management/manage.py | manage.py | py | 6,833 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sys.path.append",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "os.path.path.abspath",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path.path",
... |
25968516319 | """added san and is_my_move to Move
Revision ID: f39051a2ca9b
Revises: c9b0d072e5e4
Create Date: 2020-12-16 13:05:46.434429
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'f39051a2ca9b'
down_revision = 'c9b0d072e5e4'
branch_labels = None
depends_on = None
de... | joshua-stauffer/opening-book-api | migrations/versions/f39051a2ca9b_added_san_and_is_my_move_to_move.py | f39051a2ca9b_added_san_and_is_my_move_to_move.py | py | 929 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "alembic.op.batch_alter_table",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.... |
20473378944 | import json
import numpy as np
class calculte():
def __init__(self, data, n_x, n_y, t_s, morning_time, afternoon_time):
self.data = data
self.n_x = n_x
self.n_y = n_y
self.t_s = t_s
self.morning = morning_time
self.afternoon_time = afternoon_time
def _process_dat... | Jkcert/deecamp-frontend | src/ors_backend/model/schedule/calculation.py | calculation.py | py | 2,473 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "numpy.array",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": ... |
32143586237 | import utils
import requests
import json, sys
from datetime import date, datetime, timedelta
space_key = "SVMC"
# parentTitle = "Project Report - Automatic"
# weeklyPageTitle = "Weekly Project Status Report"
# monthlyPageTitle = "CP Monthly Report"
dailyPageTitle = "Issue Status Tool"
pageUrgentPrjTitle = "Issue Tool... | hoangdt9/hoang | WikiSubmit.py | WikiSubmit.py | py | 11,061 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "utils.open_file",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "utils.open_file",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "requests.put",
"line_n... |
70827770107 | from selenium import webdriver
from datetime import datetime
import boto3
import os
import time
now = datetime.now()
folder_name = now.strftime("%Y%m%d")
image_name = "traffic_" + now.strftime("%Y%m%d") + "-" + now.strftime("%H-%M") + ".png"
Bucket_name = "googletrafficmap"
prefix = folder_name + "/"
#Get... | nathan36/GoogleTrafficMap-GIF | GoogleTrafficMap-GIF/saveImage.py | saveImage.py | py | 993 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "datetime.datetime.now",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "selenium.webdriver.PhantomJS",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "se... |
9695092385 | #!/bin/python3
import datetime
import json
import threading
import time
import turtle
import sys
from urllib import request
from collections import namedtuple
class ISS():
def __init__(self):
self.is_instance = True
self._astronauts_url = 'http://api.open-notify.org/astros.json'
self._... | mattbhenley/ISS_Locator | locator.py | locator.py | py | 4,144 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "collections.namedtuple",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "urllib.request.urlopen",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "urllib.request",
"line_number": 35,
"usage_type": "name"
},
{
"api_name": "json.loa... |
35168238376 | from serpent.game_agent import GameAgent
from serpent.input_controller import KeyboardKey
import offshoot
class SerpentSuperHexagonGameAgent(GameAgent):
def __init__(self, **kwargs):
super().__init__(**kwargs)
self.frame_handlers["PLAY"] = self.handle_play
self.frame_handler_setups["PLAY... | cameron-j-knight/General-AI | plugins/SerpentSuperHexagonGameAgentPlugin/files/serpent_SuperHexagon_game_agent.py | serpent_SuperHexagon_game_agent.py | py | 1,675 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "serpent.game_agent.GameAgent",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "offshoot.config",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "serpent.machine_learning.context_classification.context_classifiers.cnn_inception_v3_context_cla... |
37169098035 | __author__ = "Moath Maharmeh"
__license__ = "GNU General Public License v2.0"
__version__ = "1.1"
__email__ = "moath@vegalayer.com"
__created__ = "13/Dec/2018"
__modified__ = "5/Apr/2019"
__project_page__ = "https://github.com/iomoath/file_watchtower"
import sqlite3
import os
import csv
DEFAULT_PATH = os.path.join(o... | iomoath/file_watchtower | db.py | db.py | py | 10,875 | python | en | code | 30 | github-code | 6 | [
{
"api_name": "os.path.join",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line... |
15932158711 | from ..exceptions import HydraError, ResourceNotFoundError
from . import scenario, network
from .. import db
from ..db.model import ResourceGroup, ResourceGroupItem, Node, Link
from .scenario import _get_scenario
from sqlalchemy.orm.exc import NoResultFound
import logging
log = logging.getLogger(__name__)
def _get_g... | hydraplatform/hydra-base | hydra_base/lib/groups.py | groups.py | py | 3,757 | python | en | code | 8 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "db.model.DBSession.query",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "db.model.ResourceGroup",
"line_number": 14,
"usage_type": "argument"
},
{
"api_name": ... |
30791686316 | from numba import *
from numba import error
#@autojit
def func():
if x:
print("hello")
else:
print("world")
def compile_func1():
try:
jit(void())(func)
except error.NumbaError as e:
print("exception: %s" % e)
__doc__ = """
>>> compile_func1()
--------------------- Numb... | garrison/numba | numba/tests/test_reporting.py | test_reporting.py | py | 1,664 | python | en | code | null | github-code | 6 | [
{
"api_name": "numba.error.NumbaError",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "numba.error",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "numba.error.NumbaError",
"line_number": 34,
"usage_type": "attribute"
},
{
"api_name": "n... |
74637081787 | import socket
import time
from PyQt5.QtCore import QTimer, QThread
import queue
import logging
import pyaudio
import threading
logging.basicConfig(format="%(message)s", level=logging.INFO)
class AudioRec(QThread):
def __init__(self, threadChat):
super().__init__()
self.threadChat = threadChat
... | shully899509/OpenParty | app/client/ClientAudio.py | ClientAudio.py | py | 2,191 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logging.basicConfig",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "PyQt5.QtCore.QThread",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "socket.get... |
70713803388 | import re
import os
import sys
import time
import json
import torch
import wandb
import random
import datasets
import evaluate
import numpy as np
import transformers
from accelerate import Accelerator
from accelerate.utils import set_seed
from torch.utils.data import DataLoader
from transformers import AutoTokenizer, D... | JesseBrons/Webpageclassification | training/train_model_BERT.py | train_model_BERT.py | py | 5,845 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "accelerate.utils.set_seed",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "datasets.load_f... |
44632720863 | #!/usr/bin/env python
import sys
import shutil
from typing import Optional, List, Tuple, Dict
import typer
from rich import print
from rich.columns import Columns
from rich.console import Console
from rich.traceback import install
# fmt: off
# Mapping from topics to colors
TOPICS = {
"TIMR": "#9a9a99",
"VOTE"... | fansehep/Raft_Key-Value | RAFT_6_824/src/raft/dslogs.py | dslogs.py | py | 3,483 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "typing.Optional",
"line_number": 35,
"usage_type": "name"
},
{
"api_name": "typer.BadParameter",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "typer.FileText",
"line_number": 46,
"usage_type": "attribute"
},
{
"api_name": "typing.Optiona... |
30109795593 | # -*- coding: utf-8 -*-
"""
Created on Thu Oct 7 10:30:52 2021
@author: X
"""
import json
import lz4.frame, lz4.block
import os
import copy
# The full path to the Firefox folders is:
# C:\Users\USERNAME\AppData\Roaming\Mozilla\Firefox\Profiles
# Each profile gets its own folder and from there, the bookm... | AndrewWigginCout/bookmarks | bookmarks.py | bookmarks.py | py | 7,127 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "os.listdir",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 25,
... |
73839717628 | from asyncio import sleep, run
import os
import random
from dotenv import load_dotenv
import discord
from discord.ext import commands, tasks
import data
from table2ascii import table2ascii as t2a, PresetStyle
import asyncpg
from datetime import datetime, timedelta
load_dotenv()
TOKEN = os.getenv('DISCORD_TOKEN')
in... | NexhmedinQ/Discord-Finance-Bot | bot.py | bot.py | py | 6,920 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "dotenv.load_dotenv",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "discord.Intents.all",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "discord.Intents",
... |
28395924014 | import os
import numpy as np
from PIL import Image
from torch.utils.data import Dataset
from torchvision import transforms
class AnimeDataset(Dataset):
def __init__(self, dataset_path, image_size):
self.transform = transforms.Compose([
transforms.Resize(image_size),
transforms.Cen... | cwpeng-cn/DCGAN | data.py | data.py | py | 1,276 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "torch.utils.data.Dataset",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "torchvision.transforms.Compose",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "torchvision.transforms",
"line_number": 11,
"usage_type": "name"
},
{
"api... |
18956703257 | from datetime import datetime, timezone
from slack_sdk import WebClient
from slack_sdk.errors import SlackApiError
import logging
import os
import mongo_client
from typing import Optional, List, Union
import random
client = WebClient(token=os.environ.get("SLACK_TOKEN"))
good_words_collection = mongo_client.get_good_... | isaacson-f/slack-bots | goodwords_service.py | goodwords_service.py | py | 2,887 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "slack_sdk.WebClient",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.environ.get",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "mongo_client.get_g... |
8528358737 | """
crown.py
COMP9444, CSE, UNSW
"""
import torch
import torch.nn as nn
import matplotlib.pyplot as plt
# the data for this task has three columns: x y and class.
# the input of nn will be x and y, and the output will be a binary class.
class Full3Net(torch.nn.Module):
# assume we have a linear nn here:
... | sijinwnag/COMP9444_HW1 | hw1/crown.py | crown.py | py | 2,002 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "torch.nn",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "torch.nn.Linear",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "torch.nn.Linear",
"line_nu... |
39189785619 | """
Example of the FrequentistSurface plot.
Usage: surf_plot.py FILE
where FILE is a file containing Surface to be plotted. The surface is expected
to be found in the `/surface` directory of the FILE.
"""
import sys
import matplotlib.pyplot as plt
from cafplot import load
from cafplot.plot.surface import (
plot_... | usert5432/cafplot | examples/surf_plot.py | surf_plot.py | py | 791 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "cafplot.load",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "matplotlib.pypl... |
5033666757 | from django.shortcuts import render
from django.http import HttpResponse, HttpResponseRedirect
from django.db import transaction
from django.template import loader
from django.core.exceptions import ValidationError
from django.contrib.auth import authenticate, login, logout
from django.contrib import messages
from djan... | davidbarat/P13 | needhelp/help/views.py | views.py | py | 3,219 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.template.loader.get_template",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "django.template.loader",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "django.http.HttpResponse",
"line_number": 18,
"usage_type": "call"
},
{
... |
24206813915 | import webapp2
import jinja2
import os
from google.appengine.ext import db
template_dir = os.path.join(os.path.dirname(__file__), 'templates')
template_env = jinja2.Environment(loader=jinja2.FileSystemLoader(template_dir), autoescape=True)
def to_render(template, **para):
t = template_env.get_template(template)
... | tongtie/udacity | WebDevelopment/hw3/my_solution.py | my_solution.py | py | 2,089 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.path.join",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "jinja2.Environment",
"line... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.