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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
75058950113 | '''
A set of functions to help with feature creation
'''
import numpy as np
import matplotlib.pyplot as plt
from skimage.feature import hog
from image_processing import convert_to_gray
from sklearn.base import BaseEstimator, TransformerMixin
class CreateFeatures(BaseEstimator, TransformerMixin):
def __init__(sel... | erees1/faces-segmentation | src/feature_processing.py | feature_processing.py | py | 5,459 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "sklearn.base.BaseEstimator",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "sklearn.base.TransformerMixin",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "skimage.feature.hog",
"line_number": 16,
"usage_type": "name"
},
{
"api_... |
922075687 | import psycopg2
from flask import Blueprint, render_template, redirect, session, request, jsonify
from dbUtils import interact_db
# events blueprint definition
ranking_1 = Blueprint('ranking_1', __name__, static_folder='static', static_url_path='/ranking_1', template_folder='templates')
# Routes
@ranking_1.route('/r... | leorre/experiment1 | pages/ranking_1/ranking_1.py | ranking_1.py | py | 1,534 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "flask.Blueprint",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "flask.request.args.get",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "flask.req... |
38701188884 | import asyncio
import aiohttp
async def GetAnswer(prompt):
url = "https://www.kato.to/advancedApi/ai/chat"
headers = {
"content-type": "application/json",
"User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36"
}
payload = [
... | mishalhossin/Anime-GPT | koto.py | koto.py | py | 770 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "aiohttp.ClientSession",
"line_number": 20,
"usage_type": "call"
}
] |
32174632956 | # © 2016 Danimar Ribeiro <danimaribeiro@gmail.com>, Trustcode
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
import re
import io
import base64
import logging
import hashlib
from lxml import etree
from datetime import datetime
from pytz import timezone
from odoo import api, fields, models, _
from ... | Trust-Code/odoo-brasil | l10n_br_eletronic_document/models/nfe.py | nfe.py | py | 47,793 | python | pt | code | 178 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "odoo.models.Model",
"line_number": 35,
"usage_type": "attribute"
},
{
"api_name": "odoo.models",
"line_number": 35,
"usage_type": "name"
},
{
"api_name": "re.sub",
"li... |
19455279998 | import os
import shutil
from datetime import datetime
from PIL import Image, ExifTags
import tkinter as tk
from tkinter import filedialog, messagebox
def choose_directory():
global media_path
media_path = filedialog.askdirectory()
if media_path:
folder_entry.delete(0, tk.END)
folder_entry.... | aquamammal/photosvideoorganizer | Photo Folder Creation With Video Updated With Gui.py | Photo Folder Creation With Video Updated With Gui.py | py | 3,273 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "tkinter.filedialog.askdirectory",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "tkinter.filedialog",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "tkinter.END",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "o... |
21318435869 |
import yaml
# data = {
# "client": {"default-character-set": "utf8"},
# "mysql": {"user": 'root', "password": 123},
# "custom": {
# "user1": {"user": "张三", "pwd": 666},
# "user2": {"user": "李四", "pwd": 999},
# }
# }
#
# # 直接 dump 可以把 python 对象转为 YAML 文档
# with open('./my.yaml', 'w', e... | Phila-china/yude | test_game_by_data/yaml_demo/yaml_demo.py | yaml_demo.py | py | 607 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "yaml.safe_load",
"line_number": 20,
"usage_type": "call"
}
] |
14448218907 | """
ChordNova v3.0 [Build: 2021.1.14]
(c) 2020 Wenge Chen, Ji-woon Sim.
Port to Python by osbertngok
"""
import typing
import enum
import music21
from .cnchordfeature import CNChordFeature, CNChordBigramFeature
from ..i18n import Statement, Language, _
from ..functions import different_name
class OverflowState(enum... | osbertngok/chordnovapy | python/chordnovacore/models/cnchord.py | cnchord.py | py | 9,690 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "enum.Enum",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "enum.Enum",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "music21.chord",
"line_number": 43,
"usage_type": "attribute"
},
{
"api_name": "typing.List",
"l... |
24678993685 | import xml.etree.ElementTree as et
import re
def records(xml):
root = et.fromstring(xml)
return root.findall('result/content')
def organisation(record):
org = {
'pure_uuid': record.attrib['uuid'],
'parent_pure_uuid': None,
'parent_pure_id': None,
'type': record.find("./typeClassification/term/lo... | UMNLibraries/experts | experts/pureapi.old/xmlparser.py | xmlparser.py | py | 11,883 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "xml.etree.ElementTree.fromstring",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "xml.etree.ElementTree",
"line_number": 5,
"usage_type": "argument"
},
{
"api_name": "re.match",
"line_number": 139,
"usage_type": "call"
}
] |
18119095039 | import argparse
from pythonosc import udp_client
def send_osc_message(ip, port, address, cue_id):
client = udp_client.SimpleUDPClient(ip, port)
client.send_message(address, cue_id)
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Send an OSC command to QLab to start a cue.")
pa... | BarryAbrams/dracula | Gmmy/python/old/qlab.py | qlab.py | py | 871 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pythonosc.udp_client.SimpleUDPClient",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pythonosc.udp_client",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 9,
"usage_type": "call"
}
] |
75035566753 | #!/usr/bin/env python
# coding: utf-8
# In[1]:
# https://towardsdatascience.com/3-easy-ways-to-deploy-your-streamlit-web-app-online-7c88bb1024b1
import streamlit as st
st.title("Housing Prediction")
st.write("""
### Project description
We have trained the data to predict the n cheap house based on the following inf... | aslam7861/Software_development | housing_streamlit.py | housing_streamlit.py | py | 1,497 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "streamlit.title",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "streamlit.write",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "streamlit.number_input... |
32655540313 | from flask import request as current_request, g as request_context
from werkzeug.exceptions import Unauthorized
from server.auth.secrets import secure_hash
from server.db.domain import Service, ServiceToken
from server.logger.context_logger import ctx_logger
def get_authorization_header(is_external_api_url, ignore_m... | SURFscz/SBS | server/auth/tokens.py | tokens.py | py | 1,622 | python | en | code | 4 | github-code | 1 | [
{
"api_name": "flask.request.headers.get",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "flask.request.headers",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "we... |
27470853052 | #!/usr/bin/env python
import os
import wave
import rospy
import pyaudio
import speech_recognition as sr
from std_msgs.msg import String
from pmb2_face.srv import listen_service
class speech2text_node():
def __init__(self):
rospy.init_node('speech2text_node')
rospy.loginfo("Starting sp... | lfvm0001/pmb2_UJA | pmb2_face/scripts/speech2text_node_2.py | speech2text_node_2.py | py | 2,219 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "rospy.init_node",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "rospy.loginfo",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "rospy.Publisher",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "std_msgs.msg.String",
... |
2673784857 | import unittest
import training
from convertToYOLOcsv import convertToYOLO
import torch
import utils
from metrics import PredictionStats, AveragePrecision, TRUE_POSITIVE, FALSE_POSITIVE
class TestMethods(unittest.TestCase):
def test_loss(self):
outputs = torch.rand((64, 7*7*(5+4)))
truth = torch.... | edinitu/ObjectDetection | tests.py | tests.py | py | 4,764 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "unittest.TestCase",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "torch.rand",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "torch.rand",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "training.no_of_classes",
... |
3667435969 | import sys
from typing import Any
import bpy
bl_info = {
"name" : "UV_Texture",
"author" : "FlagYoung",
"description" : "",
"blender" : (3, 20, 0),
"version" : (0, 0, 1),
"location" : "",
"warning" : "",
"category" : "Generic"
}
##
# import files
# ##---------------
from .UI import... | 1641585051/UVTexture | __init__.py | __init__.py | py | 3,105 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "typing.Any",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "UI.UV_UI.UVTexture_PT_Base",
"line_number": 34,
"usage_type": "attribute"
},
{
"api_name": "UI.UV_UI",
"line_number": 34,
"usage_type": "name"
},
{
"api_name": "UVOperators.UV_op... |
26773545961 | import json
import logging
import random
from concurrent.futures import ThreadPoolExecutor
import sentry_sdk
from ddtrace import tracer
from jsonschema import validate
from jsonschema.exceptions import ValidationError
from ..enip_common import s3
from ..enip_common.config import CDN_URL
from ..enip_common.pg import g... | vote/enip-backend | enip_backend/export/run.py | run.py | py | 5,896 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "json.loads",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "jsonschema.validate",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "jsonschema.exceptions.ValidationError",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "... |
24183708020 | # Databricks notebook source
import requests
import json
def request_llamav2_13b(question, url,token):
headers = {
"Content-Type": "application/json",
"Authentication": f"Bearer {token}"
}
data = {
"prompt": question
}
response = requests.post(url, headers=h... | sebrahimi1988/speech-enabled-QA-chatbot | backend/06_hit_the_proxy.py | 06_hit_the_proxy.py | py | 700 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "requests.post",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 16,
"usage_type": "call"
}
] |
30394716367 | from flask import Flask
import win32print
import win32ui
import win32api
import win32print
app = Flask(__name__)
GHOSTSCRIPT_PATH = "./GHOSTSCRIPT/bin/gswin32.exe"
GSPRINT_PATH = "./GSPRINT/gsprint.exe"
currentprinter = win32print.GetDefaultPrinter()
@app.route('/')
def root():
return "Home page"
@app.route... | TranHoangKhoi/Python-Tool | routeApi.py | routeApi.py | py | 586 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "flask.Flask",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "win32print.GetDefaultPrinter",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "win32api.ShellExecute",
"line_number": 24,
"usage_type": "call"
}
] |
37574210596 | import requests
from flask import render_template, Flask, request, url_for
from flask_bootstrap import Bootstrap
from flask_wtf import FlaskForm
from werkzeug.utils import redirect
from wtforms import StringField, SelectField, SubmitField
from wtforms.validators import DataRequired, URL
from cafeApiManager import Api... | yassineberradi/cafe_wifi | main.py | main.py | py | 5,389 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "flask.Flask",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "flask_bootstrap.Bootstrap",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "flask_wtf.FlaskForm",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "wtforms.Str... |
21144554269 | """
Project running module.
Created on 26.01.2020
@author: Ruslan Dolovanyuk
"""
import multiprocessing
from drawer import Drawer
def main():
drawer = Drawer()
drawer.mainloop()
if __name__ == '__main__':
multiprocessing.freeze_support()
main()
| DollaR84/HotSound | main.pyw | main.pyw | pyw | 270 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "drawer.Drawer",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "drawer.mainloop",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "multiprocessing.freeze_support",
"line_number": 21,
"usage_type": "call"
}
] |
39284302958 | from sqlalchemy.orm import Session
from fastapi import HTTPException
from . import models
from . import schemas
from ..gpt import validate_tag
def create_user(db: Session, user: schemas.UserCreate):
db_user = models.User(login=user.login, email=user.email, phone_number=user.phone_number,
... | choseenonee/MISIS-Hub | backend/database/CRUD.py | CRUD.py | py | 5,890 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sqlalchemy.orm.Session",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "fastapi.HTTPException",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.orm.Session",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "fa... |
413232590 | import os
import math
import numpy as np
from box import Box # type: ignore
def study_id_from_path(filepath):
return os.path.splitext(os.path.basename(filepath))[0]
def str2bool(value):
if value is None:
return False
if isinstance(value, bool):
return value
return value.lower() in {... | iossifovlab/gpf | dae/dae/utils/helpers.py | helpers.py | py | 1,807 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "os.path.splitext",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "os.path.basename",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.isnan",
"line_n... |
17038320373 | from sklearn.model_selection import train_test_split, GridSearchCV, ShuffleSplit
import pandas as pd
import numpy as np
import lightgbm as lgb
import pickle
from sklearn.metrics import mean_squared_error
from math import sqrt
def RMSE(y_actual, y_predicted):
rms = sqrt(mean_squared_error(y_actual, y_predicted))
... | sklinl/Competition_Tunghai | Preliminary/lgbm.py | lgbm.py | py | 4,581 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "math.sqrt",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sklearn.metrics.mean_squared_error",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.sqrt",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.mean",
... |
24046431936 | # -*- coding: utf-8 -*-
import argparse
import math
import pybullet as p
from time import sleep
#Intervalle de temps entre chaque fenêtre
dt = 0.01
#Longeurs des composantes des pattes
l1 = 40
l2 = 45
l3 = 65
l4 = 87
def init():
"""Initialise le simulateur
Retourne:
int -- l'id du robot
"""
... | EBeauvillard/quadruped | quadruped.py | quadruped.py | py | 11,003 | python | fr | code | 0 | github-code | 1 | [
{
"api_name": "pybullet.connect",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "pybullet.GUI",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "pybullet.setGravity",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "pybullet.loadU... |
5701850514 | from logging import getLogger
import threading as th
from django.conf import settings
from telegram.ext import Updater, CommandHandler, MessageHandler, Filters
from .. import common_handlers
from .handlers import handlers
from .decorators import adapter
logger = getLogger(__name__)
def setup_webhook(updater):
w... | conyappa/mvp | app/bot/telegram/replier.py | replier.py | py | 1,288 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.conf.settings.TELEGRAM_WEBHOOK_DOMAIN",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "django.conf.settings",
"line_number": 14,
"usage_type": "name"
},
... |
10959291510 | from flask import Flask;
import importlib;
STATIC_URL_PATH_ATTRIBUTE_NAME = 'STATIC_URL_PATH';
class AppFactory:
@staticmethod
def create_app(config_class):
"""Send a email with the latest HED schema.
Parameters
----------
config_class: string
The configuration cl... | VisLab/HEDToolsArchived | python/hedemailer/hedemailer/app_factory.py | app_factory.py | py | 1,249 | python | en | code | 6 | github-code | 1 | [
{
"api_name": "flask.Flask",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "importlib.import_module",
"line_number": 42,
"usage_type": "call"
}
] |
70507014433 | #!/usr/bin/env python3
import os, signal, subprocess
import psutil
class ProcessT:
def __init__(self, proc_arg):
print(proc_arg)
self._process = subprocess.Popen(proc_arg['cmd'], shell=True)
self._name = proc_arg['name']
def kill(self):
self._process.kill()
def name(self):... | Jay87682/auto_unittest_flask | flask_app/controller.py | controller.py | py | 1,927 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "subprocess.Popen",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "psutil.Process",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "psutil.wait_procs",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "os.getpgid",
"li... |
29106036893 | from django.conf import settings
from django.conf.urls.static import static
from django.contrib import admin
from django.urls import path, include
#from rest_framework_swagger.views import get_swagger_view
#schema_view = get_swagger_view(title='Pastebin API')
urlpatterns = [
#path('', schema_view),
path('', ... | TulsiSharma206/New | auth/urls.py | urls.py | py | 756 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.urls.path",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "django.contrib.admin.site",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "... |
36909051788 | import json
import os
import subprocess
import requests
from dotenv import load_dotenv
from web3 import Web3
#get env
load_dotenv('price-timestamping/.env')
gitlab_email = os.getenv('gitlab_email')
infura_url = os.getenv('infura_url')
account_sender = os.getenv('account_sender')
account_receiver = os.getenv('account_... | qredo/price-timestamping | etl_pricedumping/pricedumping.py | pricedumping.py | py | 2,829 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "dotenv.load_dotenv",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number":... |
4450960332 | import json
import datetime
class Utility:
zones = ['1', '2']
@staticmethod
def load_config():
try:
with open('fare_config.json', mode='r') as config_file:
return json.loads(config_file.read())
except FileNotFoundError:
return False
@staticmeth... | mani1604/travelcard | utility.py | utility.py | py | 707 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "json.loads",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.strptime",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "datetime... |
1443260575 | # -*- coding: utf-8 -*-
"""
Author : Alexandre
Created : 2021-06-30 11:58:56
Comments : (low-level) functions handling export of data / figures for HAL
"""
# %% IMPORTS
# -- global
import logging
import h5py
import numpy as np
from pathlib import Path
from datetime import datetime
from PyQt5.QtWidgets import QFil... | adareau/HAL | HAL/gui/export.py | export.py | py | 4,973 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "numpy.max",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"... |
71487148833 | import random
from clarifai_grpc.grpc.api import service_pb2, resources_pb2
from clarifai_grpc.grpc.api.status import status_code_pb2
# Insert here the initialization code as outlined on this page:
# https://docs.clarifai.com/api-guide/api-overview
# This is how you authenticate.
metadata = (('authorization', f'Key a... | clara7089/Gray | clarifai.py | clarifai.py | py | 6,857 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "clarifai_grpc.grpc.api.service_pb2_grpc.V2Stub",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "clarifai_grpc.grpc.api.service_pb2_grpc",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "clarifai_grpc.channel.clarifai_channel.ClarifaiChannel.get... |
24997981874 | from requests_html import HTMLSession
from bs4 import BeautifulSoup
a_buscar='jamon'
url_base='https://www.amazon.es/s?k='+a_buscar+'&__mk_es_ES=%C3%85M%C3%85%C5%BD%C3%95%C3%91&ref=nb_sb_noss'
s=HTMLSession()
def get_data(url):
r=s.get(url)
r.html.render(sleep=1)
soup=BeautifulSoup(r.html.html,'html.parser')
... | LuisJulian17/botprecios | webs3.py | webs3.py | py | 915 | python | es | code | 0 | github-code | 1 | [
{
"api_name": "requests_html.HTMLSession",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 14,
"usage_type": "call"
}
] |
31490813260 | import cv2
cap = cv2.VideoCapture("D:\ciic-iitm\image processing\FullSizeRender.MOV")
frame_no = 0
while(cap.isOpened()):
frame_exists, curr_frame = cap.read()
if frame_exists:
print("for frame : " + str(frame_no) + " timestamp is: ", str(frame_no/cap.get(cv2.CAP_PROP_FPS)))
frame_no+=1
... | siddiq3004/computer-vision | IITM_HACKATHON_PROJECT/Round_2/stamp.py | stamp.py | py | 374 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "cv2.CAP_PROP_FPS",
"line_number": 10,
"usage_type": "attribute"
}
] |
1538782476 | import logging
import time as tm
import numpy as np
__author__ = 'frank.ma'
logger = logging.getLogger(__name__)
class Maze(object):
def print_maze(self):
logger.info('size: [%i, %i]' % self.size)
logger.info('start: [%i, %i]' % self.start)
logger.info('end: [%i, %i]' % self.end)
... | frankma/Finance | src/MiniProjects/Maze/maze.py | maze.py | py | 993 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "time.clock",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.loadtxt",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "time.clock",
"line_numb... |
24850037333 | from typing import Dict
from rlcard3.games.mocsar.action import Action
from rlcard3.model_agents.agent import Agent
from rlcard3.games.mocsar.utils import get_action_ids, action_to_ret, decode_obs
import numpy as np
class MocsarRandomAgent(Agent):
""" Mocsar Rule agent version 1, take a random action
"""
... | cogitoergoread/rlcard3 | rlcard3/model_agents/mocsar_random_agent.py | mocsar_random_agent.py | py | 2,236 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "rlcard3.model_agents.agent.Agent",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "typing.Dict",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "rlcard3.games.mocsar.utils.get_action_ids",
"line_number": 34,
"usage_type": "call"
},
{
... |
5583859040 | import re
import os
import sys
import unittest
import cv2
import numpy as np
import threading
from PIL import ImageGrab
from functools import wraps
from time import sleep, time
from appium.webdriver.common.mobileby import MobileBy as By
from selenium.webdriver.support import expected_conditions as ec
from s... | johnny-butter/UI-Automation | supportiveFunction.py | supportiveFunction.py | py | 13,743 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "unittest.loader.TestLoader",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "appium.webdriver.common.mobileby.MobileBy.ID",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "appium.webdriver.common.mobileby.MobileBy",
"line_number": 25,
... |
72498217634 | # vim:fileencoding=UTF-8:filetype=python:ts=4:sw=4:sta:et:sts=4:ai
"""Extend calibre's EPUBContainer to work for a KePub."""
__license__ = "GPL v3"
__copyright__ = (
"2010, Kovid Goyal <kovid@kovidgoyal.net>; "
+ "2013, Joel Goguen <jgoguen@jgoguen.ca>"
)
__docformat__ = "restructuredtext en"
# Be careful ed... | jgoguen/calibre-kobo-driver | container.py | container.py | py | 23,722 | python | en | code | 246 | github-code | 1 | [
{
"api_name": "calibre.guess_type",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "calibre.guess_type",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "string.punctuation",
"line_number": 50,
"usage_type": "attribute"
},
{
"api_name": "re.comp... |
38975891687 | from django.urls import path
from . import views
urlpatterns = [
path("", views.dashboard, name='dashboard'),
path("cotacao/", views.cotacao, name='cotacao'),
path("entregas/", views.lista_entregas, name='entregas' ),
path("formulario/", views.formulario, name='formulario')
# Outras URLs relaciona... | Brunobh51/sistema | app_CotacaoEntregas/urls.py | urls.py | py | 378 | python | pt | code | 0 | github-code | 1 | [
{
"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",
... |
6028045464 | import numpy as np
import math
from nn import NeuralNet
from typing import List, Dict, Tuple
class AimAssistant:
"""
Wrapper around the neural net for data preprocessing / postprocessing
"""
sides_crop = 0.3
top_crop = 0.35
def __init__(self, crop: bool = False):
self.to_crop = crop
... | EvgeniiTitov/aim_assistance_v2 | aim_assistant.py | aim_assistant.py | py | 6,437 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "nn.NeuralNet",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.ndarray",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "typing.List",
"line_number": 48,
"usage_type": "name"
},
{
"api_name": "numpy.ndarray",
"line... |
11510959402 | # Released under the MIT License. See LICENSE for details.
#
"""UI functionality related to UI items."""
from __future__ import annotations
from typing import TYPE_CHECKING
import bascenev1 as bs
import bauiv1 as bui
if TYPE_CHECKING:
from typing import Any
def instantiate_store_item_display(
item_name: st... | efroemling/ballistica | src/assets/ba_data/python/bauiv1lib/store/item.py | item.py | py | 23,835 | python | en | code | 468 | github-code | 1 | [
{
"api_name": "typing.TYPE_CHECKING",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "typing.Any",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "bauiv1.Widget",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "bauiv1.app",
"... |
27508252115 | # Once contacts are imported, we will create relationships
# Since Meetings are hierarchical along with Wagtail Pages,
# we need to move the existing pages to the correct parent.
# https://stackoverflow.com/a/57057466/1191545
import re
from django.core.exceptions import ObjectDoesNotExist
from contact.models import Me... | WesternFriend/WF-website | content_migration/management/import_civicrm_clerk_relationships_handler.py | import_civicrm_clerk_relationships_handler.py | py | 3,571 | python | en | code | 46 | github-code | 1 | [
{
"api_name": "re.search",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "content_migration.management.shared.parse_csv_file",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "contact.models.Meeting.objects.filter",
"line_number": 61,
"usage_type": "ca... |
74541723232 | from setuptools import find_packages, setup
with open("README.md", encoding="utf8") as f:
readme = f.read()
setup(
name="jupyterhub-tmpauthenticator",
version="1.0.0",
description="JupyterHub authenticator that hands out temporary accounts for everyone",
url="https://github.com/jupyterhub/tmpauthe... | jupyterhub/tmpauthenticator | setup.py | setup.py | py | 1,285 | python | en | code | 20 | github-code | 1 | [
{
"api_name": "setuptools.setup",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "setuptools.find_packages",
"line_number": 27,
"usage_type": "call"
}
] |
34275611553 | import requests
import os
url = 'http://ubmcmm.baidustatic.com/media/v1/0f000ZjaV0Hbb1uWirPKsf.jpg'
root = 'D://pics//'
path = root + url.split('/')[-1]#保留原来文件名
try:
if not os.path.exists(root):
os.mkdir(root)
if not os.path.exists(path):
r = requests.get(url)
with open(path,'wb') as f:... | wxzoro1/MyPractise | python/spidercode/beatifulsoup/网络图片的爬取.py | 网络图片的爬取.py | py | 465 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.path.exists",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "os.mkdir",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number":... |
7593388743 | import unittest
from xml.etree import ElementTree as ET
from xmlcomparer import transformer
import logging
#logging.basicConfig(level=logging.DEBUG)
class TestTransformer(unittest.TestCase):
def test_can_ignore_order(self):
xml_incorrect_order = ET.parse("../../demo/sort_only2.xml")
t = transform... | withrocks/xmlcomparer | test/integration/test_transformer.py | test_transformer.py | py | 851 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "unittest.TestCase",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "xml.etree.ElementTree.parse",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "xml.etree.ElementTree",
"line_number": 11,
"usage_type": "name"
},
{
"api_name"... |
23949433233 | import requests
from utility.conversions import number_to_ranks
class LobbySetup:
'''
Retrieve lobby details. Must be in game.
'''
def __init__(self, headers):
self.headers = headers
def get_latest_season_id(self, region):
try:
response = requests.get(
... | seanfinnessy/Val_UI | server/setup/LobbySetup.py | LobbySetup.py | py | 5,451 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "requests.get",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_numbe... |
38311900062 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Apr 10 17:43:35 2019
@author: stef
This script is to analyse and produce some summary statistics for (a subset of)
all the NOS dictionaries extracted using the function scrape_nos.py.
Which dictionaries to analyse can be set using the ``which_files'' l... | nestauk/openjobs-SDS-NOS-2019 | check_extracted_NOS.py | check_extracted_NOS.py | py | 8,663 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "numpy.zeros",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 64,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 64,
"usage_type": "attribute"
},
{
"api_name": "numpy.zeros",
"line_number"... |
21391391184 | # 15-112: Principles of Programming and Computer Science
# HW07 Programming: Term Project (Tetris)
# Name : Umaymah Imran
# AndrewID : uimran
# File Created:
# Modification History:
# Start End
# 2/11 11:46pm 3/11 3:14am
# 3/11 12:01pm 3/11 4:11pm
# 3/1... | uimran/15-112-Term-Project | Tetris_Project.py | Tetris_Project.py | py | 39,683 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pygame.mouse.get_pos",
"line_number": 70,
"usage_type": "call"
},
{
"api_name": "pygame.mouse",
"line_number": 70,
"usage_type": "attribute"
},
{
"api_name": "pygame.mouse.get_pressed",
"line_number": 71,
"usage_type": "call"
},
{
"api_name": "pygam... |
15279130231 |
# Binary Search
from collections import List
class Solution:
def maxLength(self, ribbons: List[int], k: int) -> int:
low, high = 1, max(ribbons)
while low <= high:
mid = low + (high - low) // 2
# add number of ribons that can be ... | onyxolu/DSA | Facebook/Top 100/CuttingRibbons.py | CuttingRibbons.py | py | 716 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "collections.List",
"line_number": 7,
"usage_type": "name"
}
] |
2573940128 | from sdv.model import (
DataPointBoolean,
DataPointFloat,
DataPointInt8,
DataPointUint8,
DataPointUint16,
Model,
)
from sdv_model.Cabin.Seat.Airbag import Airbag
from sdv_model.Cabin.Seat.Backrest import Backrest
from sdv_model.Cabin.Seat.Headrest import Headrest
from sdv_model.Cabin.Seat.Occup... | eclipse-velocitas/vehicle-model-python | sdv_model/Cabin/Seat/__init__.py | __init__.py | py | 2,920 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "sdv.model.Model",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "sdv.model.DataPointBoolean",
"line_number": 80,
"usage_type": "call"
},
{
"api_name": "sdv_model.Cabin.Seat.Occupant.Occupant",
"line_number": 81,
"usage_type": "call"
},
{
... |
18960408588 | import cv2
import numpy as np
import rect
image = cv2.imread('test-images/page.jpg')
# Resizing will make results better. Why?????
image = cv2.resize(image, (1500, 880))
orig = image.copy()
gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
blurred = cv2.GaussianBlur(gray, (5, 5), 0)
kernel = np.ones((3, 3), np.uint8)
... | billstark/receipt-scanner | ReceiptGenerator/archive/scanner_archived.py | scanner_archived.py | py | 2,794 | python | en | code | 86 | github-code | 1 | [
{
"api_name": "cv2.imread",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "cv2.resize",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2GRAY",
"line_numbe... |
41581380035 | import pygame,sys
from esTxt import textt
def options():
altura = 600
largura = 1230
mainClock = pygame.time.Clock()
screen = pygame.display.set_mode((largura,altura), 0, 32)
es=textt("opt",(225,225,225),screen,40,400)
running = True
while running:
screen.fill((0,0,0))
... | EmanuelUrbano/oJogo02 | opt.py | opt.py | py | 679 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pygame.time.Clock",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pygame.time",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pygame.displa... |
26461253101 | import pandas as pd
import json
import time
import os
import re
import random
import requests
from urllib import parse
class DuckSearch:
def __init__(self, settings):
self.domain = 'https://duckduckgo.com'
self.language = settings.get('DDGlanguage', 'en-us')
self.headers = {
'U... | SNStatComp/urlfinding | urlfinding/duckduckgo.py | duckduckgo.py | py | 2,911 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "urllib.parse.quote",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "urllib.parse",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "requests.get",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "re.search",
"line_nu... |
36564736991 | import os
#import cv2
import math
import time
import csv
import random
import numpy as np
import scipy.io as scio
import PIL.Image as Image
#from sklearn.metrics import confusion_matrix, roc_curve, average_precision_score, auc, f1_score
import argparse
parse = argparse.ArgumentParser('Train_Unimodal')
parse.add_argum... | qiulu-sjtu/MultimodalFusion | Train_Unimodal_Coatt.py | Train_Unimodal_Coatt.py | py | 15,323 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "os.path",
"l... |
41054820426 | import time
import pytest
from botocore.exceptions import ClientError
from botocore.stub import ANY
import service_linked_roles
@pytest.mark.parametrize(
"error_code, stop_on_method",
[
(None, None),
("TestException", "stub_create_service_linked_role"),
("TestException", "stub_list_a... | awsdocs/aws-doc-sdk-examples | python/example_code/iam/test/test_service_linked_roles.py | test_service_linked_roles.py | py | 2,202 | python | en | code | 8,378 | github-code | 1 | [
{
"api_name": "service_linked_roles.iam",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "botocore.stub.ANY",
"line_number": 38,
"usage_type": "argument"
},
{
"api_name": "service_linked_roles.usage_demo",
"line_number": 61,
"usage_type": "call"
},
{
... |
70611386915 | import urllib.request
import shutil
import requests
import xlsxwriter
import random
import re
from pymongo import MongoClient
client = MongoClient()
db = client.chrome
collect = db.polyA
mcursor = collect.find({'organism':'Homo sapiens'})
TotalConsmRNA = {}
RegionConsmRNA = {}
ConsGene = {}
RegionConsGene = {}
T... | freezer333/biotools | analysis/URichMRNADist.py | URichMRNADist.py | py | 1,901 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "pymongo.MongoClient",
"line_number": 10,
"usage_type": "call"
}
] |
29293537961 | """Tutor shared region nav bar."""
import re
from time import sleep
from pypom import Region
from selenium.common.exceptions import WebDriverException
from selenium.webdriver.common.by import By
from utils.tutor import TutorException
from utils.utilities import Utility, go_to_, go_to_external_
class Menu(Region):
... | openstax/os-automation | regions/tutor/nav.py | nav.py | py | 16,999 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "pypom.Region",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "selenium.webdriver.common.by.By.CSS_SELECTOR",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "selenium.webdriver.common.by.By",
"line_number": 17,
"usage_type": "name"
... |
27976554317 | import numpy as np
import matplotlib.pyplot as plt
import functions
# functions parameters
N = 8 # Number of particles
timesteps = 1000 # Number of functions time steps
dt = 1e-1 # Timestep
alpha = 0.5 # cubic coupling
beta = 0.1 # quartic coupling
# for dt, timesteps in zip([1, 5*1e-1, 1e-1, 5*1e-2, 1e-2, 5*1e-3... | zRko29/Physics-masters | deprecated/energies.py | energies.py | py | 1,111 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "functions.integration",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "functions.energy",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.mean",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.max",
"li... |
73085125154 | import web
import random
import serialsend
urls = (
'/', 'index',
)
render = web.template.render('templates/', base='layout')
'''
used to display a simple form using HTML5
x-webkit-speech. post data is then sent
to serialsend.py which acts as a middleman between
python and the micro-controller.
'''
c... | beng/arduino_speech | talk.py | talk.py | py | 625 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "web.template.render",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "web.template",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "web.input",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "serialsend.input",
... |
25727907989 | import operator
from typing import Union, Tuple, Callable, TypeVar
from numbers import Number
from decimal import Decimal, ROUND_DOWN
from functools import total_ordering
from tensortrade.core.exceptions import (
InvalidNegativeQuantity,
IncompatibleInstrumentOperation,
InvalidNonNumericQuantity,
Quan... | tensortrade-org/tensortrade | tensortrade/oms/instruments/quantity.py | quantity.py | py | 10,188 | python | en | code | 4,270 | github-code | 1 | [
{
"api_name": "typing.TypeVar",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "decimal.Decimal",
"line_number": 39,
"usage_type": "name"
},
{
"api_name": "decimal.Decimal",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "tensortrade.core.excep... |
3540734192 | """============================================================================
Ex2: PCA - sklearn --> mở rộng thêm phân tích phương sai để xác định k
a) Đọc tập tin dữ liệu Student_12f.xls vào dataframe.
b) Áp dụng phương pháp PCA để giảm xuống k chiều (2 < k < 12).
Giải thích nguyên nhân hay c... | lualua0909/Math-4-ML-lds3 | B3. PCA/Ex2 - PCA voi sklearn (Phan tich phuong sai).py | Ex2 - PCA voi sklearn (Phan tich phuong sai).py | py | 5,375 | python | vi | code | 10 | github-code | 1 | [
{
"api_name": "pandas.read_excel",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "sklearn.decomposition.PCA",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "... |
3420991534 | from sklearn.model_selection import StratifiedShuffleSplit
def cross_validation(clf, features, labels):
cv = StratifiedShuffleSplit(random_state=106)
true_negatives = 0
true_positives = 0
false_negatives = 0
false_positives = 0
for train_idx, test_idx in cv.split(features, labels):
fe... | mukerong/Data-Science-Project | Titanic-Survival-Exploration/cross_validation.py | cross_validation.py | py | 1,651 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "sklearn.model_selection.StratifiedShuffleSplit",
"line_number": 5,
"usage_type": "call"
}
] |
36220973818 | import pygame
from itertools import product
class Board:
def __init__(self, w, scr):
self.world=w
self.screen=scr
def paint(self):
org=self.world.get_organism()
width=self.world.get_n()
height=self.world.get_m()
sizex = 500 / width
sizey =... | epaw02/Python-World-Simulation-OOP | phytonn/Board.py | Board.py | py | 782 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "itertools.product",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "pygame.draw.rect",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "pygame.draw",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "pygame.Rect",
... |
37850694353 | from pyspark.sql.functions import col
from pyspark.sql.types import (
DoubleType,
IntegerType,
LongType,
StringType,
StructField,
TimestampType,
)
from . import AbstractSchema
class AnswersSchema(AbstractSchema):
def get_columnid(self):
return ["activityId", "userId"]
def get... | himewel/engage | spark/src/schemas/answers_schema.py | answers_schema.py | py | 1,459 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "pyspark.sql.functions.col",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pyspark.sql.types.StructField",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "pyspark.sql.types.IntegerType",
"line_number": 23,
"usage_type": "call"
},
{
... |
14939283703 | # load the dataset
'''
data = open('dataset.csv').read()
labels=[]
texts= []
for i, line in enumerate(data.split("\n")):
print line
content = line.split()
print content[0]
labels.append(content[0])
texts.append(content[1:])
# create a dataframe using texts and lables
traindataframe = pandas.DataFra... | vikash18086/News_Classification-Data_Mining_Project- | Final_project/Naive.py | Naive.py | py | 3,259 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sklearn.metrics.accuracy_score",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "sklearn.metrics",
"line_number": 38,
"usage_type": "name"
},
{
"api_name": "csv.reader",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "numpy.array... |
31319950017 | #!/usr/local/bin/python
""" Capture pictures from webcamera to create stop motion video
Examples
Output to 'out' directory, capture every 60 seconds:
python camcapture.py
Output to 'mydir', capture every 30 seconds
python camcapture.py -o mydir -r 30
"""
import argparse
import cv2
import time
import datetime
import... | julenka/stopmotionselfie | camcapture.py | camcapture.py | py | 1,382 | python | en | code | 4 | github-code | 1 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number":... |
17287911939 | # Shows different formula for time decay for use in a game
# The first uses a linear decay which results in a fast decay
# The Improved version uses a formula giving a decay that slows down over time
# This is based on the formula f(x) = x / x + h
# To run first install plotly using:
# pip3 install plotly
import plotl... | Apress/beginning-game-programming-with-pygame-zero | Chapter 4/timedecaygraph.py | timedecaygraph.py | py | 1,167 | python | en | code | 11 | github-code | 1 | [
{
"api_name": "plotly.graph_objs.Scatter",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "plotly.graph_objs",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "plotly.graph_objs.Scatter",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": ... |
4848631023 | from collections import defaultdict
import tator
if __name__ == '__main__':
parser = tator.get_parser()
args = parser.parse_args()
api = tator.get_api(host=args.host, token=args.token)
projects = api.get_project_list()
total_size = 0
total_duration = 0
size_by_org = defaultdict(int)
du... | cvisionai/tator-py | examples/platform_stats.py | platform_stats.py | py | 1,177 | python | en | code | 4 | github-code | 1 | [
{
"api_name": "tator.get_parser",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "tator.get_api",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "collections.defa... |
43527352932 | #!/usr/bin/python2
# This script parses the Naughty and Nice List (CSV).
# For each person on the list, query the NPPD
# infractions database and gather an infractions list.
# Written for the SANS Holiday Hack Challenge 2017
# by Jason Testart
# December 2017
import csv
import urllib2
import json
# Function: Given ... | jasontestart/CTF | SANSHolidayHackChallenge/2017/nppd/getAllInfractions.py | getAllInfractions.py | py | 1,136 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "urllib2.Request",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "urllib2.urlopen",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "csv.reader",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_numb... |
2768924683 | import urllib.request as req
from bs4 import BeautifulSoup
import openpyxl #엑셀에 넣기 위해
import os
from openpyxl.drawing.image import Image #앨범을 넣기 위해 부러와
#엑셀파일 존재하는지 확인 위해 OS 블러옴
if not os.path.exists("./멜론음원차트_오늘.xlsx"):
book = openpyxl.Workbook()
book.save("./멜론음원차트_오늘.xlsx")
headers = req.Request(... | Aki-hwang/Python_lvl_1 | 30_멜론크롤링.py | 30_멜론크롤링.py | py | 2,026 | python | ko | code | 0 | github-code | 1 | [
{
"api_name": "os.path.exists",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "openpyxl.Workbook",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "urllib.request.Request",
... |
27232796115 | """ Various helper methods """
from django.core.signing import Signer, BadSignature
from django.conf import settings
import os
import base64
import binascii
def get_size(path):
"""
Returns the size of a directory using Python 3.5 PEP 471 os.scandir()
MUCH faster than os.walk as scandir return... | bwebsterhv/transpack | src/transpack/helpers.py | helpers.py | py | 1,340 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.scandir",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "base64.b64decode",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "binascii.Error",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "django.core.signing.S... |
23768057380 | from dataclasses import dataclass, field
from typing import List
from entity import MovingEntity
from entity.ship_components import (
AvailableComponents,
ShipComponent,
container,
defense,
)
from processor import logging
@dataclass
class Ship(MovingEntity):
"""尚未初始化数值和组件的飞船
初始化属性和默认值已给出,可以根... | RuofengX/PyCosmic | entity/ships.py | ships.py | py | 1,911 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "entity.MovingEntity",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "entity.ship_components.AvailableComponents",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "dataclasses.field",
"line_number": 22,
"usage_type": "call"
},
{
"... |
26577958655 | #!/usr/bin/env python3
import toml
import sys
def err(msg, *args):
print('error:', msg % args, file = sys.stderr)
def enforce_key_not_in_configs(dict, key, type, action):
if key in dict:
err('%s %s should not %s in configs.toml',
type, key, action)
sys.exit(1)
def main():
sec... | contain-rs/admin | homu/generate-cfg.py | generate-cfg.py | py | 1,308 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sys.stderr",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "sys.exit",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "toml.load",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "toml.load",
"line_number": 18,
... |
40731159802 | import numpy as np
import warnings
import os
import statsmodels.formula.api as smf
import pandas as pd
import functools
import re
warnings.filterwarnings('ignore')
class stepwise:
def __init__(self,step,fit_intercept):
self.step = step
self.fit_intercept = fit_intercept
def reduce_concat(sel... | avinashbarnwal/stepwisereg | stepwisereg/.ipynb_checkpoints/stepwisereg-checkpoint.py | stepwisereg-checkpoint.py | py | 2,780 | python | en | code | 27 | github-code | 1 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "functools.reduce",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "re.split",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "re.split",
"line... |
25820153472 | from __future__ import absolute_import, division, print_function, unicode_literals
import requests
from requests.api import request
from oauthlib import oauth1
import json
import os
import re
try:
# python2
from urlparse import parse_qsl
except ImportError:
# python3
from urllib.parse import parse_qsl
... | discogs/discogs_client | discogs_client/fetchers.py | fetchers.py | py | 6,555 | python | en | code | 481 | github-code | 1 | [
{
"api_name": "requests.request",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "requests.request",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "oauthlib.oauth1.Client",
"line_number": 70,
"usage_type": "call"
},
{
"api_name": "oauthlib.oau... |
5502015887 | """
YouTube: https://youtu.be/GdNA6AFk0Mg
Terminal display commands:
.header on
.mode columns
WHERE Clause Reference: https://www.tutorialspoint.com/sqlite/sqlite_where_clause.htm
"""
import sqlite3
from sqlite3 import OperationalError, IntegrityError
import os
import sys
class DB_Manager:
conn = None
def ... | tacomonster/Database_Manager | DB_Manager.py | DB_Manager.py | py | 3,745 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "sqlite3.connect",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "sqlite3.Row",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "sqlite3.OperationalError",
"line_number": 38,
"usage_type": "name"
},
{
"api_name": "sqlite3.Int... |
7108370811 | #!/usr/bin/python3
"""
Module gérant l'interface graphique des fenêtres liées à la gestion des devoirs.
"""
## imports
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
from autocompletion import *
from traitements.traitements import *
from dbManagement.dbManagement import BaseDeDonnées
## Cla... | AdrienLicari/competences | fenetresDevoir.py | fenetresDevoir.py | py | 19,696 | python | fr | code | 0 | github-code | 1 | [
{
"api_name": "gi.require_version",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "gi.repository.Gtk.Builder",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "gi.repository.Gtk",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "db... |
71830237474 | """ Defines the robot class and some actions the robot can perform and the main real-time control loop.
"""
import time
import threading
import logging
import math
import numpy as np
import sm_kinematics
log = logging.getLogger(__name__)
from enum import Enum
import config
# import joints
import pca9685_psd
import ... | chrisalbertson/Spek1 | Software/quad_controller/robot.py | robot.py | py | 21,773 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "enum.Enum",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "enum.Enum",
"line_number": 36,
"usage_type": "name"
},
{
"api_name": "enum.Enum",
"line_number": ... |
37413111880 | import torch.nn as nn
import model.octconv as oct
import model.venconv as ven
from model.median_pooling import median_pool_2d
class PrePocess(nn.Module):
def __init__(self, config):
super(PrePocess, self).__init__()
# parameters
low_channel_num = [config["in_channels"], 16, 32, c... | StephenYang190/SpeckleNoisePytorch | model/FDDnet.py | FDDnet.py | py | 6,883 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "torch.nn.Module",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "torch.nn.AvgPool2d",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_n... |
70328223393 | import speech_recognition as sr
import tkinter as tk
import algorithm
sentences = []
text_display = None
def update_text():
global recognized_text
text_display.config(state=tk.NORMAL)
text_display.insert(tk.END, recognized_text + '\n')
text_display.config(state=tk.DISABLED)
text_display.see(tk.EN... | vmdo2/speech-tag-identifier | speech.py | speech.py | py | 2,578 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "tkinter.NORMAL",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "tkinter.END",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "tkinter.DISABLED",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "tkinter.EN... |
23007355058 | """
A module for calculating pharmacies' current respond time.
"""
import datetime
import numpy as np
import pandas as pd
from scipy.interpolate import interp1d
from scipy.signal import medfilt
from scipy.signal import savgol_filter
import ext_connections as ext_con
import requests
import os
import json
class Respon... | john-djorason/respond_time | respond_time/respond_time.py | respond_time.py | py | 19,620 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "ext_connections.API",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "pandas.to_datetime",
"line_number": 68,
"usage_type": "attribute"
},
{
"api_name": "pandas.DataFrame",
"line_number": 109,
"usage_type": "call"
},
{
"api_name": "pandas.... |
35350021858 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('group_discussion', '0003_comment_parent')... | jscott1989/newscircle | group_discussion/migrations/0004_topicuser.py | 0004_topicuser.py | py | 799 | python | en | code | 0 | github-code | 1 | [
{
"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.swappable_dependency",
"line_number": 11,
"usage_type": "call... |
25221058278 | #!/usr/bin/env python3
import os
import json
import backoff
import requests
import pandas as pd
from io import StringIO
from datetime import datetime, timedelta
import singer
from singer import utils, metadata
from singer.catalog import Catalog, CatalogEntry
from singer.schema import Schema
from singer.transform impo... | SageData-OOD/tap-indeed | tap_indeed/__init__.py | __init__.py | py | 14,550 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "singer.get_logger",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.utcnow",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "datetime.dat... |
5139062156 | from threading import *
import time
import cv2
import socket
import io
import pickle
import struct
global connection
global address
cam=cv2.VideoCapture(0)
#stream = io.BytesIO()
client_socket=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
client_socket.connect(('192.168.1.5', 9000))#192.168.43.205
... | 32shivang/Blind-Eye | piValcode.py | piValcode.py | py | 907 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "socket.socket",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "socket.AF_INET",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "socket.SOCK_STREAM... |
26687931335 | import torch
from tqdm import tqdm
from transformers import AutoModelForCausalLM, AutoTokenizer, logging as tf_logging
from model_utils import predict
from utils import (
HitsMetric,
adjust_top_k,
get_args,
get_filename,
load_data,
prepare_input,
update_history,
update_metric,
write... | usc-isi-i2/isi-tkg-icl | run_hf.py | run_hf.py | py | 1,852 | python | en | code | 10 | github-code | 1 | [
{
"api_name": "transformers.logging.set_verbosity_error",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "transformers.logging",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "utils.get_args",
"line_number": 22,
"usage_type": "call"
},
{
"api_... |
58932599 | import pandas as pd
from sklearn.model_selection import train_test_split, cross_val_predict
from sklearn.metrics import classification_report, accuracy_score
from sklearn.utils.validation import column_or_1d
from sklearn.metrics import roc_auc_score, roc_curve
from sklearn import tree
from sklearn.ensemble import Rando... | lionliu/GrammaticalFacialExpressionsDataMining | Guilherme/RandomForestPreParam.py | RandomForestPreParam.py | py | 3,015 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "matplotlib.pyplot.title",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "pandas.read_csv",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "pandas.read... |
42917174855 | import logging
from six import add_metaclass
from abc import ABCMeta, abstractmethod
from agentml.parser import Element
from agentml.common import attribute
from agentml.parser.trigger.response import Response
@add_metaclass(ABCMeta)
class BaseCondition(object):
"""
AgentML Base Condition class
"""
de... | rainyDayDevs/AgentML | agentml/parser/trigger/condition/__init__.py | __init__.py | py | 8,088 | python | en | code | 4 | github-code | 1 | [
{
"api_name": "agentml.parser",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "agentml.common.attribute",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "abc.abstrac... |
8868844094 | import boto3
import numpy as np
from tempfile import NamedTemporaryFile
from librosa.feature import melspectrogram
import librosa
boto_session = boto3.session.Session(region_name='eu-west-3')
s3 = boto_session.resource('s3')
sukikana_bucket = 'sukikana'
def get_logmels(song_id):
with NamedTemporaryFile('wb+') a... | pluttgens/sukikana | tasks/audio/get_log_mel_spectrum.py | get_log_mel_spectrum.py | py | 806 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "boto3.session.Session",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "boto3.session",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "tempfile.NamedTemporaryFile",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "li... |
11457307264 | from fastapi import APIRouter, HTTPException
from models.post import Post
from services.post_service import *
posts = APIRouter()
@posts.get("/posts/")
def get_all_post():
try:
return get_all()
except Exception as e:
return HTTPException(status_code= 400, detail= str(e))
@posts.get("/posts/{... | ilyas-macit/PostApi | routers/post_router.py | post_router.py | py | 1,041 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "fastapi.APIRouter",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "fastapi.HTTPException",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "fastapi.HTTPException",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "models.p... |
35318589108 | import json
import logging
import random
import time
import copy
from argparse import ArgumentParser
from itertools import chain
from pprint import pformat
import copy
import numpy as np
import torch
import torch.nn.functional as F
from transformers import *
from VideoGPT2 import *
from train import SPECIAL_TOKENS, S... | ictnlp/DSTC8-AVSD | generate.py | generate.py | py | 13,878 | python | en | code | 54 | github-code | 1 | [
{
"api_name": "torch.topk",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "torch.sort",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "torch.cumsum",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "torch.nn.functional.softmax",
... |
72689378914 | from rest_framework import viewsets
from rest_framework.generics import get_object_or_404
from rest_framework.permissions import IsAuthenticated
from api.permissions import OnlyAuthorChangeContent
from api.serializers import PostSerializer, GroupSerializer, CommentSerializer
from posts.models import Post, Group
clas... | LariosDeen/api_yatube | yatube_api/api/views.py | views.py | py | 1,223 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "rest_framework.viewsets.ModelViewSet",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.viewsets",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "posts.models.Post.objects.all",
"line_number": 11,
"usage_type": "call"... |
1034404782 | import os
import logging
import ycm_core
from collections import defaultdict
from ycmd.completers.general_completer import GeneralCompleter
from ycmd import identifier_utils
from ycmd import utils
from ycmd.utils import ToUtf8IfNeeded
from ycmd import responses
SYNTAX_FILENAME = 'YCM_PLACEHOLDER_FOR_SYNTAX'
class Id... | TonyRobotics/RoboWare-Studio | extensions/RichardHe.you-complete-me-1.0.36/ycmd/ycmd/completers/all/identifier_completer.py | identifier_completer.py | py | 7,399 | python | en | code | 234 | github-code | 1 | [
{
"api_name": "ycmd.completers.general_completer.GeneralCompleter",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "ycm_core.IdentifierCompleter",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 18,
"usage_type"... |
659214172 | import nltk
from nltk.corpus import wordnet
s=input('enter a negtive sentence : ')
#I am not happy
s=s.lower()
tmp=''
words=[]
for w in nltk.word_tokenize(s):
word=w
if tmp=='not':
antonyms=[]
for syn in wordnet.synsets(word):
for s in syn.lemmas():
for a in s.anton... | one-last-time/python | NLTk/sentenceNegetion.py | sentenceNegetion.py | py | 648 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "nltk.word_tokenize",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "nltk.corpus.wordnet.synsets",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "nltk.corpus.wordnet",
"line_number": 14,
"usage_type": "name"
}
] |
13271284726 | from __future__ import annotations
import logging
from pathlib import Path
from typing import TYPE_CHECKING
import pytest
from pyk.kcfg.show import KCFGShow
from pyk.proof import APRProof, APRProver, ProofStatus
from pyk.proof.show import APRProofNodePrinter
from pyk.testing import KCFGExploreTest, KProveTest
from p... | runtimeverification/pyk | src/tests/integration/proof/test_mini_kevm.py | test_mini_kevm.py | py | 3,364 | python | en | code | 12 | github-code | 1 | [
{
"api_name": "typing.TYPE_CHECKING",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "typing.Union",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "typing.Final",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "logging.getLogger",
... |
4052054857 | import xml.etree.ElementTree as ET
from subprocess import check_output
import logging
logger = logging.getLogger(__name__)
class AEMetric(object):
# command to run official eval.jar to get f1 score
commands = {
"rest": "./java -cp reviewlab/eval/A.jar absa16.Do Eval -prd data/ft/ae/16/rest/re... | FuyuTang-rinnki/AspectExtraction | a3/BERT-PT/reviewlab/metric.py | metric.py | py | 4,250 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "xml.etree.ElementTree.Element",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "xml.etree.ElementTree",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "... |
36299131948 | from . import DataProduct
class CTDAS(DataProduct):
"""
CTDAS CH4 data
"""
# List of all possible fields we expect from the data
# (original_name, standard_name, units)
field_list = (
('bio_flux_opt', 'CH4_natural_flux', 'Tg(CH4) year-1'),
('anth_flux_opt', 'CH4_fossil_flux', 'Tg(CH4) year-1'),
... | neishm/EC-CAS-diags | eccas_diags/interfaces/ctdas-ch4.py | ctdas-ch4.py | py | 5,818 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pygeode.formats.netcdf.open",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "pygeode.formats.netcdf",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "os.path.splitext",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "o... |
41094584105 | from sqlalchemy import Column, Integer, String, TIMESTAMP, LargeBinary
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
class Image(Base):
__tablename__ = 'image'
id = Column(Integer, primary_key=True)
filename = Column(String(255))
content_type = Column(String(50))
... | lavrinec/GOV-Crawler | crawler/src/image.py | image.py | py | 612 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sqlalchemy.ext.declarative.declarative_base",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Integer",
"line_number": 9,
"usage_type": "argument"
},
{
... |
33239264929 | # -*- coding: utf-8 -*-
from django.conf.urls import *
from django.conf import settings
urlpatterns = patterns('gibbon',
# url(r'^admin/', include(admin.site.urls)),
# url(r'^$', 'views.home'),
url(r'^$', 'views.hello'),
url(... | bung87/gibbon | gibbon/urls.py | urls.py | py | 582 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.conf.settings.DEBUG",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "django.conf.settings",
"line_number": 16,
"usage_type": "name"
}
] |
33371717840 | import re
import docutils.core
import docutils.io
import markdown
import textwrap
from rst2html5 import HTML5Writer
import wiki
#===============================================================================
# MARKUP BASE
#===============================================================================
class Marku... | mgaitan/waliki_flask | waliki/markup.py | markup.py | py | 6,530 | python | en | code | 17 | github-code | 1 | [
{
"api_name": "textwrap.dedent",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "markdown.Markdown",
"line_number": 81,
"usage_type": "call"
},
{
"api_name": "re.findall",
"line_number": 148,
"usage_type": "call"
},
{
"api_name": "wiki.urlify",
"line... |
24597026520 | # -*- coding: utf-8 -*-
"""
cron: 30 7 * * *
new Env('每日新闻');
"""
import requests, time, re, json, sys, traceback
from io import StringIO
from KDconfig import getYmlConfig, send
class News:
def __init__(self, cookie):
self.sio = StringIO()
self.Cookies = cookie
def SignIn(self):
print... | KD-happy/KDCheckin | News.py | News.py | py | 2,400 | python | en | code | 227 | github-code | 1 | [
{
"api_name": "io.StringIO",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "traceback.format_exc",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "KDconfig.getYmlConfig",... |
30800279598 | import discord
import logging
import asyncio
import settings as stg
import db_handler
from module_registry import get_default_registry
from unz_modules import UnzBaseModule, EventHandlerStatus
logging.basicConfig(
level=stg.LOG_LEVEL,
format=stg.LOG_FORMAT,
datefmt=stg.LOG_DATEFMT,
handlers=[
... | KiRtAp2/univerzal | main.py | main.py | py | 2,831 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "logging.basicConfig",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "settings.LOG_LEVEL",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "settings.LOG_FORMAT",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.