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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
32095702696 | """
leave/models.py - Module containing models for leave management.
This module defines the LeaveApplication model for managing leave-related information.
"""
from django.db import models
from django.conf import settings
from django.contrib.auth.models import User
class LeaveApplication(models.Model):
"""... | Ardinenukuri/IGA | leave/models.py | models.py | py | 1,412 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "django.db.models.Model",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "django.db.models.DateField",
"line_number": 26,
"usage_type": "call"
},
{
"api_name"... |
72238117439 | from itertools import count
import json
import re
from time import sleep
import httpx
from lxml.etree import HTML
from _log import log
class Unipus:
def __init__(self):
self.client = httpx.Client()
with open("config.json", "r") as f:
self.config = json.load(f)
self.baseURL = s... | xqm32/unipus-spider | main.py | main.py | py | 3,408 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "httpx.Client",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "lxml.etree.HTML",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "_log.log.info",
"line_numb... |
26758317597 | # -*- coding:utf-8 -*-
# @author xupingmao <578749341@qq.com>
# @since 2016/12/05
# @modified 2020/01/30 16:13:43
import os
import json
import web
import math
import inspect
import six
import xconfig
import xauth
import xutils
from tornado.template import Template, Loader
from xutils import dateutil, quote, u
from xuti... | gotonking/miniNote | core/xtemplate.py | xtemplate.py | py | 13,929 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "xconfig.HANDLERS_DIR",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "xutils.dateutil.format_date",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "xutils.dateutil",
"line_number": 20,
"usage_type": "name"
},
{
"api_na... |
12775829408 | # %%
from collections import defaultdict
import json
import os
import numpy as np
import pandas as pd
from matplotlib.pyplot import hist
from skmultilearn.model_selection import iterative_train_test_split
# enable lib loading even if not installed as a pip package or in PYTHONPATH
# also convenient for relative path... | aksg87/adpkd-segmentation-pytorch | notebooks/stratification_checks_sep_24.py | stratification_checks_sep_24.py | py | 4,373 | python | en | code | 11 | github-code | 97 | [
{
"api_name": "os.chdir",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "adpkd_segmentation.data.link_data.makelinks",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "adp... |
32560104216 | import requests
from langdetect import detect
def translate_to_english(text):
if not is_chinese(text):
return text
url = "http://fanyi.youdao.com/translate?doctype=json"
params = {
"i": text,
"from": "auto",
"to": "en",
}
response = requests.get(url, params=params)
... | bravekingzhang/text2video | translate.py | translate.py | py | 758 | python | en | code | 124 | github-code | 97 | [
{
"api_name": "requests.get",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "langdetect.detect",
"line_number": 27,
"usage_type": "call"
}
] |
44322659231 | # TensorFlow and tf.keras
import tensorflow as tf
from tensorflow import keras
import numpy as np
import matplotlib.pyplot as plt
import scipy.io as sio
from keras.models import Sequential
from keras.layers.convolutional import Conv2D
from keras.layers.convolutional import Conv1D
from keras.layers.normalization import... | ustc-liu-zz/CNN-example_1 | PRL_120_066401_CNN.py | PRL_120_066401_CNN.py | py | 6,229 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "scipy.io.loadmat",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "scipy.io",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "scipy.io.loadmat",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "scipy.io",
"line_numbe... |
24434657988 | import os, tkinter
import webbrowser
from tkinter import ttk, messagebox
from PIL import Image, ImageTk
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
import datasource
plt.rcParams['font.sans-serif'] = 'SimHei'
plt.rcParams['axes.unicode_minus'] = False
if not os.path.exis... | Modnars/2019-nCoV | ui.py | ui.py | py | 19,507 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "matplotlib.pyplot.rcParams",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.rcParams",
"line_number": 13,
"usage_type": "attribute"
},
{
... |
18131861556 | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import cv2
import tensorflow as tf
from sklearn.utils import shuffle
import keras
# Set the memory growth to true for the GPU to expand the memory as needed
sess = tf.compat.v1.Session(config=tf.compat.v1.ConfigProto(log_device_placement... | AlexTindeche/DeepHallucinationClassification | Tindeche_Alexandru_231/Tindeche_Alexandru_231/Tindeche_Alexandru_231/CNN.py | CNN.py | py | 9,396 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "tensorflow.compat.v1.Session",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "tensorflow.compat",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.compat.v1.ConfigProto",
"line_number": 11,
"usage_type": "call"
},
{
... |
75041825278 | from kivy.lang.builder import Builder
from kivymd.app import MDApp
from kivy.uix.screenmanager import ScreenManager, Screen
import pyqrcode
qr = """
MDScreen:
MDCard:
size_hint: None, None
size: 300, 450
orientation: "vertical"
padding: 20
spacing: 20
... | CHARANKUMAR2002/QR-Generator-KivyMD-Python | QR Code Generator.py | QR Code Generator.py | py | 2,803 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "kivymd.app.MDApp",
"line_number": 51,
"usage_type": "name"
},
{
"api_name": "kivy.lang.builder.Builder.load_string",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "kivy.lang.builder.Builder",
"line_number": 55,
"usage_type": "name"
},
{
"... |
74732798399 | #!/usr/bin/env python3
import click
import sys
import csv
__author__ = 'mgooch'
@click.command(help="Collect Unique entries from first column of maf file")
@click.option('--maf', type=click.File('r'), required=True, help="file to collect names from")
@click.option('--out', type=click.File('w+'), default=sys.stdout, h... | kotoroshinoto/TCGA_MAF_Analysis | gooch_maf_tools/commands/names/MAF_collect_unique_symbols.py | MAF_collect_unique_symbols.py | py | 709 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "csv.reader",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "click.command",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "click.option",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "click.File",
"line_number": 9... |
3396523066 | from operator import itemgetter
import time
import json
from utils import constants
def extractIngredients(string, start='(', stop=')'):
return string[string.index(start) + 1:string.index(stop)]
def scrapeTavernData(driver, close_after=True):
data = {}
juice_map = {}
phone_map = {}
kitchen_map =... | geioi/crime-ee-macros | scrapers/tavern_scraper.py | tavern_scraper.py | py | 3,430 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "utils.constants.ITEM_KITCHEN",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "utils.constants",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "utils.constants.ITEM_CELLAR",
"line_number": 22,
"usage_type": "attribute"
},
{
... |
34914402982 | from datetime import datetime
import pytest
from linotp.app import LinOTPApp
from linotp.cli import get_backup_filename
@pytest.fixture
def app():
"""
A minimal app for testing
The app is configured with an unitialised database and Testing mode
"""
app = LinOTPApp()
config = {
"TEST... | LinOTP/LinOTP | linotp/tests/unit/cli/test_cli.py | test_cli.py | py | 1,984 | python | en | code | 484 | github-code | 97 | [
{
"api_name": "linotp.app.LinOTPApp",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pytest.fixture",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "linotp.cli.get_backup_filename",
"line_number": 83,
"usage_type": "call"
},
{
"api_name":... |
1267710896 | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
# Sample data
x = pd.Series([4, 8, 9, 8, 8, 12, 6, 10, 6, 9])
y = pd.Series([9, 20, 22, 15, 17, 30, 18, 25, 10, 20])
# Calculate each values and estimation parameters
n = x.size
sumy = y.sum(); avgy = y.mean()
sumx = x.sum(); avgx = x.mean()
sumx... | hschoi0705/KNU_DataScience101 | Week10/regression.py | regression.py | py | 1,384 | python | en | code | 5 | github-code | 97 | [
{
"api_name": "pandas.Series",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pandas.Series",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
... |
72009403838 | from art import logo
print(f"{logo}\nWelcome to the secret auction program.")
auction_start = True
auction = {}
def add_person(person_name, bid_amount):
new_person = {person_name: bid_amount}
auction.update(new_person)
def who_won():
bidder = list(auction.keys())
values = list(auction.values())
... | kmangar/100-Days-of-python | Day9 BlindAuction/blindAuction.py | blindAuction.py | py | 937 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "art.logo",
"line_number": 3,
"usage_type": "name"
}
] |
13052902144 | from app import db
from pytz import timezone
from datetime import datetime
def to_iso(date):
try:
return date.isoformat()
except AttributeError:
return None
class Accesorio(db.Model):
__tablename__ = 'neg_taccesorio'
acc_id = db.Column(db.Integer, primary_key = True, autoincrement = Tr... | LeynerBejarano/VestidosTrajesYTO | app/model/accesorio.py | accesorio.py | py | 2,294 | python | es | code | 0 | github-code | 97 | [
{
"api_name": "app.db.Model",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "app.db",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "app.db.Column",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "app.db",
"line_number": 13... |
19955829538 | from django.http import QueryDict
from django.http.request import HttpRequest
from rest_framework.status import (
HTTP_200_OK,
HTTP_201_CREATED,
HTTP_202_ACCEPTED,
HTTP_406_NOT_ACCEPTABLE,
HTTP_403_FORBIDDEN,
)
from rest_framework.response import Response
from rest_framework.viewsets import ViewSet... | Reyzhehal/Fyiona | fyiona/stories/views.py | views.py | py | 3,161 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "rest_framework.viewsets.ViewSet",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "serializers.StorySerializer",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "users.middlewares.JWTAuthentication",
"line_number": 33,
"usage_type": "name"... |
14303561186 | from random import shuffle
from math import sqrt
from math import ceil
import argparse
class StatisticCreator:
def __init__(self, number_runs, board_size=100, chances_ratio=0.5):
self.number_runs = number_runs
self.board_size = board_size
self.chances_ratio = chances_ratio
self.cnt... | ucczs/hundred_prisoner_puzzle | hundred_prisoner_puzzle.py | hundred_prisoner_puzzle.py | py | 3,863 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "random.shuffle",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "math.ceil",
"line_number": 59,
"usage_type": "call"
},
{
"api_name": "math.sqrt",
"line_number": 59,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"lin... |
73434259838 | import sys, os, pathlib
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.backends.backend_pdf import PdfPages
sys.path.append(str(pathlib.Path(__file__).resolve().parents[2]))
from physion.dataviz.datavyz.datavyz import graph_env_manuscript as ge
from physion.analysis import read_NWB
from p... | yzerlaut/old_physion | physion/analysis/behavioral_modulation.py | behavioral_modulation.py | py | 25,504 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "sys.path.append",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "pathlib.Path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.random.seed",
"line... |
27450190977 | import urllib.request
from urllib.request import Request, urlopen
from bs4 import BeautifulSoup as BS
import csv
import re
URL = "https://www.leefilters.com/lighting/colour-list.html"
page = 0
limit = 0
fullNames = []
codes = []
colorValues = []
req = Request(URL, headers={'User-Agent': 'Mozilla/5.0'})
with urll... | Liamc0950/LightLine | leeCSV.py | leeCSV.py | py | 1,112 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "urllib.request.Request",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "urllib.request.request.urlopen",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "urllib.request.request",
"line_number": 20,
"usage_type": "attribute"
},
{
... |
44343512076 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from core.config import cfg
from utils.c2 import const_fill
from utils.c2 import gauss_fill
import modeling.ResNet as ResNet
import utils.blob as blob_utils
# ---------... | qinhuan/detectron | lib/modeling/boundary_heads.py | boundary_heads.py | py | 7,449 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "core.config.cfg.BOUNDARY",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "core.config.cfg",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "core.config.cfg.MODEL",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name... |
19224055389 | '''
Author: Sungjun Han, Anastasiia
Description: calcalates accuracy
'''
import numpy as np
import re
from collections import defaultdict
import json
import sys
def tokenize(sent,
delimiters = r'\s+'):
'''
Description : tokenizes the given string using the delimiter
sent : str
delimiters : str
'''
tok... | hansungj/NLPLab | nli/preprocess.py | preprocess.py | py | 3,244 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "re.split",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 32,
"usage_type": "call"
}
] |
74608299840 | import requests
import json
import os
from dotenv import load_dotenv
dotenv_path = os.path.join(os.path.dirname(__file__), '../../.env')
load_dotenv(dotenv_path)
base_url = os.getenv('2023oct25_WEAVIATE_URL')
weaviate_class_name = os.getenv('2023oct25_WEAVIATE_CLASS_NAME')
weaviate_object_value = os.getenv('2023oct2... | tillo13/azure_bot | utilities/weaviate_python/query_cosine_similarity.py | query_cosine_similarity.py | py | 2,018 | python | en | code | 0 | github-code | 97 | [
{
"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": "dotenv.load_dotenv",
"line... |
35332141197 | from typing import List
from collections import Counter
import io
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.lines as mlines
import pandas as pd
import seaborn as sns
from torch.utils.data import TensorDataset
# optdigits, image, covtype
def make_class_map(datasets):
def get_labels(dat... | neilzxu/robust_weighted_classification | src/utils.py | utils.py | py | 3,370 | python | en | code | 8 | github-code | 97 | [
{
"api_name": "collections.Counter",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "typing.List",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "collections.Counter",
... |
36324482147 | import tkinter
import customtkinter
#from msilib import RadioButtonGroup
from ssl import get_default_verify_paths
import tkinter as tk
from typing import Counter
import requests
from bs4 import BeautifulSoup
import numpy as np
from tkinter import Toplevel, messagebox
import tkinter.ttk as ttk
import webbrowser
import p... | fuy116/4433_tool | 4433.py | 4433.py | py | 8,021 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "customtkinter.set_appearance_mode",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "customtkinter.set_default_color_theme",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "customtkinter.CTk",
"line_number": 18,
"usage_type": "call"
},
... |
36370556549 | # coding: utf-8
from fabric.api import run, env, cd, prefix, shell_env, local
from config import load_config
config = load_config()
host_string = config.HOST_STRING
def deploy():
env.host_string = config.HOST_STRING
run('sudo chmod -R 777 /var/www/tetrafoil/**/**/')
#run('sudo chmod -R 777 /var/www/tetra... | vladimirmyshkovski/tetrafoil | fabfile.py | fabfile.py | py | 1,272 | python | en | code | 4 | github-code | 97 | [
{
"api_name": "config.load_config",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "config.HOST_STRING",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "fabric.api.env.host_string",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name... |
30286621171 | from lib.actions import BaseAction
__all__ = [
'CreateDNSRecordAction'
]
class CreateDNSRecordAction(BaseAction):
api_type = 'dns'
def run(self, credentials, domain, name, type, data, ttl=500):
driver = self._get_driver_for_credentials(credentials=credentials)
zones = driver.list_zones()... | StackStorm/st2contrib | packs/libcloud/actions/create_dns_record.py | create_dns_record.py | py | 811 | python | en | code | 154 | github-code | 97 | [
{
"api_name": "lib.actions.BaseAction",
"line_number": 8,
"usage_type": "name"
}
] |
3447251080 | import cv2
import numpy as np
import os
def in_c(x, y, contour):
result = cv2.pointPolygonTest(contour, (x, y), False)
if (result == 1):
return True
else:
return False
def mean_c(image, contour):
s = 0
k = 0
step = 10
xx, yy, w, h = cv2.boundingRect(contour)
for y in ... | mikhaiLLashin/Kavitation_bubbles | cv_find_for_videos.py | cv_find_for_videos.py | py | 3,185 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "cv2.pointPolygonTest",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "cv2.boundingRect",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "cv2.namedWindow",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "cv2.WINDOW_NORMA... |
28596792720 | from DDPG import Agent
import gym
import numpy as np
from gym import wrappers
import os
if __name__ == '__main__':
env = gym.make('BipedalWalker-v3')
agent = Agent(alpha=0.00005, beta=0.0005, input_dims=[24], tau=0.001, env=env,
n_actions=4, batch_size=64, layer1_size=400, layer2_size=300,
... | T3CU/AI_Walker | DDPG_Tensorflow/main.py | main.py | py | 1,175 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "gym.make",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "DDPG.Agent",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.random.seed",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number":... |
42712992737 | import os
import time
import pandas as pd
import numpy as np
from PyTorch.data_analysis.build_DataStore import ForexDataset
import torch
import torch.nn as nn
from torch.utils.data import TensorDataset, DataLoader
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
batch_size=300
learn_rate=1... | amimai/NNets | PyTorch/data_analysis/old/test_model1.py | test_model1.py | py | 5,287 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "torch.device",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "torch.cuda.is_available",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "pandas.read_csv"... |
2981493683 | import math
from math import ceil, cos, floor, pi, sin, sqrt
from typing import Tuple
import numpy as np
def euclidean_distance(a, b):
dx = a[0] - b[0]
dy = a[1] - b[1]
return sqrt(dx * dx + dy * dy)
def poisson_disc_samples(width, height, r, k=5, distance=euclidean_distance):
tau = 2 * pi
cell... | trailfog/Karabo-Pipeline | karabo/util/math_util.py | math_util.py | py | 3,254 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "math.sqrt",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "math.pi",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "math.sqrt",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 17,
... |
70742773759 | #!/bin/python
# coding: utf-8
# RPC WP Backdoor
#
import requests, sys, os, base64
from xml.etree import ElementTree
import urllib3
urllib3.disable_warnings()
def check(host):
try:
r = requests.post(host + '/xmlrpc.php', data='<?xml version="1.0" encoding="UTF-8"?><methodCall><methodName>wp.getpostsyste... | carlosevieira/Wordpress-RPC-Backdoor | rpc.py | rpc.py | py | 2,508 | python | en | code | 4 | github-code | 97 | [
{
"api_name": "urllib3.disable_warnings",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "base64.b64encode",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "requests.post"... |
14224122799 | import json
import os
import re
import subprocess
import time
from os.path import abspath, join, dirname, splitext, basename
from collections import defaultdict
from Bio import Phylo
from flask import Flask, render_template, send_from_directory, abort, redirect, send_file, url_for
from flask import Response, request
f... | vladsavelyev/ClearUp | clearup/sample_view.py | sample_view.py | py | 7,035 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "Bio.Phylo.parse",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "Bio.Phylo",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "clearup.utils.FASTA_ID_PROJECT_SEPARATOR",
"line_number": 31,
"usage_type": "argument"
},
{
"api_name":... |
34001809721 | from sklearn.gaussian_process import GaussianProcessRegressor
from sklearn.gaussian_process.kernels import RBF
from sklearn.gaussian_process.tests._mini_sequence_kernel import MiniSeqKernel
import unittest
import numpy as np
kernel = MiniSeqKernel(baseline_similarity_bounds='fixed')
gpr = GaussianProcessRegressor(kern... | rajpatel5/scikit-contributions | a2/18318-testsuite.py | 18318-testsuite.py | py | 2,171 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "sklearn.gaussian_process.tests._mini_sequence_kernel.MiniSeqKernel",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sklearn.gaussian_process.GaussianProcessRegressor",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "unittest.TestCase",
"line_... |
10798776295 | from typing import List
"""
Given an array of integers, return indices of the two numbers such that they add up to a specific target.
You may assume that each input would have exactly one solution, and you may not use the same element twice.
Example:
Given nums = [2, 7, 11, 15], target = 9,
Because nums[0] + nums... | Cosin/leetcode-python | src/1-two-sum.py | 1-two-sum.py | py | 1,499 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "typing.List",
"line_number": 41,
"usage_type": "name"
}
] |
37060062689 | import tensorflow as tf
import cv2 as cv
import numpy as np
import matplotlib.pyplot as plt
from tensorflow.python.keras import layers, models
from keras.datasets import cifar10
from random import randint
from BuildImageDataset import labelDic, revLabelDic
from keras.preprocessing.image import ImageDataGenerator
import... | BruceMD/ChessCheater | IdentifyChessPieces.py | IdentifyChessPieces.py | py | 3,927 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "numpy.load",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.load",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.load",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.load",
"line_number": 18,
... |
41980785544 | import sys
from lxml import html
from datetime import datetime
import re
from model.email import EmailTransport
import time
sys.path.append('../../')
from model.msb import MsbAccount
from model.transaction import Transaction
from model.config import Config
from model.log import Log
from model.code import GenerateCode
... | bachlee89/payment-gateways | src/connector/http/msb.py | msb.py | py | 10,457 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "sys.path.append",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "converter.captcha.CaptchaResolver",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "model.c... |
29123085840 | from collections import defaultdict
from copy import copy
class Graph:
def __init__(self, size):
self.V = size
self.graph = defaultdict(list)
self.paths = []
def add_edge(self, u, v):
self.graph[u].append(v)
'''A recursive function to print all paths from 'u' to 'd'.
... | arpitkalla/bezier-rrt | graph.py | graph.py | py | 1,574 | python | en | code | 4 | github-code | 97 | [
{
"api_name": "collections.defaultdict",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "copy.copy",
"line_number": 26,
"usage_type": "call"
}
] |
31767323600 | from typing import Union
import numpy as np
class AverageMeter(object):
def __init__(self):
self.val: float = 0.
self.avg: float = 0.
self.sum: float = 0.
self.count: int = 0
def update(self, val: Union[int, float, np.ndarray], n: int = 1) -> None:
self.val = val
... | gsq7474741/bp | utils/common.py | common.py | py | 1,157 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "typing.Union",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "numpy.ndarray",
"line_number": 13,
"usage_type": "attribute"
}
] |
38331520821 | from tqdm import tqdm
import torch
import torch.nn.functional as F
import torch.nn as nn
import clip
def cls_acc(output, target, topk=1):
pred = output.topk(topk, 1, True, True)[1].t()
correct = pred.eq(target.view(1, -1).expand_as(pred))
acc = float(correct[: topk].reshape(-1).float().sum(0, keepdim=Tr... | gaopengcuhk/Tip-Adapter | utils.py | utils.py | py | 4,974 | python | en | code | 383 | github-code | 97 | [
{
"api_name": "torch.no_grad",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "clip.tokenize",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "torch.stack",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "torch.no_grad",
"line_num... |
21757494667 | from os import F_OK, access, getcwd, sep
import platform
from re import search
import sys
from time import sleep
from warnings import warn
import webbrowser
import wx
# relax module imports.
from data_store import Relax_data_store; ds = Relax_data_store()
from data_store.gui import Gui
import dep_check
from graphics i... | nmr-relax/relax | gui/relax_gui.py | relax_gui.py | py | 36,039 | python | en | code | 10 | github-code | 97 | [
{
"api_name": "data_store.Relax_data_store",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "gui.uf_objects.Uf_storage",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "status.Status",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "w... |
18629167272 | # encoding: utf-8
'''
@author: gaoyongxian666
@file: demo10.py
@time: 2018/5/26 19:40
'''
# 子图操作
# 自定义操控图表
import matplotlib.pyplot as plt
def graph_data(stock):
# 为了修改图表,我们需要引用它,所以我们将它存储到变量fig。
fig = plt.figure()
# 将ax1定义为图表上的子图。 我们在这里使用subplot2grid,这是获取子图的两种主要方法之一。
# 我们将深入讨论这些东西,但现在,你应该看到我们有2个元组,它... | Gaoyongxian666/matplotlib_demo | demo10.py | demo10.py | py | 1,576 | python | zh | code | 0 | github-code | 97 | [
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.subplot2grid",
"line_number": 20,
"usage_type": "call"
},
{
"api_nam... |
6490647099 | # -*- coding: utf-8 -*-
import os
import errno
import requests
import click
from pkg_resources import Requirement
_GENERIC_ADDRESS = "https://pypi.org/pypi/{package}/json"
def build_package_cache(settings, package):
"""Download all package versions from PyPI for specified package."""
pkg_urls = resolve_... | astamminger/pypi_downloader | pypi_downloader/pypi_downloader.py | pypi_downloader.py | py | 4,710 | python | en | code | 2 | github-code | 97 | [
{
"api_name": "click.progressbar",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "pkg_resources.Requirement... |
7716711482 | import telebot
import openai
from telebot import custom_filters
bot = telebot.TeleBot('YOUR API KEY telegram, chat whith @BotFather')
openai.api_key = "YOUR API KEY OPEN AI"
# Check if message starts with bot tag
@bot.message_handler(text_startswith="bot")
def start_filter(message):
psn = message.text
cmd = p... | akhsan20/telegram-chatgpt | telegram-chatgpt.py | telegram-chatgpt.py | py | 1,393 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "telebot.TeleBot",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "openai.api_key",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "openai.Completion.create",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "openai.Com... |
33467212563 | #guabikinjson ke a json
# import json
# file = open('a.json','w')
# data = [
# {'nama':'raka'},
# {'usia':24},
# {'kota':'Jakarta'},
# ]
# dataJSON = json.dumps(data)
# file.write(dataJSON)
# file.close()
#insert mongo
# db.gudang.insert([
# {nama: 'kaos','harga':10000},
# {nama: 'jaket','harga':20000},... | rakaadli/JCDS19 | latihanadji.py | latihanadji.py | py | 1,904 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pymongo.MongoClient",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 86,
"usage_type": "call"
},
{
"api_name": "csv.DictWriter",
"line_number": 88,
"usage_type": "call"
}
] |
74518902718 | import json
from django.conf import settings
from django.forms import Widget
DEFAULT_ACCEPT_MIMETYPE = "*/*"
class CloudObjectWidget(Widget):
"""A widget allowing upload of a file directly to cloud storage
Must be placed in a form context. On submission of the form,
upload is started. The submission is... | octue/django-gcp | django_gcp/storage/widgets.py | widgets.py | py | 2,110 | python | en | code | 4 | github-code | 97 | [
{
"api_name": "django.forms.Widget",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "django.conf.settings.INSTALLED_APPS",
"line_number": 42,
"usage_type": "attribute"
},
{
"api_name": "django.conf.settings",
"line_number": 42,
"usage_type": "name"
},
{
"... |
31129169525 | import datetime
from flask import Flask, render_template, make_response, url_for, request, session
import os
app = Flask(__name__)
app.config['SECRET_KEY'] = os.environ.get('SECRET_KEY2', '../.env')
app.permanent_session_lifetime = datetime.timedelta(days=10)
@app.route('/')
def index():
if 'visits' in session:
... | GavdzinskyiVeacheslav/Flask | Flask lessons from scratch/Lesson_12_How_to_work_with_sessions.py | Lesson_12_How_to_work_with_sessions.py | py | 874 | python | en | code | 3 | github-code | 97 | [
{
"api_name": "flask.Flask",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.environ.get",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "datetime.timedelta",
"lin... |
70592387838 | # -*- coding: utf-8 -*-
import scrapy
def get_userbody(response, value):
return response.xpath('//span[text()="compensation: "]/b/text()').get()
class JobsSpider(scrapy.Spider):
name = 'jobs'
allowed_domains = ['losangeles.craigslist.org']
start_urls = ['https://losangeles.craigslist.org/search/egr'... | bababaff/scrapy-craigslist | craigslist/spiders/jobs.py | jobs.py | py | 2,108 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "scrapy.Spider",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "scrapy.Request",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "scrapy.Request",
"line_number": 37,
"usage_type": "call"
}
] |
8651728582 | import psycopg2
from API.config import config
def connect():
connection = None
try:
params = config()
print('Connecting to the postgreSQL database ...')
connection = psycopg2.connect(**params)
crsr = connection.cursor()
print('PostgreSQL database version: ')
crs... | irinaexzellent/HTTP-api-database | webapp/API/connect.py | connect.py | py | 536 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "API.config.config",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "psycopg2.connect",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "psycopg2.DatabaseError",
"line_number": 18,
"usage_type": "attribute"
}
] |
4799228940 | import cv2
import dlib
#cinco subdetectores utilizados pelo dlib
subdetector = ["face frontal", "face a esquerda", "face a direita", "a frente girando a esquerda", "a frente girando a direita"]
imagem = cv2.imread("fotos/grupo.0.jpg")
detector = dlib.get_frontal_face_detector() #nao precisa passar os haar cascades co... | robertoclopes/dlibpython | dlib/deteccao_face_hog2.py | deteccao_face_hog2.py | py | 1,086 | python | pt | code | 0 | github-code | 97 | [
{
"api_name": "cv2.imread",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "dlib.get_frontal_face_detector",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "cv2.rectangle",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "cv2.imshow",
... |
24114244012 | import os
import pdb
import pickle
import time
import numpy as np
from inquire.environments.environment import CachedTask, Task
from inquire.utils.datatypes import Modality
from numpy.random import RandomState
def run(
domain,
teacher,
agent,
num_tasks,
num_runs,
num_queries,
num_test_sta... | HARPLab/inquire | inquire/run.py | run.py | py | 8,324 | python | en | code | 5 | github-code | 97 | [
{
"api_name": "numpy.random.RandomState",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "numpy.random.RandomState",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "numpy.z... |
7209240293 | import gzip
from io import StringIO
import numpy as np
import pytest
from cyvcf2 import VCF
from numpy.testing import assert_array_equal
from sgkit.io.dataset import load_dataset
from sgkit.io.vcf.vcf_reader import vcf_to_zarr, zarr_array_sizes
from sgkit.io.vcf.vcf_writer import write_vcf, zarr_to_vcf
from sgkit.tes... | pystatgen/sgkit | sgkit/tests/io/vcf/test_vcf_writer.py | test_vcf_writer.py | py | 10,181 | python | en | code | 175 | github-code | 97 | [
{
"api_name": "utils.path_for_test",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "vcf_writer.canonicalize_vcf",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "gzip.open",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "utils.path_... |
20672028555 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Apr 8 21:25:14 2021
@author: Joshua Atienza, Janet Zhang
@net-id: jra165, jrz42
@project: search-and-destroy
"""
import random
import time
from queue import PriorityQueue, Queue
from typing import List, Tuple
class Landscape:
def __init__(self... | jra165/searchanddestroy | main.py | main.py | py | 21,952 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "typing.List",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "queue.PriorityQueue",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "typing.Tuple",
"line_... |
6466652300 | from torch.utils.data import Dataset, DataLoader
import json
class KBPCoref(Dataset):
def __init__(self, data_file):
self.data = self.load_data(data_file)
def _get_event_cluster_id(self, event_id:str, clusters:list) -> str:
for cluster in clusters:
if event_id in cluster['event... | jsksxs360/prompt-event-coref-emnlp2023 | src/sample_selector/data.py | data.py | py | 3,224 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "torch.utils.data.Dataset",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "json.loads",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "torch.utils.data.DataLoader",
"line_number": 80,
"usage_type": "call"
}
] |
42198134809 | """
Calamari setup task
"""
import contextlib
import logging
import os
import requests
import shutil
import webbrowser
from cStringIO import StringIO
from teuthology.orchestra import run
from teuthology import contextutil
from teuthology import misc
log = logging.getLogger(__name__)
DEFAULTS = {
'version': 'v0.... | lidaohang/ceph_study | ceph/qa/tasks/calamari_setup.py | calamari_setup.py | py | 15,735 | python | en | code | 326 | github-code | 97 | [
{
"api_name": "logging.getLogger",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "teuthology.contextutil.nested",
"line_number": 64,
"usage_type": "call"
},
{
"api_name": "teuthology.contextutil",
"line_number": 64,
"usage_type": "name"
},
{
"api_name":... |
29798972632 | from framework.utils.data.word_embedding import WordEmbedding
import math
import json
import pickle
import os
dataset = 'devtest'
if dataset == 'valid':
output_data_file = 'valid_txt.txt'
input_path = '../../../NeuralRewriting/eval/uhrs_dec_2017/valid.json'
output_path = '../../../NeuralRewriting/eval/valid.json'... | thangduong/grammar | exp/thduon/we_test/test.py | test.py | py | 3,996 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "framework.utils.data.word_embedding.WordEmbedding.from_file",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "framework.utils.data.word_embedding.WordEmbedding",
"line_number": 48,
"usage_type": "name"
},
{
"api_name": "framework.utils.data.word_embedding... |
5089611750 | from mnist import MNIST
import minitorch
import visdom
import numpy
vis = visdom.Visdom()
mndata = MNIST("data/")
images, labels = mndata.load_training()
BACKEND = minitorch.make_tensor_backend(minitorch.FastOps)
BATCH = 16
N = 5000
# Number of classes (10 digits)
C = 10
# Size of images (height and width)
H, W =... | Dearkano/MiniTorch | minitorch-4-Dearkano/project/run_mnist_multiclass.py | run_mnist_multiclass.py | py | 6,132 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "visdom.Visdom",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "mnist.MNIST",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "minitorch.make_tensor_backend",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "minitorch.FastO... |
73443676160 | from __future__ import print_function, division
from builtins import range
# Note: you may need to update your version of future
# sudo pip install -U future
# Some utility functions we need for the class.
# For the class Data Science: Practical Deep Learning Concepts in Theano and TensorFlow
# https://deeplearningcou... | nsaura/ML | codes_python/TF/util.py | util.py | py | 4,150 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "numpy.random.randn",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "numpy.array",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "numpy.random.randn",... |
5655714134 | import os
import json
import asyncio
from typing import Dict, List
AZCOPY_PATH = os.getenv('AZCOPY_PATH')
# sample_storage_account_sftp_backup = {
# 'name': 'iisdpprodccstacc1',
# 'container': 'prime-reporting-prod',
# 'token': 'sp=rawl&st=2023-09-21T18:59:07Z&se=2027-01-02T03:59:07Z&spr=https&sv=2022-11-... | olegbogomaz/public | copy_files_between_storage_accounts.py | copy_files_between_storage_accounts.py | py | 9,262 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "os.getenv",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.environ.copy",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 40,
"usage_type": "attribute"
},
{
"api_name": "typing.Dict",
"line_numb... |
15794178961 | # Databricks notebook source
# MAGIC %md ### Test Repos - Notebook Experiment - main branch
# COMMAND ----------
import mlflow
client = mlflow.tracking.MlflowClient()
mlflow.__version__
# COMMAND ----------
import time
now = time.strftime("%Y-%m-%d %H:%M:%S", time.gmtime(time.time()))
with mlflow.start_run(run_nam... | amesar/dbx-repo | Test_Notebook_Experiment.py | Test_Notebook_Experiment.py | py | 1,460 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "mlflow.tracking.MlflowClient",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "mlflow.tracking",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "mlflow.__version__",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name":... |
29856202298 | from collections.abc import Generator
from fastapi import Cookie, Depends, HTTPException, status
from fastapi.responses import RedirectResponse
from sqlmodel import Session
from app import crud, models, settings
from app.core import security
from app.db.session import SessionLocal
class RedirectException(HTTPExcept... | martokk/python_fastapi_stack | app/views/deps.py | deps.py | py | 5,644 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "fastapi.HTTPException",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "app.db.session.SessionLocal",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "collections.abc.Generator",
"line_number": 17,
"usage_type": "name"
},
{
"api_n... |
28347408239 |
from random import random
from scipy import stats
def prob_mass_funct(p):
return [stats.binom.pmf(x, 4, p) for x in range(0,5)]
def gen_p_estim(sample_list, n):
return (sum(sample_list)/len(sample_list))/4
# calculo de t
def estadistico_t(freq_list, p_list, m):
t = 0.0
for i in range(len(p_list)):... | lucasea777/mys | pej5.py | pej5.py | py | 1,135 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "scipy.stats.binom.pmf",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "scipy.stats.binom",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "scipy.stats",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "scipy.stats.bin... |
12740531273 | from __future__ import absolute_import, division, print_function
import keras
from keras.datasets import mnist
from keras.models import Sequential
from keras.layers import Dense, Dropout, Flatten
from keras.layers import Conv2D, MaxPooling2D
from keras import backend as K
import tensorflow as tf
from tensorflow impor... | dannykuo25/Tensorflow-Lite-Example | 3_layer_model_construct.py | 3_layer_model_construct.py | py | 2,639 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "tensorflow.__version__",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.enable_eager_execution",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "tensorflow.keras.datasets.mnist.load_data",
"line_number": 23,
"usage_type"... |
15403203567 | import get_pacdata as pac
from scrape_pacdb import scrape_sugarbind_id as scrape
from scrape_pacdb.scrape_pacdb import jcgg2glytoucanid
import json
def get_agent_id(path, json_data):
# pacdb.jsonの全データから検索、取得
sci_name_list = pac.count_sci_name(json_data)
# data/agent.jsonのデータから取得できていないデータ(sugarbind_idが"")... | arakkkkk/glycovid_PACDB | get_sugarbind_id.py | get_sugarbind_id.py | py | 2,742 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "get_pacdata.count_sci_name",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "get_pacdata.count_sci_name2",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "scrape_pacdb.scrape_sugarbind_id.run_scrape",
"line_number": 14,
"usage_type": "ca... |
41747576027 | from inference_yolov5.inferc import inf
from inference_yolov5.hubconf import _create
import cv2
from datetime import datetime
import numpy as np
import torch
def check_status(path, model_yolo=None):
start_datetime = datetime.now()
img = cv2.imread(path)
# yolo
im_corp = inf(model_yolo, img=img... | lvstaller/hamburger_menu | infrerence_worker.py | infrerence_worker.py | py | 865 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "datetime.datetime.now",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "cv2.imread",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "inference_yolov5.i... |
28433351053 | '''
author: Francois Deloche
date: 2018, June
'''
import argparse
import re
import os
import sys
import random
parser = argparse.ArgumentParser()
parser.add_argument("--timit_folder", help='''Path of the TIMIT dataset. Contains the root folders SPHERE, TIMIT, CONVERT.
Alternatively it can be set a... | fdeloche/audacity-timit | audacity-timit.py | audacity-timit.py | py | 5,414 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sys.platform",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "os.getuid",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "os.getuid",
"... |
70424055039 | '''
@Time : 2020/04/23 22:19:58
@Author : Zhang Hui
'''
import sys
import io
import unicodedata
# 问题:去除变音符
if __name__ == '__main__':
sys.stdout = io.TextIOWrapper(
sys.stdout.buffer, encoding='utf8') # 改变标准输出的默认编码
s = 'pýtĥöñ\fis\tawesome\r\n'
print(s)
# 构建转换表格,清理空白字符
remap =... | zh805/PythonCookbook_Codes | Chapter_2_字符串和文本/2.12审查清理文本字符串.py | 2.12审查清理文本字符串.py | py | 1,465 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "sys.stdout",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "io.TextIOWrapper",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sys.stdout",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "sys.maxunicode",
... |
16174068798 | try:
import sys
import json
import pymel.core as pm
msg_result = sys.argv[1]
input_data = json.loads(sys.argv[2])
for name,path in input_data:
pm.openFile(path, force=True)
unknown_plugins = pm.unknownPlugin(query=True, list=True)
if unknown_plugins is None : unknown_plug... | Illogicstudios/unknown_plugin_scanner | scan_ref.py | scan_ref.py | py | 576 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "sys.argv",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "json.loads",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "pymel.core.openFile",
"line_n... |
13187076604 | from django.shortcuts import render,redirect,get_object_or_404
from account.models import User
from books.models import Book,Order
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.urls import reverse
from django.urls import resolve
from decimal import Decimal
fro... | dawidhubicki97/BookStore | src/cart/views.py | views.py | py | 1,817 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "django.shortcuts.get_object_or_404",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "cart.models.Cart",
"line_number": 14,
"usage_type": "argument"
},
{
"api_name": "books.models.Book.objects.filter",
"line_number": 15,
"usage_type": "call"
},
... |
24537138913 | from solutions.utils.io import get_list
from .solution import maximalNetworkRank
from ..utils import io
print('Enter number of nodes:', end=' ')
n = io.get(int)
print('Enter roads, e.g. 0,1 1,2 0,3 1,3:', end=' ')
roads = [[int(city) for city in road.split(',')]
for road in io.get_list(str)]
rank = maximalN... | ansonmiu0214/dsa-worked-solutions | solutions/maximal_network_rank/__main__.py | __main__.py | py | 379 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "utils.io.get",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "utils.io",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "utils.io.get_list",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "utils.io",
"line_number": 1... |
3259107137 | import math
import re
import unicodedata
from collections import Counter
from dataclasses import dataclass
from decimal import Decimal
from fractions import Fraction
from string import capwords
import nltk
from django.contrib.auth.models import User
from django.core.validators import URLValidator
from django.core.exc... | dredivaris/myhomebar | api/domain.py | domain.py | py | 23,145 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "api.validators.RecipeValidator",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "api.validators.RecipeValidator",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "recipe_scrapers.scrape_me",
"line_number": 45,
"usage_type": "call"
},
... |
30664856652 | import serial
import json
x = {"awake": 1}
y = json.dumps(x)
y = y + "\n"
ser = serial.Serial("/dev/ttyAMA0", 9600, timeout=1)
ser.flush()
# print(y)
ser.write(y.encode("ascii"))
# ser.write("\n".encode("ascii"))
while True:
line1 = ser.readline()
print(line1)
# line = line1.decode("utf-8")
# print(li... | jimbroze/RetroPlayer | serialTest.py | serialTest.py | py | 545 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "json.dumps",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "serial.Serial",
"line_number": 8,
"usage_type": "call"
}
] |
1987705505 | import os
import pandas as pd
import numpy as np
from sklearn.decomposition import PCA
from sklearn.manifold import TSNE
import seaborn as sns
import matplotlib.pyplot as plt
def load_data(file_path):
with open(file_path) as f:
return pd.read_csv(f)
def apply_pca(X, explained_variance_ratio_threshold=0.... | JordanConnolly/AI-Strategies-for-Nucleic-Acid-Origami-experiments | Ch_3/Clustering/Mobilenetv2_Clustering_Source_Code/PCA_input_to_tSNE_papers.py | PCA_input_to_tSNE_papers.py | py | 3,340 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pandas.read_csv",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sklearn.decomposition.PCA",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.argmax",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.cumsum",... |
5606984873 | from shutil import rmtree
from os import chdir, getcwd, sep
from argparse import ArgumentTypeError
import pytest
from _pytest.tmpdir import TempPathFactory
from grizzly_cli.argparse.bashcompletion.types import BashCompletionTypes
from ....helpers import onerror
CWD = getcwd()
class TestBashCompletionTypes:
c... | Biometria-se/grizzly-cli | tests/unit/argparse/bashcompletion/test_types.py | test_types.py | py | 4,243 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "os.getcwd",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "grizzly_cli.argparse.bashcompletion.types.BashCompletionTypes.File",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "grizzly_cli.argparse.bashcompletion.types.BashCompletionTypes",
... |
38527215630 | '''importing required modules'''
from flask import Flask,request,render_template,redirect,url_for
from flask_sqlalchemy import SQLAlchemy
app=Flask(__name__)
'''Identifying resource using Identifier'''
app.config["SQLALCHMEY_DATABASE_URI"]="mydatabase+pymysql://root:1234@localhost:3036/mydatabase";
app.config["DA... | Dhivya1210/programing-level-2 | Admin_db.py | Admin_db.py | py | 7,830 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "flask.Flask",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "flask_sqlalchemy.SQLAlchemy",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "flask.request.method",
"line_number": 40,
"usage_type": "attribute"
},
{
"api_name": "flask... |
35449834031 | from typing import Dict
from pydantic import BaseModel, Field
class InputSchema(BaseModel):
database_name: str = Field(
title='Database Name',
description='Name of the MongoDB database.'
)
collection_name: str = Field(
title='Collection Name',
description='Name of the Mongo... | unskript/Awesome-CloudOps-Automation | Mongo/legos/mongodb_write_query/mongodb_write_query.py | mongodb_write_query.py | py | 2,481 | python | en | code | 258 | github-code | 97 | [
{
"api_name": "pydantic.BaseModel",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "pydantic.Field",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pydantic.Field",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pydantic.Field",
"... |
40958381136 | #!/usr/bin/env python
# _*_ coding: utf-8 _*_
# Copyright(c) 2019 Nippon Telegraph and Telephone Corporation
# Filename: EmL3SliceUpdate.py
'''
Individual scenario of L2 slise update.
'''
import json
from lxml import etree
from EmMergeScenario import EmMergeScenario
import GlobalModule
from EmCommonLog impor... | multi-service-fabric/element-manager | lib/Scenario/EmL2SliceUpdate.py | EmL2SliceUpdate.py | py | 4,655 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "EmMergeScenario.EmMergeScenario",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "GlobalModule.SERVICE_L2_SLICE",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "GlobalModule.EM_NAME_SPACES",
"line_number": 32,
"usage_type": "attrib... |
73857866877 | '''
Code based on https://gist.github.com/benoit-cty/a5855dea9a4b7af03f1f53c07ee48d3c
Script to archive Slack messages from a channel list.
You have to create a Slack Bot and invite to private channels.
View https://github.com/docmarionum1/slack-archive-bot for how to configure your account.
This will download all ch... | TravisWheelerLab/slack-msgs | slack_backup.py | slack_backup.py | py | 7,578 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "os.environ",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "os.environ.get",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "os.environ.get",
"... |
15152710800 | # -*- coding: utf-8 -*-
import yaml
from addict import Dict
from data.dataloaders.datasets import cityscapes, coco, pascal
from torch.utils.data import DataLoader
def make_data_loader(args, **kwargs):
dataset_config = yaml.load(open(args.dataset_cfg, 'r'),Loader=yaml.FullLoader)
dataset_config = Dict(dataset_... | Irvingao/yolov5-segmentation | data/__init__.py | __init__.py | py | 2,441 | python | en | code | 11 | github-code | 97 | [
{
"api_name": "yaml.load",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "yaml.FullLoader",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "addict.Dict",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "data.dataloaders.datasets.pa... |
29341917379 | from PyQt5.QtCore import QObject, QTimer
import functools
@functools.lru_cache()
class GlobalObject(QObject):
"""
We need this to enable the textedit widget to communicate with the main window
"""
def __init__(self):
super().__init__()
self._events = {}
def addEventListener(self, ... | FreeLanguageTools/vocabsieve | vocabsieve/global_events.py | global_events.py | py | 621 | python | en | code | 216 | github-code | 97 | [
{
"api_name": "PyQt5.QtCore.QObject",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtCore.QTimer.singleShot",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtCore.QTimer",
"line_number": 23,
"usage_type": "name"
},
{
"api_name":... |
71600640959 | from django.shortcuts import render
from .forms import StateForm, AirportForm, CallsignForm
from .models import Airport
from .mypy import pathfindingweb as pthfndr
# Create your views here.
def fuel_index(request):
context = {}
if request.method == "POST":
if "callsign-submit" in request.POST:
... | skschiller1/BlogWebsite | programs/views.py | views.py | py | 1,612 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "forms.CallsignForm",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "mypy.pathfindingweb.main",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "mypy.pathfindingweb",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "forms... |
18364108120 | """Test the que.py module."""
import pytest
TEST_ENQ = [
(1, 2, 3),
(800, 'String', 5),
('String', ['list'], 17),
([5, 3, 17], [5, 'list two'], 'another string'),
('monkies', ['spiders', 'spidermonkey'], ('spi', 'der', 'monk'))
]
TEST_LEN = [
([1], 1),
((17, 5, 100), 3),
('String',... | jjfeore/data-structures-py | src/test_que.py | test_que.py | py | 2,038 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "que.Queue",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "pytest.fixture",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "pytest.mark.parametrize",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "pytest.mark",
... |
40095652409 | import queue
import logging
import threading
import typing as typ
from loguru import logger
import PIL.Image
import numpy as np
import trafaret as t
from . import utils
from .error import ConfigError, VideoDisplayError
try:
import cv2
except ImportError:
cv2 = None
class VideoDisplay:
"""Video display... | j4y33/Smart_Counting_Retail | smart_counter/displays.py | displays.py | py | 3,534 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "trafaret.Dict",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "trafaret.Key",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "trafaret.Key",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "trafaret.Key",
"line_numb... |
24858365222 | import json
import unittest
import urllib
import urllib2
import geo
class ElevationProvider:
def __init__(self, conf = {}):
self.conf = conf
def getElevationData(self, points):
raise NotImplementedError('Abstract method')
class ElevationProviderGoogle(ElevationProvider):
ELEVATION_... | mnezerka/bsgpx | bsgpx/elevation.py | elevation.py | py | 2,989 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "urllib.urlencode",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "urllib2.Request",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "urllib2.urlopen",
"li... |
28653559869 | import glob, json
import sqlite3 as sql
# dummy_record = [
# {
# 'ID':'_231489509_-1463812096',
# 'USER_NAME':'kimura',
# 'KEYWORD':'daab'
# },
# {
# 'ID':'_231493067_1694498816',
# 'USER_NAME':'inoue',
# 'KEYWORD':'daab'
# },
# {
# 'ID':'_231... | Yuto-kimura/mybot | py-server/sql.py | sql.py | py | 7,377 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "sqlite3.connect",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
... |
19233986791 | import argparse
from flask import Flask,request,jsonify
import json
import requests
import threading
import time
import pickle
from pathlib import Path
import os
app = Flask(__name__)
@app.route('/health')
def health():
return {"res":"live"}
@app.route('/store/<service>', methods=['GET', 'POST'])
def store(se... | danish241194/AI_BASED_ATTENDENCE_PLATFORM | code/Registry/registry.py | registry.py | py | 4,143 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "flask.Flask",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "flask.request.json",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "pathlib.Path",
... |
26082807536 | # -*- coding: utf-8 -*-
"""
Created on Tue Jul 30 10:52:58 2013
@author: pmaurier
"""
import os, sys
from datetime import date
from PyQt5 import QtCore, QtGui, QtWidgets, uic
from PyQt5.QtWidgets import QAbstractItemView
saved_columns_width = QtCore.QSettings("XL-ant", "Oryx")
# Define function to imp... | Oripy/Oryx | inventory.py | inventory.py | py | 27,087 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "PyQt5.QtCore.QSettings",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtCore",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "sys._MEIPASS",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath... |
32849984048 | # -*- coding: utf-8 -*-
import datetime
import json
import logging
import werkzeug
from werkzeug.exceptions import BadRequest
from odoo import SUPERUSER_ID, api, http, _
from odoo import registry as registry_get
from odoo.addons.auth_oauth.controllers.main import OAuthController as Controller
from odoo.addons.web.contr... | niulinlnc/odooExtModel | sms_base/controllers/sms_controller.py | sms_controller.py | py | 5,794 | python | en | code | 3 | github-code | 97 | [
{
"api_name": "logging.getLogger",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "odoo.addons.auth_oauth.controllers.main.OAuthController",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "odoo.http.request.session",
"line_number": 26,
"usage_type": "a... |
8868034208 | from flask import Flask, jsonify, request
from classifier import classify
from twitter_handler import get_recent_tweets
app = Flask(__name__)
def get_current_mood_percent():
"""Gets the current mood of the internet as a percent"""
tweets = get_recent_tweets()
positive_tweets = 0
negative_tweets = 0
... | rydercalmdown/internet_angryometer | src/app.py | app.py | py | 1,056 | python | en | code | 3 | github-code | 97 | [
{
"api_name": "flask.Flask",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "twitter_handler.get_recent_tweets",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "classifier.classify",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "flas... |
33248101389 | from .AbstractExporter import AbstractExporter
from ...common.Properties import Properties
from com.sun.star.io import IOException
# An exporter which is configured with a filter name, and
# uses the specified filter to export documents.
class FilterExporter(AbstractExporter):
filterName = ""
props = Propert... | NDCODF/NDC_ODF_Application_Tools | wizards/com/sun/star/wizards/web/export/FilterExporter.py | FilterExporter.py | py | 1,294 | python | en | code | 5 | github-code | 97 | [
{
"api_name": "AbstractExporter.AbstractExporter",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "common.Properties.Properties",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "com.sun.star.io.IOException",
"line_number": 28,
"usage_type": "name"
}
] |
2799055234 | import numpy as np
import cv2
def sketch(image):
gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
gblur = cv2.GaussianBlur(gray, (5,5), 0)
cedges = cv2.Canny(gblur, 10, 70)
ret, mask = cv2.threshold(cedges, 70, 255, cv2.THRESH_BINARY_INV)
return mask
cap = cv2.VideoCapture('data/video/DJI_0001.mp4')... | waternetold/datalab_hl_dronedeer | edge_detector.py | edge_detector.py | py | 507 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "cv2.cvtColor",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2GRAY",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "cv2.GaussianBlur",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "cv2.Canny",
"l... |
34943742889 | from datetime import date
from oslo_log import log as logging
from trove.common import stream_codecs
from trove.common import utils
from trove.guestagent.common import operating_system
from trove.guestagent.module.drivers import module_driver
LOG = logging.getLogger(__name__)
NR_ADD_LICENSE_CMD = ['nrsysmond-conf... | openstack/trove | trove/guestagent/module/drivers/new_relic_license_driver.py | new_relic_license_driver.py | py | 2,707 | python | en | code | 288 | github-code | 97 | [
{
"api_name": "oslo_log.log.getLogger",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "oslo_log.log",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "trove.guestagent.module.drivers.module_driver.ModuleDriver",
"line_number": 18,
"usage_type": "attrib... |
32756619525 | import math
import os
import time
import ffmpeg
def concatFrames():
os.system("ffmpeg -f concat -safe 0 -i list.txt -c:v 500k -c copy output.webm")
os.system("ffmpeg -i output.webm -i input.webm -c copy -map 0:v:0 -map 1:a:0 -shortest final.webm")
os.system('del frames\\*')
os.system('del ... | Pimeq/Discord-Webm | main.py | main.py | py | 1,805 | python | en | code | 4 | github-code | 97 | [
{
"api_name": "os.system",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.system",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.system",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.system",
"line_number": 12,
"u... |
41198834776 | """Original minimal designs based around nesting similar shapes."""
from itertools import cycle
import os
from random import random, choice
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
from numpy import pi, sin, cos
# ---------- Design and output parameters ------------
# ... for containe... | sadielbartholomew/creative-matplotlib | edge-descend/edge_descend.py | edge_descend.py | py | 9,387 | python | en | code | 45 | github-code | 97 | [
{
"api_name": "itertools.cycle",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "itertools.cycle",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "numpy.pi",
"line_number": 107,
"usage_type": "name"
},
{
"api_name": "random.random",
"line_n... |
37550159123 | from uvicorn import run
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from src.api.recommender_api import router as recommender_router
from src.config import \
ALLOWED_ORIGINS, ALLOWED_HEADERS, ALLOWED_METHODS, ALLOW_CREDENTIALS, DOCS_URL
app = FastAPI(title='AlkohoLove-recommende... | matixezor/AlkohoLove-recommender | src/main.py | main.py | py | 679 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "fastapi.FastAPI",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "src.config.DOCS_URL",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "fastapi.middleware.cors.CORSMiddleware",
"line_number": 12,
"usage_type": "argument"
},
{
"api_... |
28578565327 | import torch
import torch.nn as nn
import torch.nn.functional as F
class AdversarialLoss(nn.Module):
def __init__(self, loss_type='hinge', target_real_label=1., target_fake_label=0.):
super(AdversarialLoss, self).__init__()
self.loss_type = loss_type
self.register_buffer('real_label', torc... | kyuyeonpooh/Audio-Visual-Deep-Video-Inpainting | core/loss.py | loss.py | py | 2,602 | python | en | code | 7 | github-code | 97 | [
{
"api_name": "torch.nn.Module",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "torch.tensor",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "torch.tensor",
"line_num... |
4622509351 | import os
import datetime as dt
import time
import copy
import urllib.request, json
import pandas as pd
import numpy as np
from sklearn.model_selection import train_test_split
import george
from kernel import kernel
from cs import cs_to_stdev, stdev_to_cs
from pandas.io.json import json_normalize
def get_data(url=os.... | arodland/prop | pred/app/fit_cs.py | fit_cs.py | py | 1,644 | python | en | code | 14 | github-code | 97 | [
{
"api_name": "os.getenv",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "urllib.request.request.urlopen",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "urllib.request.request",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "... |
2618058618 | from collections import deque
food_supplies = [int(x) for x in input().split(", ")]
daily_stamina = deque([int(x) for x in input().split(", ")])
peaks = {80: "Vihren",
90: "Kutelo",
100: "Banski Suhodol",
60: "Polezhan",
70: "Kamenitza"}
day = 1
peak_values = [80, 90, 100, 60, 70]
c... | Niki5225/Python-Advanced | solutions of exams - advanced/climb the peaks.py | climb the peaks.py | py | 976 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "collections.deque",
"line_number": 4,
"usage_type": "call"
}
] |
15591845191 | import numpy as np
import cv2
import imutils
from imutils.video import FPS
from imutils.video import WebcamVideoStream
from imutils.video import FileVideoStream
from tracking_lanes.tracking_lanes import drawing_lane
video_path = r'C:\Users\DucTRung\Documents\data_set\tracking_lane\ivcam_60_fps.avi'
# using read() ... | trungtv4597/project_student_self_driving | improving_frame_rate.py | improving_frame_rate.py | py | 2,215 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "imutils.video.FPS",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.copy",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "tracking_lanes.tracking... |
2020859790 | import pygame
from pygame.sprite import Sprite
class Bullet(Sprite):
""" Uma classe que administra os projeteis disparados pela espaçonave """
def __init__(self, settings, screen, ship):
super().__init__()
self.screen = screen
# Cria um retângulo para projétil em (0, 0) e, em ... | cauanorl/game-alien-attack | game/classes/bullets.py | bullets.py | py | 1,126 | python | pt | code | 0 | github-code | 97 | [
{
"api_name": "pygame.sprite.Sprite",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "pygame.Rect",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pygame.draw.rect",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "pygame.draw",
"l... |
11237800387 | import pymel.core as pm
import maya.OpenMaya
import os
import sys
import v1_core
import v1_shared
from v1_shared.decorators import csharp_error_catcher
from v1_shared.shared_utils import get_first_or_default, get_index_or_default, get_last_or_default
from metadata import meta_network_utils, meta_property_utils
from... | V1Interactive/FreeformTools | Freeform.Python/DCCUtilities/Maya/maya_utils/scene_utils.py | scene_utils.py | py | 14,307 | python | en | code | 24 | github-code | 97 | [
{
"api_name": "pymel.core.sceneName",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "pymel.core",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "v1_shared.shared_utils.get_last_or_default",
"line_number": 37,
"usage_type": "call"
},
{
"api_na... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.