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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4242214840 | from predict_utility import load_checkpoint,get_input_args,predict,process_image
from utility_module import label_mapping
import warnings
warnings.filterwarnings("ignore")
from prettytable import PrettyTable
x = PrettyTable()
args = get_input_args()
model = load_checkpoint(args.checkpoint)
top_ps,top_class = predict... | rkg-37/ImageClassifier | predict.py | predict.py | py | 654 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "prettytable.PrettyTable",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "predict_utility.get_input_args",
"line_number": 8,
"usage_type": "call"
},
{
"api_n... |
41996069005 | import logging
import platform
import sys
import json
from getpass import getpass
from pathlib import Path
from typing import Union, Dict, Tuple
from shapely.geometry import Polygon
import os
import couchdb
import xmltodict
from lxml import etree
from tqdm import tqdm
from geojson_rewind import rewind
logging.basicC... | metno/weamyl-metcap | scripts/lustre_archive_importer.py | lustre_archive_importer.py | py | 8,431 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logging.basicConfig",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "shapely.geometry.Polygon",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "pathli... |
9020012724 | from multiprocessing import Pool
import math
from functools import partial
import numpy as np
from pyfaidx import Fasta, Faidx
import subprocess
import pysam
from liftoff import aligned_seg, liftoff_utils
from os import path
def align_features_to_target(ref_chroms, target_chroms, args, feature_hierarchy, liftover_typ... | agshumate/Liftoff | liftoff/align_features.py | align_features.py | py | 13,119 | python | en | code | 360 | github-code | 6 | [
{
"api_name": "math.floor",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "multiprocessing.Pool",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "functools.partial",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
... |
14894176437 | import asyncio
import os
import os.path
from flask import Flask, request, send_from_directory, flash, request
from werkzeug.utils import secure_filename
import getpass
import platform
from flask_cors import CORS
from scripts.datascript import Datascript
from scripts.CalcoloScostamentiSenzaIntermedi import ScostamentiSe... | VinciGit00/SCGProject | Frontend/flask_code/app.py | app.py | py | 3,160 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "flask_cors.CORS",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "getpass.getuser",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "platform.system",
"li... |
26039884706 | from __future__ import annotations
from dataclasses import dataclass
from pants.backend.go.subsystems.golang import GolangSubsystem
from pants.core.util_rules.system_binaries import (
BinaryPath,
BinaryPathRequest,
BinaryPaths,
BinaryPathTest,
)
from pants.engine.engine_aware import EngineAwareParamet... | pantsbuild/pants | src/python/pants/backend/go/util_rules/cgo_binaries.py | cgo_binaries.py | py | 1,235 | python | en | code | 2,896 | github-code | 6 | [
{
"api_name": "pants.engine.engine_aware.EngineAwareParameter",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "pants.core.util_rules.system_binaries.BinaryPathTest",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "dataclasses.dataclass",
"line_number": 17... |
26485545082 | ######## Tensorflow Imaage Classifier #########
#
# Author: Erik Handeland Date: 12/12/2021
# Description: This program uses a TensorFlow Lite object detection model-metadata to
# perform object detection on an image. It creates a dict containing a
# list of detected objects and the count for each object. It also save ... | KB4YG/ml | obj_detection/obj_detection.py | obj_detection.py | py | 9,890 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "importlib.util.util.find_spec",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "importlib.util.util",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "importlib.util",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": ... |
3539820868 | """
Name : portfolio_optimizer.py
Author : Yinsen Miao
Contact : yinsenm@gmail.com
Time : 7/21/2021
Desc: Solve mean-variance optimization
"""
import numpy as np
import pandas as pd
from scipy.optimize import minimize
from gerber import gerber_cov_stat1, gerber_cov_stat2
from ledoit import ledoit
def set_eps_wgt... | yinsenm/gerber | src/portfolio_optimizer.py | portfolio_optimizer.py | py | 13,193 | python | en | code | 49 | github-code | 6 | [
{
"api_name": "numpy.array",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.abs",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.sum",
"line_number": 20,
... |
70064084669 | from django.conf.urls import url
from tests import views, exceptions
urlpatterns = [
url(r'^snippets/$', views.SnippetList.as_view(), name='snippet-list'),
url(r'^snippets2/$', views.SnippetList.as_view(), name='snippet2-list'),
url(r'^snippet/(?P<pk>\d+)/$', views.SnippetDetail.as_view(),
name='s... | FutureMind/drf-friendly-errors | tests/urls.py | urls.py | py | 673 | python | en | code | 129 | github-code | 6 | [
{
"api_name": "django.conf.urls.url",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "tests.views.SnippetList.as_view",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "tests.views.SnippetList",
"line_number": 6,
"usage_type": "attribute"
},
{
"ap... |
17241327801 | from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import requests
from bs4 import BeautifulSoup
import time
BASE_URL = 'https://www.nowcoder.com'
driver = webdriver.Chrome(... | Chunar5354/interview_note | experience/spider.py | spider.py | py | 1,566 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "selenium.webdriver.support.ui.WebDriverWait",
"line_number": 15,
"usage_type": "call"
},
... |
74050593789 | from urllib.request import Request, urlopen
from bs4 import BeautifulSoup
import sqlite3
from time import sleep
imgchrList = ['n','a','e','m','i','g','h','v']
DiffList = ['nov','adv','exh','mxm','inf','grv','hvn','vvd']
conn = sqlite3.connect("SDVXRanking.db")
cur = conn.cursor()
for tid in range(164,1412):
prin... | limjungho/SDVXRanking | ParsingTrackList.py | ParsingTrackList.py | py | 1,365 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sqlite3.connect",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "urllib.request.Request",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "urllib.request.urlopen",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "bs4.Beau... |
37283667870 | # Importing modules
import numpy as np
import pandas as pd
from sklearn.model_selection import train_test_split
import joblib
import findspark
findspark.init()
from pyspark.sql import SparkSession
from pyspark.ml import PipelineModel
from pyspark.sql.functions import *
# Configure spark session
spark = SparkSession\
... | ramsundar07/Earthquake-Detetection-Analysis-using-Machine-Learning-Algorithms | GUI/gui_algorithm.py | gui_algorithm.py | py | 8,670 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "findspark.init",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pyspark.sql.SparkSession.builder.master",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pyspark.sql.SparkSession.builder",
"line_number": 13,
"usage_type": "attribute"
}... |
3999827011 | import PySimpleGUI as sg # Simple GUI for Python
import core
import guiElements
import constants as const
# Setup the simple window
sg.theme("Black")
layout = [
[guiElements.frameSelectJobAndZone],
[guiElements.frameSelectResource],
[guiElements.frameAssignAKey],
[guiElements.layoutStatusAndStartS... | jhriverasa/wakfu-farmscript | FarmScriptGUI.py | FarmScriptGUI.py | py | 1,235 | python | en | code | 5 | github-code | 6 | [
{
"api_name": "PySimpleGUI.theme",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "guiElements.frameSelectJobAndZone",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "guiElements.frameSelectResource",
"line_number": 14,
"usage_type": "attribute"
... |
75241434428 | __all__ = ["save", "load", "load_state_dict", "arange", "cat", "cos", "clamp", "Device", "from_numpy", "flatten",
"LongTensor", "matmul", "mm", "normal", "ones", "x2ms_pow", "sin", "tanh", "x2ms_tensor", "Tensor",
"split", 'as_tensor', 'argmax', 'Generator', 'sigmoid', 'rand', 'floor', 'bernoulli'... | Gufrannn/W-MAE | MindSpore/x2ms_adapter/__init__.py | __init__.py | py | 16,986 | python | en | code | 12 | github-code | 6 | [
{
"api_name": "mindspore.Tensor",
"line_number": 71,
"usage_type": "attribute"
},
{
"api_name": "torch_api.tensor_api.tensor_and",
"line_number": 71,
"usage_type": "attribute"
},
{
"api_name": "torch_api.tensor_api",
"line_number": 71,
"usage_type": "name"
},
{
"a... |
33648598241 | from __future__ import annotations
from dataclasses import dataclass
from typing import Optional
import re
import string
@dataclass
class Equipment:
title: str
value: str
unit: Optional[str] = None
quantity: Optional[int] = None
_equipment = [
("Backpack", "2gp"),
("Candle", "1cp"),
("Ch... | sethwoodworth/crawl-classic | crawl_classic/equipment.py | equipment.py | py | 1,581 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "typing.Optional",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "dataclasses.dataclass",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "re.sub",
"li... |
1443436731 | from django import forms
from django.utils.translation import ugettext_lazy as _
from .models import Camera
class CameraAddForm(forms.ModelForm):
class Meta:
model = Camera
fields = ['title', 'ip']
labels = {
'title': _('Titel'),
'ip': _('Adresse')
... | Thorium0/Security-terminal | Terminal/camera/forms.py | forms.py | py | 324 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.forms.ModelForm",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "models.Camera",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.utils.tran... |
12830949060 | # Definition for a Node.
from collections import deque
from typing import List
class Node:
def __init__(self, val=None, children=None):
self.val = val
self.children = children
class Solution:
def preorder(self, root: Node) -> List[int]:
output = []
if root is None:
... | theRobertSan/LeetCode-Solutions-Python | 589.py | 589.py | py | 996 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "typing.List",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "collections.deque",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "typing.List",
"line_number": 30,
"usage_type": "name"
}
] |
30857567174 | import pyautogui
import webbrowser as web
import time
msg = input('enter message to send: ')
times = int(input('enter the number of times to send the message: '))
# win_chrome_path = 'C:\Program Files\Google\Chrome\Application\chrome.exe %s'
# web.get(win_chrome_path).open('web.whatsapp.com')
web.open('web.whatsapp.... | Abdul-Hannan12/Whatsapp-Automation | spam_message.py | spam_message.py | py | 471 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "webbrowser.open",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pyautogui.press",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pyautogui.press",
"lin... |
41160046527 | from django import forms
from django.core.mail import EmailMessage
from .models import Householdaccountbook
# class HouseholdaccountbookForm(forms.ModelForm):
# class Meta:
# model = Householdaccountbook
# fields = ["pref","choice",]
class TableCreateForm(forms.ModelForm):
class Meta:
model = Househol... | HaruShim/Sotuken | 実装/新満/table一覧表示/table/forms.py | forms.py | py | 777 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.forms.ModelForm",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "models.Householdaccountbook",
"line_number": 12,
"usage_type": "name"
}
] |
5387953203 | from telegram.ext import Updater, MessageHandler,Filters
from Adafruit_IO import Client
import os
aio = Client('adeebsheriff', os.getenv('adeebsheriff'))
def demo1(bot,update):
chat_id = bot.message.chat_id
path = 'https://cdn3.vectorstock.com/i/1000x1000/87/22/i-am-fine-lettering-typography-calligraphy-overlay-v... | adeebsheriff/telegramiotchatbot | app.py | app.py | py | 2,506 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "Adafruit_IO.Client",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "telegram.ext.Updater",
"line... |
7759954850 | '''
사업자등록번호로 업종 확인
'''
import csv
import json
from urllib.request import urlopen
from urllib import parse
import datetime as dt
import pandas as pd
import numpy as np
import re
# 대신정보통신 4088118945
# 대보정보통신 1358119406
bizNo = '2118108009'
# 조달청_사용자정보서비스
'''
> parameter(조회조건)
- bizno : 사업자등록번호
> numOfRows 는 totalCount ... | starrything/openapi-g2b | 04_g2b_user_service.py | 04_g2b_user_service.py | py | 2,354 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "urllib.parse.urlencode",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "urllib.parse",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "urllib.parse.quote_plus",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "urllib.pa... |
75316047546 | import wx
from ..form.general import GeneralDialog
from ..textbox import LayoutDimensions
from ..textbox.textbox import TextInputLayout, TextSmartBox
from ..textbox.floatbox import FloatInputLayout, FloatSmartBox
from ..controller import ChildController
from ..model.bind import BindOjbect
__author__ = 'Joeny'
clas... | JoenyBui/boa-gui | boaui/chart/dlg.py | dlg.py | py | 8,601 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "wx.Panel",
"line_number": 42,
"usage_type": "attribute"
},
{
"api_name": "wx.Panel.__init__",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "wx.Panel",
"line_number": 55,
"usage_type": "attribute"
},
{
"api_name": "wx.BoxSizer",
"line... |
9264213572 | import mne
import argparse
import numpy as np
from config import fname
# Handle command line arguments
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument('subject', metavar='sub###', type=int, help='The subject to process')
args = parser.parse_args()
subject = args.subject
print('Processing subj... | wmvanvliet/beamformer_simulation | megset/03_ica.py | 03_ica.py | py | 2,047 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "mne.open_report",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "config.fname.report",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "config.fna... |
780574891 | from nltk.tokenize import TweetTokenizer
class LexiconFeatureExtractor:
def __init__(self, afinn_lexicon_file_path="resources/lexicons/AFINN-en-165.txt",
afinn_emoticon_lexicon_file_path="resources/lexicons/AFINN-emoticon-8.txt",
bing_liu_lexicon_file_path="resources/lexicons/Bin... | erayyildiz/AffectInTweets | src/lexicon_features.py | lexicon_features.py | py | 5,989 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "nltk.tokenize.TweetTokenizer",
"line_number": 84,
"usage_type": "call"
},
{
"api_name": "nltk.tokenize.TweetTokenizer",
"line_number": 95,
"usage_type": "call"
},
{
"api_name": "nltk.tokenize.TweetTokenizer",
"line_number": 111,
"usage_type": "call"
}
] |
28412951714 | #!/usr/bin/env python
import sys, os, shlex
import multiprocessing as mp
import subprocess as sp
from pli.lib.util import log
def find_files(root):
outdir = 'tmpout'
for curdir, dirs, files in os.walk(root):
protein_fname = None
ligand_fname = None
for f in files:
if f.end... | rhara/plifinder | examples/plifinder_v2015.py | plifinder_v2015.py | py | 1,504 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.walk",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path.basename",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "os.path.exists",
"line_numb... |
28026928602 | # -*- coding: utf-8 -*-
"""
Created on Mon Jun 22 11:31:56 2020
@author: admin
"""
from __future__ import print_function
import os, sys, time, argparse
from sensapex import SensapexDevice, UMP, UMPError
parser = argparse.ArgumentParser(
description="Test for sensapex devices; prints position and status updates... | bsbrl/Amey_microinjection | Sensapex_Manipulator/test.py | test.py | py | 1,293 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sensapex.UMP.get_ump",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "sensapex.UMP",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "sensapex.Se... |
74959980988 | """system URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based ... | amir-rahim/ChessClubManagementSystem | system/urls.py | urls.py | py | 3,313 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "django.urls.path",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "django.contrib.admin.site",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "... |
25272817830 | import sys
from itertools import combinations
from collections import deque
def move(stage):
for i in range(M):
for j in range(N-1, 0, -1):
enemy[j][i] = enemy[j-1][i]
if stage == 0:
for i in range(M):
enemy[0][i] = 0
dr = [0, -1, 0]
dc = [-1, 0, 1]
N, M, D = map(int,... | powerticket/algorithm | Baekjoon/17135.py | 17135.py | py | 1,842 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sys.stdin.readline",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "sys.stdin",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "sys.stdin.readline",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "sys.stdin",
... |
14975435890 | """DuerOS entity class."""
from __future__ import annotations
from dueros_smarthome.client import DeviceActionResponse
from dueros_smarthome.const import STATUS_OK, STATUS_NOT_LOGIN
from dueros_smarthome.models import Appliance, Connectivity
from homeassistant.core import callback
from homeassistant.exceptions import... | zsy056/dueros-ha | custom_components/dueros/entity.py | entity.py | py | 2,131 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "homeassistant.helpers.update_coordinator.CoordinatorEntity",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "coordinator.get_unique_id",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "coordinator.DuerOSDataUpdateCoordinator",
"line_number":... |
39425077344 | #!/usr/bin/env python
# vim: set fileencoding=utf-8 :
# -*- coding: utf-8 -*-
#
# Last modified: Fri, 14 Oct 2022 02:22:56 +0900
import numpy as np
import pandas as pd
import os
from .measurePhenotypes import measurePhenotypes
from ..util.isNotebook import isnotebook
if isnotebook():
from tqdm.notebook import tq... | funalab/pyCellLineage | lineageIO/annotateLineageIdx.py | annotateLineageIdx.py | py | 12,848 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "util.isNotebook.isnotebook",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 56,
"usage_type": "attribute"
},
{
"api_name": "os.listdir",
... |
25146242563 | import numpy as np
import netCDF4 as nd
import matplotlib.pyplot as plt
from calc_irr import *
def get_sample_points(origin, dir , ns=10):
gps = np.zeros((origin.shape[0],dir.shape[0]))
gps[0] = np.tan(dir/180.*np.pi) * origin[2] + origin[0]
gps[1,:] = origin[1]*1
gps[2,:] = 0
ds = np.linspace(0,... | MujkanovicMax/master-thesis | radiances/raytr.py | raytr.py | py | 3,788 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.zeros",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.tan",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.pi",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "numpy.linspace",
"line_number": ... |
26818962506 | import json
import urllib
import requests
import types
class MovesAPIError(Exception):
"""Raised if the Moves API returns an error."""
pass
class MovesAPINotModifed(Exception):
"""Raised if the document requested is unmodified. Need the use of etag header"""
pass
class MovesClient(object):
"""... | lysol/moves | moves/_moves.py | _moves.py | py | 6,546 | python | en | code | 58 | github-code | 6 | [
{
"api_name": "json.loads",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "urllib.urlencode",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number": 70,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_numb... |
71226682109 | import os, glob
from fpdf import FPDF
class Pdf_Tool:
def __init__(self, format):
self.pdf = FPDF(format=format)
def save(self, dir, pdf_name):
if not os.path.exists(dir):
os.makedirs(dir)
self.pdf.output(os.path.join(dir, pdf_name), "F")
def create(self, img_path_li... | huangzf128/something | code/python/image/pdf_tool.py | pdf_tool.py | py | 888 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "fpdf.FPDF",
"line_number": 7,
"usage_type": "call"
},
{
"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":... |
70508505789 | import os
import sys
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torchvision import datasets, transforms
from matplotlib import pyplot as plt
from torch.optim.lr_scheduler import StepLR
from torch.utils.data import DataLoader
# progress bar
from tqdm.auto import tqdm
# ... | WangShengqing122090536/CSC1004-image-classification-modified | main.py | main.py | py | 5,477 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "torch.nn.Module",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "torch.nn.Conv2d",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_nu... |
24252533109 | from phrase import Phrase
import random
class Game:
def __init__(self):
self.missed = 0
self.phrases = self.create_phrases()
self.active_phrase = self.get_random_phrase()
self.guesses = []
def create_phrases(self):
phrases = [Phrase("Most things tha... | Nikolai-O/python-techdegree-project3 | game.py | game.py | py | 2,068 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "phrase.Phrase",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "random.choice",
"line_number": 17,
"usage_type": "call"
}
] |
32197951073 | from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time
driver=webdriver.Chrome(executable_path='./driver/chromedriver')
driver.get('https://web.whatsapp.com/')
input("please scan qr code and press any key to continue:")
RM=driver.find_element_by_css_selector('span[title... | AbhayPal005/Whatsaap-Automation-Using-Selenium | chrome_driver_windows.py | chrome_driver_windows.py | py | 575 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "time.sleep",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "selenium.webdri... |
30543622706 | import matplotlib.pyplot as plt
import numpy as np
plt.ion()
plt.rcParams['axes.labelsize'] = 18
plt.rcParams['axes.titlesize'] = 20
plt.rcParams['font.size'] = 16
plt.rcParams['lines.linewidth'] = 2.0
plt.rcParams['lines.markersize'] = 8
plt.rcParams['legend.fontsize'] = 14
class Simulator:
eps = 1e-16
def _... | liminal-learner/Chaos | Simulator.py | Simulator.py | py | 14,112 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "matplotlib.pyplot.ion",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 3,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.rcParams",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "... |
28624119358 | import cartopy
import cartopy.crs as ccrs
import matplotlib.pyplot as plt
import numpy as np
def plot_geodetic(location_to_geodetic, edxml_parser):
# get names and geodetics for plotting
locs = np.asarray(list(location_to_geodetic.keys()))
geodetic_coords = np.asarray(list(location_to_geodetic.values()))
... | pnadelofficial/HistoricalLetters | plot.py | plot.py | py | 2,774 | python | en | code | null | github-code | 6 | [
{
"api_name": "numpy.asarray",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.asarray",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.isin",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.asarray",
"line_numbe... |
25687467876 | import torch
import torch.nn as nn
import torch.nn.functional as F
class BasicBlock(nn.Module):
def __init__(self, in_channel, out_channel, stride=1):
super(BasicBlock, self).__init__()
self.conv1 = nn.Conv2d(in_channel, out_channel, kernel_size=3, stride=stride, padding=1, bias=False)
sel... | p3i0t/task2 | models.py | models.py | py | 3,506 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "torch.nn.Module",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "torch.nn.Conv2d",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_numbe... |
27103187909 | """Fedor's Upper Envelope algorithm.
Based on the original MATLAB code by Fedor Iskhakov:
https://github.com/fediskhakov/dcegm/blob/master/model_retirement.m
"""
from typing import Callable
from typing import Dict
from typing import List
from typing import Tuple
import numpy as np
from dcegm.interpolation import lin... | OpenSourceEconomics/dcegm | tests/utils/upper_envelope_fedor.py | upper_envelope_fedor.py | py | 28,814 | python | en | code | 15 | github-code | 6 | [
{
"api_name": "numpy.ndarray",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "numpy.ndarray",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "numpy.ndarray",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "numpy.ndarra... |
46046555266 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.test import TestCase
from django.template import Template, Context
from django.utils.html import mark_safe
from hooks.templatehook import hook
from hooks.templatetags.hooks_tags import template_hook_collect
from . import utils_hooks
class ... | nitely/django-hooks | hooks/tests/tests_templatetags.py | tests_templatetags.py | py | 3,337 | python | en | code | 16 | github-code | 6 | [
{
"api_name": "django.test.TestCase",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "hooks.templatehook.hook.unregister_all",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "hooks.templatehook.hook",
"line_number": 18,
"usage_type": "name"
},
{
... |
74606059388 | from __future__ import unicode_literals
try:
from urllib2 import Request
except ImportError:
from urllib.request import Request
from mock import MagicMock, patch
from requests_kerberos import HTTPKerberosAuth
from grafana_dashboards.client.connection import (KerberosConnection,
... | jakubplichta/grafana-dashboard-builder | tests/grafana_dashboards/client/test_connection.py | test_connection.py | py | 3,770 | python | en | code | 141 | github-code | 6 | [
{
"api_name": "grafana_dashboards.client.connection.BasicAuthConnection",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "mock.MagicMock",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "urllib.request.Request",
"line_number": 39,
"usage_type": "call"
... |
35841585660 | # from time import sleep
import os
# from reply1024 import postreply1024
# import time
from datetime import datetime, timedelta
tday = datetime.now()+timedelta(hours = 8)
print(tday.hour)
tday.strftime("%Y-%m-%d %H:%M:%S")
print(tday)
if os.path.isdir("tmp")==0:
os.mkdir("tmp")
with open("./tmp/test.txt","r+") as... | Mmingdev/reply-1024 | test.py | test.py | py | 630 | 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": "datetime.timedelta",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path.isdir... |
2523947822 | import argparse
import torch
from model import Pretrain_SegmentationNet, DPRAN
import os
from data.dataloader import create_dataloader
from train import net_Pretrain, DPRAN_Train
import segmentation_models_pytorch as smp
def main():
parser = argparse.ArgumentParser(description='DPRAN')
parser.add_argument('--... | wanpeng16/DpRAN | main.py | main.py | py | 3,242 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "os.makedirs",
"... |
72143905788 | from typing import Dict, List, Union
import csv
import os
from unittest import result
def load_csv(
file_path: str,
delimiter: str = ',',
has_header: bool = True,
try_casting: bool = True
) -> List[Dict]:
'''
This function laods a csv file from the given path. It accepts both csv with head... | levensworth/udesa-pc-tutorial | mini-proyectos/song_recommendation/text_processing.py | text_processing.py | py | 1,864 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "os.path.exists",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "csv.reader",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "typing.List",
"line_number... |
9002769780 |
# -*- coding: utf-8 -*-
"""
Created on Tue Feb 26 10:21:15 2019
This is the modl with Keras framework
@author: ago
"""
from __future__ import print_function
from matplotlib import pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
from scipy import stats
from IPython.display ... | Dirbas/PMU_classifier | Keras_PMU.py | Keras_PMU.py | py | 5,451 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "pandas.options",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "seaborn.set",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.style.use",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "matplotli... |
8855989929 | # Importamos Pillow
from PIL import Image
import glob
# Importamos Pandas
import pandas as pd
import csv
# TIME
import time
import datetime
from time import gmtime, strftime
# Importamos Pytesseract
import pytesseract
import os
path = "./output/media"
for root,dirs,files in os.walk(path):
... | bisite/Telegram-History-dump | telegram/img_ocr.py | img_ocr.py | py | 1,331 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.walk",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.path.splitext",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number... |
31066666255 | from django.urls import path
from . import views
urlpatterns = [
path('', views.loginView, name='login'),
path('register/', views.registerView, name='register'),
path('logout/', views.logoutView, name='logout'),
path('akun/', views.update_akunView, name='update_akun'),
path('register/berhasil', vie... | mugiwara35/smart-plant | akun/urls.py | urls.py | py | 512 | 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",
... |
887825257 | from django.shortcuts import render, redirect
from django.http import Http404, JsonResponse
from django.views import View
from django.contrib.auth import authenticate, login, logout
from django.contrib import messages
# Decorators
from django.utils.decorators import method_decorator
from django.views.decorators.csrf i... | analitika-tech/library | system/frontend/views.py | views.py | py | 14,674 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "backend.models.Info.objects.all",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "backend.models.Info.objects",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "backend.models.Info",
"line_number": 25,
"usage_type": "name"
},
{
... |
16439872003 | from flask import Flask
import dash
from dash import dcc
from dash import html
from dash.dependencies import Input, Output
import plotly.graph_objs as go
import pandas as pd
import os
inbodyDf = pd.read_csv(os.path.join(os.path.dirname(__file__), os.pardir, 'data', 'inbody.csv'))
courseDf = pd.read_csv(os.path.join(o... | yuwon-shin/Data_Visualization | PR/flask/useDash.py | useDash.py | py | 9,696 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pandas.read_csv",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line... |
12814349068 | import itertools
import matplotlib.pyplot as plt
import numpy as np
def get_mtot(event_jets):
all_px = sum([j.px ** 2 for j in event_jets])
all_py = sum([j.py ** 2 for j in event_jets])
all_pz = sum([j.pz ** 2 for j in event_jets])
all_e = sum([j.e for j in event_jets])
if all_e ** 2 - all_px - a... | rotemov/ML4Jets-HUJI | jupyter_methods.py | jupyter_methods.py | py | 3,097 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "itertools.product",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "numpy.square",
"line_nu... |
26693503665 | import pytorch_lightning as pl
import pandas as pd
import torch
from torch import nn
from torch.utils.data import DataLoader
from sklearn.metrics import cohen_kappa_score
from transformers import AutoTokenizer, RobertaForSequenceClassification
from torch.utils.data import Dataset
from pytorch_lightning.loggers impo... | maltefranke/solubility_prediction | models/ChemBERTa/chemberta10M.py | chemberta10M.py | py | 8,935 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "sklearn.metrics.cohen_kappa_score",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "torch.utils.data.Dataset",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "pandas.read_csv",
"line_number": 38,
"usage_type": "call"
},
{
"api_na... |
19386134805 | import argparse
import json
import os
import sys
import numpy as np
import torch
from plyfile import PlyData, PlyElement
from torch.utils.data import DataLoader
from tqdm import tqdm
sys.path.append(os.path.join(os.getcwd())) # HACK add the root folder
from utils.pc_utils import write_ply_rgb
from utils.box_util im... | nseppi/scan2cap | scan2cap/scripts/visualize_pretrain.py | visualize_pretrain.py | py | 15,949 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "sys.path.append",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number... |
12464441939 | import argparse
import os
import shutil
import socket
import time
import torch
import torch.backends.cudnn as cudnn
import torch.nn as nn
import torch.nn.parallel
import torch.optim as optim
import torch.utils.data
import torchvision.utils as vutils
import torchvision.transforms as transforms
from tensorboardX import... | changminL/stegano | main.py | main.py | py | 26,162 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "socket.gethostname",
"line_number": 77,
"usage_type": "call"
},
{
"api_name": "torch.cuda.is_available",
"line_number": 88,
"usage_type": "call"
},
{
"api_name": "to... |
73733113787 | from schedule import Scheduler
from session.manager import SessionManager
class GlobalObjectClass:
def __init__(self):
self.text: str = ""
self.database: str = ""
self.session_manager: SessionManager | None = None
self.scheduler: Scheduler | None = None
globalObject = GlobalObjec... | fkxxyz/chatgpt-session | server/common.py | common.py | py | 329 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "session.manager.SessionManager",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "schedule.Scheduler",
"line_number": 10,
"usage_type": "name"
}
] |
27973693497 | import json
import urllib.request
# read the model into a variable
with open ("../src/test/gene-filter-example-2.xml", "r") as f:
model=f.read()
# encode the job
job = {
"export": {
"network_type":"en",
"network_format":"sbml"
},
"filter": {
"species": ["h2o", "atp"],
"re... | binfalse/GEMtractor | clients/PythonClient.py | PythonClient.py | py | 1,081 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "urllib.request.request.Request",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "urllib.request.request",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "urllib.request",
"line_number": 24,
"usage_type": "name"
},
{
"api_nam... |
19875373112 | import sys
import os
from Model.Pairwise.Embedding import RelationEmbedding
from typing import List, Dict, Tuple
BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
sys.path.append(BASE_DIR)
class InputExample(object):
"""A single training/test example for simple sequence clas... | EnernityTwinkle/KBQA-QueryGraphSelection | RankingQueryGraphs/Model/common/InputExample.py | InputExample.py | py | 1,494 | python | en | code | 5 | github-code | 6 | [
{
"api_name": "os.path.dirname",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sys.path.append",
"line... |
19147556064 | '''PROGRAM ANALISIS VARIANSI (Rata-Rata n Populasi -- Kalo Variansi sama dari uji
Levene test)'''
import scipy.stats as st
print(" H0 : miu sampe n sama semua")
print(" H1 : Ada miu yang tidak sama\n")
alfa = input("Tingkat Signifikansi : ")
jumlah_populasi = int(input("Jumlah Populasi : "))
data_populasi ... | fstevenm/Project-Statistics | Statistic Method/Analisis Variansi Satu Arah.py | Analisis Variansi Satu Arah.py | py | 5,809 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "scipy.stats.f",
"line_number": 75,
"usage_type": "call"
},
{
"api_name": "scipy.stats",
"line_number": 75,
"usage_type": "name"
},
{
"api_name": "scipy.stats.f",
"line_number": 126,
"usage_type": "call"
},
{
"api_name": "scipy.stats",
"line_numb... |
35694943116 | from enum import Enum, unique
@unique
class Move(Enum):
THE_SAME = 0,
LEFT = 1,
TOP = 2,
RIGHT = 3,
DOWN = 4,
LEFT_TOP = 5,
RIGHT_TOP = 6
LEFT_DOWN = 7,
RIGHT_DOWN = 8
class P:
Left = 0.2
Right = 0.4
Top = 0.3
Down = 0.2
Vertical_Same = 0.5
Horizontal_Same... | yuryybk/bulbacon_2019_task | Task.py | Task.py | py | 4,012 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "enum.Enum",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "enum.unique",
"line_number": 4,
"usage_type": "name"
}
] |
764666346 | # Django初期化
import os, django
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings")
django.setup()
# views.py
from datetime import date
from django.db.models import Count, Q
from app.models import Staff
today = date(2023, 2, 14) # 動作検証用
qs = (
Staff.objects
.values("pk", "name") # group byのキー
... | shimizukawa/pycon-apac-2023-django-orm-dojo | src/try/try2-after.py | try2-after.py | py | 1,811 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.environ.setdefault",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "django.setup",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"... |
11812609282 | """empty message
Revision ID: 08084a992d8b
Revises:
Create Date: 2018-03-23 09:28:07.017990
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '08084a992d8b'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto gene... | victorjambo/WeConnect | migrations/versions/08084a992d8b_.py | 08084a992d8b_.py | py | 2,922 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "alembic.op.create_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.Integ... |
10414559833 | import collections
from typing import Any, List
import torch
from executorch.exir.dialects.edge.arg.model import BaseArg
from executorch.exir.dialects.edge.arg.type import ArgType
def extract_return_dtype(
returns: Any, sample_returns: List[BaseArg]
) -> List[torch.dtype]:
"""Extract the dtype from a return... | pytorch/executorch | exir/dialects/edge/dtype/utils.py | utils.py | py | 1,125 | python | en | code | 479 | github-code | 6 | [
{
"api_name": "typing.Any",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "executorch.exir.dialects.edge.arg.model.BaseArg",
"line_number": 11,
"usage_type": "name"
},
{
"api_name":... |
41383190209 | import math
from abc import ABC, abstractmethod
from dataclasses import dataclass
from hvac import Quantity
from hvac.fluids import Fluid
from hvac.refrigerant_piping.copper_tubing import CopperTube
from hvac.fluid_flow import Pipe, Circular
Q_ = Quantity
@dataclass
class RefrigerantCycleData:
rfg: Fluid
T_... | TomLXXVI/HVAC | hvac/refrigerant_piping/sizing.py | sizing.py | py | 10,022 | python | en | code | 8 | github-code | 6 | [
{
"api_name": "hvac.Quantity",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "hvac.fluids.Fluid",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "hvac.Quantity",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "hvac.Quantity",
"li... |
19325547874 | from pandas import read_csv
from sklearn.metrics import mean_absolute_percentage_error
from math import sqrt
from matplotlib import pyplot as plt
from pandas import concat
import numpy as np
import scipy.stats as stats
import pandas as pd
def persistence_one_step_ln(train_log, teste_log,
show_results=False, plot_... | gsilva49/timeseries | H/python_code/persistence_one_step_ln.py | persistence_one_step_ln.py | py | 1,509 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sklearn.metrics.mean_absolute_percentage_error",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "numpy.exp",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 37,
"usage_type": "call"
},
{
"a... |
73859053626 | import dash
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output
import plotly.graph_objects as go
import pandas as pd
import plotly.express as px
# Read data from a csv
z_data = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/... | juakonap/dash-3d | app/app.py | app.py | py | 1,941 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pandas.read_csv",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "plotly.graph_objects.Figure",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "plotly.graph_objects",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "plot... |
25068498925 | from uuid import uuid4
from typing import Tuple, List
from asendia_us_lib.shipping_request import ShippingRequest, Item
from asendia_us_lib.shipping_response import PackageLabel
from purplship.core.units import CustomsInfo, Packages, Options, Weight
from purplship.core.utils import Serializable, DP
from purplship.core.... | danh91/purplship | sdk/extensions/asendia_us/purplship/providers/asendia_us/shipment/create.py | create.py | py | 5,068 | python | en | code | null | github-code | 6 | [
{
"api_name": "typing.Tuple",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "purplship.providers.asendia_us.utils.Settings",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "purplship.providers.asendia_us.error.parse_error_response",
"line_number": 29,
... |
5960535728 | #!/usr/bin/env python3
#
# File: tidal_perturbation_in_circular_binary.py
# Author: Timothy Van Reeth <timothy.vanreeth@kuleuven.be>
# License: GPL-3+
# Description: Calculating the observed flux variations of a tidally
# distorted g-mode pulsation in a circular, synchronised
# binary system
... | colej/eb_mapping | run_model.py | run_model.py | py | 14,587 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.sin",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "numpy.cos",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "numpy.pi",
"line_number": 45,
"usage_type": "attribute"
},
{
"api_name": "numpy.ones",
"line_number": 46,... |
9484548824 | import pygame
import sys
#define bird class
class Bird(object):
def __init__(self):
self.birdRect = pygame.Rect(65,50,50,50)
self.birdStatus = [pygame.image.load("flappybirdassets/assets/1.png"),
pygame.image.load("flappybirdassets/assets/2.png"),
... | hxg10636/flappygame | flappybird.py | flappybird.py | py | 3,693 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pygame.Rect",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pygame.image.load",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pygame.image",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "pygame.image.load",
... |
39914923603 | import cv2
import pickle
import numpy as np
import random
import threading
import warnings
from ..utils.image import read_image_bgr
import numpy as np
from PIL import Image
from six import raise_from
import csv
import sys
import os.path
import keras
from ..utils.anchors import (
anchor_targets_bbox_centers,
... | kocurvik/retinanet_traffic_3D | keras_retinanet/preprocessing/centers_generator.py | centers_generator.py | py | 18,123 | python | en | code | 24 | github-code | 6 | [
{
"api_name": "utils.anchors.anchor_targets_bbox_centers",
"line_number": 56,
"usage_type": "name"
},
{
"api_name": "utils.anchors.guess_shapes",
"line_number": 57,
"usage_type": "name"
},
{
"api_name": "utils.image.preprocess_image",
"line_number": 58,
"usage_type": "nam... |
4737844765 | from pathlib import Path # Pathlib - Working with file paths
p = Path('.') # Creates a path object in found OS (Windows Path)
test = [x for x in p.iterdir() if x.is_dir()]
print(p.resolve()) # Show file dir in your OS format (D:\Backup\Work\DevOps\Programming\Scripts\Python\fundamentals\Built In Modules\pathlib)
ne... | danlhennessy/Learn | Python/fundamentals/Built_In_Modules/pathlib/main.py | main.py | py | 716 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pathlib.Path",
"line_number": 3,
"usage_type": "call"
}
] |
1375960664 | # -*- coding: utf-8 -*-
import numpy as np
from deap import algorithms
from deap import base
from deap import creator
from deap import tools
from deap import gp
from deap.algorithms import varAnd
from adan.aiem.genetics.evaluators import *
import array
import random as traditional_random
#import pathos
import pathos... | stelios12312312/ADAN | adan/aiem/genetics/genetic_programming.py | genetic_programming.py | py | 16,827 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.inf",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "time.time",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "deap.tools.migRing",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "deap.tools",
"line_nu... |
6604263556 | #!/usr/bin/env python3
'''conda create -n pytorch-env python=3.9 shap pandas optuna=2.10.1 xgboost scikit-learn sklearn-pandas rdkit pytorch torchvision torchaudio pytorch-cuda=11.6 cairosvg dgllife dgl=0.9.1 dgl-cuda11.6 ipython -c pytorch -c nvidia -c dglteam'''
import pandas as pd
import numpy as np
import datetime,... | JianyongYuan/sklearn-scripts | Scikit-learn/Predictions/sklearn_evaluation.py | sklearn_evaluation.py | py | 8,232 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pandas.read_csv",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "joblib.load",
"line_number": 102,
"usage_type": "call"
},
{
"api_name": "sklearn.metrics.accuracy_score",
"line_number": 112,
"usage_type": "call"
},
{
"api_name": "sklearn.... |
35395933423 | import functools
import ipaddress
import re
import socket
from pathlib import Path, PurePath
from random import SystemRandom
from types import TracebackType
from typing import Any, AsyncContextManager, Awaitable, Callable, Dict
from typing import Generator, Generic, IO, Mapping, Optional, Sequence
from typing import T... | ronf/asyncssh | asyncssh/misc.py | misc.py | py | 22,888 | python | en | code | 1,408 | github-code | 6 | [
{
"api_name": "typing_extensions.Protocol",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "typing_extensions.Protocol",
"line_number": 48,
"usage_type": "name"
},
{
"api_name": "typing_extensions.Protocol",
"line_number": 55,
"usage_type": "name"
},
{
"... |
32410264814 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.core.validators
class Migration(migrations.Migration):
dependencies = [
('app', '0016_auto_20150828_0735'),
]
operations = [
migrations.AlterField(
model_na... | jacyn/burst | webapp/app/migrations/0017_auto_20150828_0747.py | 0017_auto_20150828_0747.py | py | 609 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.AlterField",
"line_number": 15,
"usage_type": "call"
},
{... |
15999128955 | # -*- coding: utf-8 -*-
"""
无签名版本
"""
import re
import json
from scrapy import Spider
from scrapy.http import Request
from douyin_app.docs.conf import HEADER
class DouyinIdolVideoSpider(Spider):
name = "idol_douyin_video"
idol_url = ''
video_list_url = 'https://api.amemv.com/aweme/v1/aweme/post/?user_id=... | iamxuwenjin/videos_download | douyin_app/spiders/douyin_idol_video_download.py | douyin_idol_video_download.py | py | 2,271 | python | en | code | 6 | github-code | 6 | [
{
"api_name": "scrapy.Spider",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "re.findall",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "douyin_app.docs.conf.HEADER",
"line_number": 35,
"usage_type": "name"
},
{
"api_name": "scrapy.http.Requ... |
11415064866 | """
Original multirc format:
{
data: [
{
id: str,
paragraph: {
text: {
},
questions: [
{
question: str,
sentences_used: [ in... | nli-for-qa/conversion | qa2nli/qa_readers/multirc.py | multirc.py | py | 3,998 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "types.Sample",
"line_number": 52,
"usage_type": "name"
},
{
"api_name": "typing.Dict",
"line_number": 53,
"usage_type": "name"
},
{
"api_name": "dataclasses.dataclass",
... |
4243718619 | from fastapi import APIRouter, HTTPException, status, Query
from datetime import timedelta
from datetime import datetime
from github import Github
import random
router = APIRouter()
github = Github()
@router.get("/repo/health")
def repo_health_check():
return {"status": "OK"}
# return each contributor with thei... | sweng-project-tcd/dashboard-back | router/repo/repo.py | repo.py | py | 6,032 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "fastapi.APIRouter",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "github.Github",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "github.get_repo",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "fastapi.HTTPException",... |
4463507689 | from django.shortcuts import render
from django.views.generic import View
from .models import *
# Create your views here.
class ProjectsList(View):
def get(self,request):
try:
us = User.objects.get(username=request.user)
except:
us = None
projects = Project.objects.... | virasium/TM | taskmain/views.py | views.py | py | 618 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.views.generic.View",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.shortcuts.render",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "django.views.generic.View",
"line_number": 16,
"usage_type": "name"
},
{
"api_na... |
29961826770 | from selenium import webdriver
import json
import traceback
import urllib.request
def parse_page(driver):
script_clue = "q(\"talkPage.init\","
try:
for script in driver.find_elements_by_tag_name("script"):
content = script.get_attribute("innerHTML")
if content.startswith(scrip... | ShadowTemplate/ted-downloader | ted.py | ted.py | py | 1,781 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "json.loads",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "traceback.format_exc",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.FirefoxOptions",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "sel... |
15536903566 | import pandas as pd
from sklearn import model_selection
import numpy as np
from sklearn import datasets
def create_k_folds():
# csv with image id, image location and image label.
df = pd.read_csv("train.csv")
# create a new column called kfold and fill it with -1
df["kfold"] = -1
# the next step... | Vuong02011996/Book-Approaching-any-machine-learning-problem | B_Cross validation/cross-validation.py | cross-validation.py | py | 2,781 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pandas.read_csv",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.KFold",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "... |
7792745843 | #!/usr/bin/env python3
"""Resolve docker container's name into IPv4 address"""
import docker
from ipaddress import ip_address, IPv4Address, IPv6Address
from threading import Thread
from twisted.internet import reactor, defer
from twisted.names import client, dns, server
LISTEN_ADDRESS = "127.0.0.1"
DNS_PORT = 53
cl... | dangoncalves/docker-dns | dockerDNS/dockerDNS.py | dockerDNS.py | py | 9,886 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "twisted.names.client.Resolver",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "twisted.names.client",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "ipaddress.IPv4Address",
"line_number": 60,
"usage_type": "argument"
},
{
... |
21375968156 | from django.db import models
# Create your models here.
class Movie(models.Model):
id = models.BigAutoField(
primary_key=True
)
name = models.CharField(
max_length=250,
verbose_name="Moive name"
)
desc = models.TextField(
verbose_name="Description"
)
year = ... | adhilshaw/moviedemoapp | movieapp/models.py | models.py | py | 558 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.db.models.Model",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "django.db.models.BigAutoField",
"line_number": 6,
"usage_type": "call"
},
{
"api_name"... |
14200766996 | import json
import os
import traceback
from discord import AllowedMentions, Embed, Forbidden
from discord.ext import commands
class Core(commands.Cog):
def __init__(self, bot):
self.bot = bot
self.db = self.bot.db
async def push_link_json(self, guild) -> None:
data = {}
for i... | yutarou12/ChIn-RoleBot | cogs/Core.py | Core.py | py | 1,875 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "discord.ext.commands.Cog",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "discord.ext.commands",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "json.dump",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "discord.ex... |
35417197808 | import csv
from dataclasses import dataclass, field
from itertools import count
from ..configs import Configs
from ..utils import add_bytes, stringify
from .actions import MONSTER_ACTIONS, Action
from .autoabilities import AUTOABILITIES
from .characters import CHARACTERS, Character
from .constants import (
Element... | coderwilson/FFX_TAS_Python | tracker/ffx_rng_tracker/data/monsters.py | monsters.py | py | 18,996 | python | en | code | 14 | github-code | 6 | [
{
"api_name": "constants.Stat",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "constants.Element",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "constants.ElementalAffinity",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "constant... |
1924258051 | """Regridding operator."""
# Standard library
import dataclasses as dc
import typing
# Third-party
import numpy as np
import xarray as xr
from rasterio import transform, warp
from rasterio.crs import CRS
Resampling: typing.TypeAlias = warp.Resampling
# For more information: check https://epsg.io/<id>
CRS_ALIASES = ... | MeteoSwiss-APN/icon_data_processing_incubator | src/idpi/operators/regrid.py | regrid.py | py | 5,416 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "typing.TypeAlias",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "rasterio.warp.Resampling",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "rasterio.warp",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "ras... |
14540936446 | """Escea Fireplace UDP messaging module
Implements simple UDP messages to Fireplace and receiving responses
"""
import asyncio
import logging
from asyncio import Lock
from asyncio.base_events import BaseEventLoop
from async_timeout import timeout
from typing import Any, Dict
# Pescea imports:
from .message impor... | lazdavila/pescea | pescea/datagram.py | datagram.py | py | 4,657 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "typing.Dict",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "message.Message",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "asyncio.base_events.Bas... |
35327101756 | # -*- coding: utf-8 -*-
"""
Created on Fri Apr 14 15:00:34 2017
@author: rsotoc
"""
import numpy as np
import pandas as pd
import time
import re
import nltk
from nltk.corpus import stopwords
from nltk.util import ngrams
from sklearn.model_selection import train_test_split
from bs4 import BeautifulSoup
from sklearn... | rsotoc/pattern-recognition | Data sets/ngrams.py | ngrams.py | py | 4,516 | python | en | code | 14 | github-code | 6 | [
{
"api_name": "pandas.read_csv",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "nltk.corpus.stopwords.words"... |
32111244416 | import os
import cv2
import sys
import math
import time
import numpy as np
import matplotlib.pyplot as plt
from PyQt5.QtWidgets import *
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5 import uic
# 이미지를 읽어서 pyqt로 보여주는 함수
def cvtPixmap(frame, img_size):
frame = cv2.resize(frame, im... | HanNayeoniee/visual-fatigue-analysis | pupil_detection/utils.py | utils.py | py | 11,187 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "cv2.resize",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2GRAY",
"line_number": 33,
"usage_type": "attribute"
},
{
"api_name": "cv2.threshold",
"... |
71874843708 | # Import necessary modules and libraries
from dotenv import load_dotenv
import os
import base64
from requests import post, get
import json
# Load environment variables from .env file
load_dotenv()
# Import CLIENT_ID and CLIENT_SECRET from environment variables
client_id = os.getenv("CLIENT_ID")
client_s... | linnathoncode/SpotifyApiApp | main.py | main.py | py | 3,588 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "dotenv.load_dotenv",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "base64.b64encode",
"line_n... |
35729296994 | import klepto
import shelve
import pickle
import numpy as np
from scipy.sparse import *
from pyspark.mllib.recommendation import ALS
from pyspark.sql import SparkSession
############### Load Data ##################
rating_matrix_csc = load_npz('netflix/sparse_matrix_100%.npz').tocsc()
rating_matrix_val_csc = load... | clamli/Decision-tree-model-for-active-learning | Netflix-based/MF param train.py | MF param train.py | py | 8,140 | python | en | code | 7 | github-code | 6 | [
{
"api_name": "pyspark.SparkConf",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "pyspark.SparkContext",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "pyspark.mllib.recommendation.ALS.train",
"line_number": 49,
"usage_type": "call"
},
{
"api... |
2710846372 | # just a seperate file for handling the logging
# of sanic to use with logging
from sanic.log import DefaultFilter
import sys
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'filters': {
'accessFilter': {
'()': DefaultFilter,
'param': [0, 10, 20]
},
'errorFilter': {
'()... | AggressivelyMeows/Ping | logging_config.py | logging_config.py | py | 2,044 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sanic.log.DefaultFilter",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "sanic.log.DefaultFilter",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "sys.stderr",
"line_number": 53,
"usage_type": "attribute"
},
{
"api_name": "sys.s... |
25961872136 | # -*- coding: utf-8 -*-
"""
This Python file is been made by the project group Mattek5 C4-202
This is a test of how much packetloss the prediction of a sound file
can have and still be intelligibly
"""
from __future__ import division
import os
import sys
lib_path = '\\Scripts\\libs'
data_path = '\\Lydfiler\\Sound'
e... | AalauraaA/P5 | Supplerende_materiale/Scripts/packetloss.py | packetloss.py | py | 1,773 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.getcwd",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "sys.path.insert",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "scipy.io.wavfile.read",
"... |
26929642562 | import plotly.graph_objects as go
import plotly.io as pio
from PIL import Image
# to render in jupyterlab
#pio.renderers.default = "plotly_mimetype"
# Create figure
fig = go.Figure()
pyLogo = Image.open(r'C:\Users\l.trouw\Documents\Pycharm\Lean_simulation\VSMvisualizationMatrasses.png')
# Add trace
fig.add_trace(
... | luuktrouw/Districon_lean_AdvancedAnalytics | Testfile.py | Testfile.py | py | 665 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "plotly.graph_objects.Figure",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "plotly.graph_objects",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "PIL.Image.open",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "PIL.Ima... |
14837403984 | from django.urls import path
from . import views
urlpatterns = [
path('post/<int:comment_pk>/comment_edit/', views.comment_edit, name='comment_edit'),
path('post/new/', views.post_new, name='post_new'),
path('post/list', views.post_list, name='post_list'),
path('post/<int:post_pk>/', views.post_detail... | meeeeeeeh/djangoblog | post/urls.py | urls.py | py | 1,384 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
15271938454 | """
Creating keyspaces in Cassandra:
CREATE KEYSPACE my_keyspace WITH replication = {'class':'SimpleStrategy', 'replication_factor':1};
"""
from faker import Faker
faker = Faker()
def get_registered_user():
return faker.name()+"$"+faker.address()+"$"+faker.year()
"""return {
"name": faker.name(),
"address"... | imnikhilanand/Real-Time-ETL-with-Kafka-Spark-Cassandra | src/produce_data/generate_data.py | generate_data.py | py | 431 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "faker.Faker",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "faker.name",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "faker.address",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "faker.year",
"line_number": ... |
37562209258 | import os
from modules.computation.Dataset import Dataset
def _main():
# Define the default values for the options
pathHome = os.path.expanduser('~')
pathWork = os.path.join( pathHome, 'Desktop/ProyectoGDSA')
pathImages = os.path.join(pathWork,'1_images')
pathDatasets = os.path.join( pathWork... | aamcgdsa21/GDSA | Descriptor/tools/2_datasets.py | 2_datasets.py | py | 965 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "os.path.expanduser",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number"... |
29792375641 | #!/usr/bin/env python3
import sys
import numpy as np
from scipy.spatial.transform import Rotation as R
from scipy.interpolate import interp1d
import rospy
import moveit_commander
import actionlib
from franka_gripper.msg import MoveGoal, MoveAction
from geometry_msgs.msg import Point, Pose, PoseStamped
from control_ms... | dwya222/end_effector_control | scripts/demo_interface.py | demo_interface.py | py | 13,316 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "rospy.init_node",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "rospy.set_param",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "rospy.logwarn",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "rospy.logwarn",
"li... |
13240819097 | #
# A framework for messaging between programs
# and visualising the signaling
#
import zmq
import time
import random
import json
import sys
import protobuf_examples.example
ctx = zmq.Context()
class Stub:
def __init__(self, name):
self.name = name
self.socket = ctx.socket(zmq.PUSH)
timeout_m... | magnuswahlstrand/home-automation | stub_world/send_sequence.py | send_sequence.py | py | 2,322 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "zmq.Context",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "zmq.PUSH",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "zmq.LINGER",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "random.choice",
"line_n... |
826135486 | # -*- coding: utf-8 -*-
"""
Created on Sat May 7 17:36:23 2022
@author: ThinkPad
"""
from __future__ import print_function
import argparse
import os
import numpy as np
import random
import torch
import torch.nn.parallel
import torch.optim as optim
import torch.utils.data
from PartialScan import PartialScans,unpickle
... | FreddieRao/TextCondRobotFetch | pointnet/train.py | train.py | py | 6,147 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "random.seed",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "torch.manual_seed"... |
8466448273 | #!usr/bin/env python
# -*- coding: utf-8 -*-
import itertools
import alphabet
from sequence_utils import get_reverse_complement
from get_kmers import get_kmers_from_sequence
import fasta_parser
def iter_kmers(alphabet, k):
"""Generator function that yields every kmer (substring of length k) over an
alphabet, ... | schlogl2017/PauloSSchlogl | get_palindromes.py | get_palindromes.py | py | 5,625 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "itertools.product",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sequence_utils.get_reverse_complement",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "itertools.product",
"line_number": 52,
"usage_type": "call"
},
{
"api_nam... |
72532058109 | import json
import arrow
import requests
from monitor_release.models import RunningSidecar
from monitor_release.settings import Settings
def get_bearer_token(settings: Settings):
headers = {"accept": "application/json", "Content-Type": "application/json"}
payload = json.dumps(
{
"Username... | ITISFoundation/osparc-simcore | scripts/release/monitor/monitor_release/portainer_utils.py | portainer_utils.py | py | 4,679 | python | en | code | 35 | github-code | 6 | [
{
"api_name": "monitor_release.settings.Settings",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "json.dumps",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "monitor_rel... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.