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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
18565015 | from collections import OrderedDict
import optimizers
import models
dataset = 'data/GKHMC_qla.pickle'
word2id_param_file = 'data/qla_params/word2id.pickle'
id2word_param_file = 'data/qla_params/id2word.pickle'
keys_param_file = 'data/qla_params/keys.pickle'
id2vec_param_file = 'data/qla_params/id2vec.pickle'
kb_param... | null | config.py | config.py | py | 2,097 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "collections.OrderedDict",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "models.Memory_Network",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "optimizers.rmsprop",
"line_number": 32,
"usage_type": "attribute"
}
] |
559970126 | #!/usr/bin/env python
#============================================================================
# Copyright (c) Microsoft Corporation. All rights reserved. See license.txt for license information.
#============================================================================
from __future__ import print_function
fro... | null | Providers/Scripts/3.x/Scripts/nxIPAddress.py | nxIPAddress.py | py | 30,731 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "imp.load_source",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "socket.AF_INET",
"line_number": 35,
"usage_type": "attribute"
},
{
"api_name": "socket.AF_INET6",
"line_number": 37,
"usage_type": "attribute"
},
{
"api_name": "socket.inet_... |
225947718 | import networkx as nx
import tempfile
import matplotlib.pyplot as plt
import subprocess
import argparse
class PCSF(object):
"""
"""
def __init__(self, network, prizes, terminals=None, root=None):
"""
:param network: The network file
:param prizes: The prize file
:param t... | null | PaPr/pcsf.py | pcsf.py | py | 6,529 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "networkx.Graph",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "tempfile.TemporaryFile",
"line_number": 94,
"usage_type": "call"
},
{
"api_name": "networkx.write_graphml",
"line_number": 105,
"usage_type": "call"
},
{
"api_name": "tempfil... |
285378830 | import networkx as nx
import matplotlib.pyplot as plt
import graphviz
from game_core import *
def recursive_play(player_output, cutter_flag=False):
'''
this one will check all legal moves in the recusive step
base case:
if the graph is a winner
return the winner
recursive step:
... | null | simulator.py | simulator.py | py | 7,008 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "networkx.has_bridges",
"line_number": 91,
"usage_type": "call"
},
{
"api_name": "networkx.Graph",
"line_number": 91,
"usage_type": "call"
},
{
"api_name": "networkx.bridges",
"line_number": 93,
"usage_type": "call"
},
{
"api_name": "networkx.Graph",... |
243366741 | """
MFE 230K - Factor Timing Project
Authors: Ms. Allocation
"""
# Imports
import numpy as np
import pandas as pd
import os
import matplotlib.pyplot as plt
import statsmodels.formula.api as sm
from arch import arch_model
from scipy.optimize import minimize, basinhopping
def makedir(folder, sub_folder=None):
"""... | null | functions.py | functions.py | py | 9,607 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.path.join",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "os.path.exists",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number":... |
245985534 | #Importing libraries
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import scipy.stats as ss
from dython.nominal import conditional_entropy, correlation_ratio, theils_u, cramers_v
import statsmodels.stats.multicomp as multi
#Jobs vs Housing
def jobs_housing(df):
jobs = df.job.u... | null | analysis.py | analysis.py | py | 4,161 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "matplotlib.pyplot.hist",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 38,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.hist",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "matpl... |
2994324 | # encoding=utf-8
# 读取数据
from gensim.models import Word2Vec
from gensim.models.word2vec import LineSentence
sentences = LineSentence('C:\\workspace\\BulletAnalysis\\Corpus\\BosonNLP\\all.txt')
model = Word2Vec(sentences, min_count=1, size=20)
good_words = [line.strip().decode('utf-8') for line in
open(... | null | ML-solution/SVM.py | SVM.py | py | 1,135 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "gensim.models.word2vec.LineSentence",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "gensim.models.Word2Vec",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sklearn.svm.SVC",
"line_number": 35,
"usage_type": "call"
},
{
"api_name... |
212537677 | # -*- coding: utf-8 -*-
# @Time : 2019/7/31
# @Author : Lattine
# ======================
import os
import json
import argparse
import tensorflow as tf
from config import TextCNNConfig
from data_helper import TrainData
from data_helper import TestData
from metrics import get_binary_metrics, get_multi_metrics, li... | null | N02_TextCNN/train/trainer.py | trainer.py | py | 5,153 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "model.TextCNN",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "data_helper.TrainData",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "data_helper.TestData",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "tensorflow.G... |
117060174 | import logging
from datetime import datetime
# from multiprocessing import Pool
from models import *
from db import get_session, get_db
from flask import current_app, g
import numpy as np
import time
import ujson
import re
query_logger = logging.getLogger(__name__)
class Query():
def __init__(self, query):
... | null | db_api/query.py | query.py | py | 13,155 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "db.get_session",
"line_number": 69,
"usage_type": "call"
},
{
"api_name": "db.get_session",
"line_number": 83,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
... |
362654134 | #!/usr/bin/python
import csv
import pg
import time
import sys
import math
import numpy as np
# PRIMO INPUT: H elica o E foglietto
dbname = 'pdb165'
user = 'digiovannantonio165'
passwd = 'db_prto45'
hostname = 'localhost'
def secondaryStructure(csvfilename,db):
try:
f = open(csvfilename, 'wt')
csv_writer = ... | null | 04_analisi_spike.py | 04_analisi_spike.py | py | 2,953 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "csv.writer",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "csv.QUOTE_MINIMAL",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "time.time",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_numb... |
27352993 | import utils
import logging
from pylons.i18n import gettext as _
from ckan.logic.action.create import related_create
from ckan.model import Related, Session, Group, repo
from ckan.lib.navl.validators import not_empty
log = logging.getLogger('ckanext.kata.converters')
def pid_from_extras(key, data, errors, context):... | null | ckanext/kata/converters.py | converters.py | py | 11,725 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "utils.generate_pid",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "pylons.i18n.gettext",
"line_number": 101,
"usage_type": "call"
},
{
"api_name": "pylons.i18n.... |
35784651 | import graphene
from ..domain.invoice import Invoice
class InvoiceMeta(graphene.ObjectType):
id = graphene.Int()
date = graphene.String()
patient_id = graphene.Int()
name = graphene.String()
identifier = graphene.String()
text = graphene.String()
class InvoicesMeta(graphene.ObjectType):
... | null | app/modules/sub_graphql/invoice_graphql.py | invoice_graphql.py | py | 1,093 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "graphene.ObjectType",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "graphene.Int",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "graphene.String",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "graphene.Int",
... |
387307624 | # Copyright (c) Microsoft. All rights reserved.
# Licensed under the MIT license. See LICENSE file in the project root for
# full license information.
import time
from datetime import datetime
import sys
import os
from os import listdir
from os.path import isfile, join, isdir
import requests
import json
import io
from... | null | modules/master/main.py | main.py | py | 15,091 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "threading.Lock",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "iothub_client.IoTHubTransportProvider.MQTT",
"line_number": 63,
"usage_type": "attribute"
},
{
"api_name": "iothub_client.IoTHubTransportProvider",
"line_number": 63,
"usage_type": "... |
15988275 | """djantAdmin URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.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-ba... | null | djantAdmin/urls.py | urls.py | py | 1,128 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "rest_framework.routers.SimpleRouter",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "menuAuth.views.Menu",
"line_number": 23,
"usage_type": "argument"
},
{
"api_name": "menuAuth.views.User",
"line_number": 24,
"usage_type": "argument"
},
{
... |
519787778 | import sys
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from datetime import datetime
import json
app = Flask(__name__)
app.debug = True
app.config['SQLALCHEMY_DATABASE_URI'] = 'postgresql://postgres:password@localhost/test1'
db = SQLAlchemy(app)
# представим, что это данные, которые получили из таб... | null | myapp.py | myapp.py | py | 2,464 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "flask.Flask",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "flask_sqlalchemy.SQLAlchemy",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.n... |
169402347 | from pathlib import Path
import sys
from typing import Generator, List, Optional, cast
from ymmsl import Conduit, Reference
import muscle_manager_protocol.muscle_manager_protocol_pb2 as mmp
def conduit_to_grpc(conduit: Conduit) -> mmp.Conduit:
"""Converts a ymmsl.Conduit to the corresponding mmp.Conduit.
A... | null | libmuscle/python/libmuscle/util.py | util.py | py | 3,540 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "ymmsl.Conduit",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "muscle_manager_protocol.muscle_manager_protocol_pb2.Conduit",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "muscle_manager_protocol.muscle_manager_protocol_pb2",
"line_number"... |
140182649 | import requests
from bs4 import BeautifulSoup
url = "http://music.163.com/#/discover/toplist?id=3778678"
def get_hot_songs():
response = requests.get(url=url)
# print(response)
# print(type(response))
# print(response.url)
# print(response.headers) # 打印头部
# print(response.cookies)
# prin... | null | modules-163music/getHotSongs.py | getHotSongs.py | py | 799 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "requests.get",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 19,
"usage_type": "call"
}
] |
187668474 | # -*- coding: utf-8 -*-
'''
Created on 2016-06-24
@summary: Analyse Calling Graph
@author: YangHaitao
'''
import sys
import os
import getopt
import logging
import datetime
import time
import shutil
from config import CONFIG
from utils.finder import Finder
from utils import common_utils
from utils.index_whoosh import ... | null | app/Build.py | Build.py | py | 2,869 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "logger.config_logging",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "config.CONF... |
238730919 | import plexus
import time
from itertools import repeat
import random
import matplotlib.pyplot as plt
SIZE = 64
INPUT_SIZE = 4
OUTPUT_SIZE = 2
CONNECTIVITY = 0.5
PRECISION = 1
TRAINING_DURATION = 0.1
DOMINANCE_THRESHOLD = 0.7
RANDOMLY_FIRE = True
DYNAMIC_OUTPUT = True
TRAINING_SAMPLE_SIZE = 80
TESTING_SAMPLE_SIZE = ... | null | examples/long_basic.py | long_basic.py | py | 3,515 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "itertools.repeat",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "random.uniform",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "itertools.repeat",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "random.uniform",
... |
612296449 | import os
import re
import math
import argparse
import subprocess
import numpy as np
from pytube import YouTube
from scipy.io import wavfile
from audiotsm import phasevocoder
from shutil import copyfile, rmtree
from audiotsm.io.wav import WavReader, WavWriter
def downloadFile(save_dir, url):
correct_filename = Fa... | null | jumpcutter.py | jumpcutter.py | py | 9,908 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pytube.YouTube",
"line_number": 17,
"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.path.isfile",
"line_n... |
542279166 | import datetime
from django.contrib import admin
from django.utils.translation import ugettext_lazy as _
from graphql_extensions.exceptions import GraphQLError
from iamport import Iamport
from api.models.profile import Profile
from ticket.models import Ticket, TicketProduct
from ticket.schemas import create_iamport
... | null | ticket/admin.py | admin.py | py | 2,695 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.contrib.admin.ModelAdmin",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "django.utils.translation.ugettext_lazy",
"line_number": 20,
"usage_type": "name... |
132221647 | from utils import ti
import taichi_glsl as ts
import sys
import math
import os
import config.euler_config
from config.class_cfg import SceneEnum, VisualizeEnum, SchemeType, SimulateType
import config.config3D.scene_config3D.scene_jit3D as scene_cfg
from utils import set_attribute_from_cfg, filterUpCase
from Grid import... | null | config/config3D/Bimocq_vrtx_cld.py | Bimocq_vrtx_cld.py | py | 3,511 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "utils.set_attribute_from_cfg",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "config.euler_config.euler_config",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "config.euler_config",
"line_number": 13,
"usage_type": "name"
},
{... |
476084037 | """eva03 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 v... | null | eva03/urls.py | urls.py | py | 3,441 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.db.router",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "rest_framework.routers.DefaultRouter",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "rest_framework.routers",
"line_number": 26,
"usage_type": "name"
},
{
"api_... |
317209221 | import discord
from discord.ext import commands
from discord.utils import get
from config import guild_id
class MemberSorter(commands.Cog):
def __init__(self, bot):
self.bot = bot
self.guild = bot.get_guild(guild_id)
@commands.Cog.listener()
async def on_member_join(self, member):
... | null | bot/cogs/MemberSorter.py | MemberSorter.py | py | 2,511 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "discord.ext.commands.Cog",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "discord.ext.commands",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "config.guild_id",
"line_number": 10,
"usage_type": "argument"
},
{
"api_name": "... |
294084616 |
# coding: utf-8
# In[20]:
import csv
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
data=pd.read_csv('F:\\project\\Data set\\ReposData.csv',encoding='latin-1')
data['Created_at']
#print(data)
#date=data.iloc[:,2]
#print(date)
data['Created_at']=pd.to_datetime(data['Created_at'])#,format='... | null | ReposVisualization.py.py | ReposVisualization.py.py | py | 3,174 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pandas.read_csv",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pandas.to_datetime",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pandas.to_datetime",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "matplotlib.pypl... |
550662590 | import traceback
from flask import render_template, redirect, url_for, request, jsonify
import datetime
from .exceptions import NotFoundException, AuthException, LoginError
from .page_data import PageData
from .config import LOG_FILE
def handle_exception_browser(e):
print('handle_exception_browser')
if isin... | null | cromwell_frontend/util.py | util.py | py | 2,261 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "exceptions.NotFoundException",
"line_number": 13,
"usage_type": "argument"
},
{
"api_name": "flask.render_template",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "page_data.PageData",
"line_number": 17,
"usage_type": "call"
},
{
"api_nam... |
296845808 | # TechVidvan hand Gesture Recognizer
# import necessary packages
import cv2
import numpy as np
import mediapipe as mp
import tensorflow as tf
import math
from tensorflow.keras.models import load_model
import os
# also "pip install wrapt==1.12.1" ref by tensorflow
# also "pip install msvc-runtime" referenced by mp
# ... | null | hand_joint_detection.py | hand_joint_detection.py | py | 5,693 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "mediapipe.solutions",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "mediapipe.solutions",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.keras.models.load_model",
"line_number": 25,
"usage_type": "call"
},
{
... |
615864146 | # numeric integration illustration
# Runge Kutta integration lorenz attractor
# Yes, it attracts!
import pygame, time
from pygame.locals import *
from pygame.color import *
from numpy import *
pygame.init()
screen = pygame.display.set_mode((800,600))
background = pygame.Surface(screen.get_size())
background.fill((128... | null | lectures/physics/pythondemos/strange02.py | strange02.py | py | 1,622 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pygame.init",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "pygame.Surfac... |
265694065 | from django.contrib.auth.decorators import login_required
from django.shortcuts import render
from django.contrib.auth.models import User, auth
from .models import Project
# Create your views here.
def projects_home(request):
context = {}
projects = Project.objects.all()
context['projects'] = projects
... | null | projects/views.py | views.py | py | 1,146 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "models.Project.objects.all",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "models.Project.objects",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "models.Project",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": ... |
86236762 | import os
import numpy as np
import pytest
from xclim.sdba.loess import (
_constant_regression,
_gaussian_weighting,
_linear_regression,
_loess_nb,
_tricube_weighting,
loess_smoothing,
)
from xclim.testing import open_dataset
@pytest.mark.slow
@pytest.mark.parametrize(
"d,f,w,n,exp",
... | null | xclim/testing/tests/test_sdba/test_loess.py | test_loess.py | py | 1,389 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "xclim.sdba.loess._constant_regression",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "xclim.sdba.loess._linear_regression",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "numpy.linspace",
"line_number": 30,
"usage_type": "call"
},
... |
117140568 | import numpy as np
import flask
from flask import request, jsonify
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LinearRegression
def cube_root(n):
"""Find the cube root of a number
"""
return n ** (1./3.)
def find_l_a_b(x, y, z, X_n, Y_n, Z_n):
"""Calculates ... | null | server.py | server.py | py | 3,176 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.array",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "sklearn.linear_model.LinearRegression",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "numpy.a... |
600861458 | import collections
import bpy
import os
import base64
from .Accessor import Accessor
class Buffer:
ARRAY_BUFFER = 34962
ELEMENT_ARRAY_BUFFER = 34963
BYTE = 5120
UNSIGNED_BYTE = 5121
SHORT = 5122
UNSIGNED_SHORT = 5123
INT = 5124
UNSIGNED_INT = 5125
FLOAT = 5126
MAT4 = 'MAT4'
... | null | types/Buffer.py | Buffer.py | py | 4,104 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "collections.OrderedDict",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "base64.b64encode",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "bpy.path.clean_name",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "bpy.path... |
229748546 | # -*-coding=utf-8 -*
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.gridspec as mpl_grid
import CallistoFITS.CallistoMaths as cm
import datetime
class CallistoGraphs:
""" Static class provides a lot of methods to plot Callisto data"""
def _createDate(cali):
"... | null | CallistoGraphs.py | CallistoGraphs.py | py | 7,801 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "datetime.datetime",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "datetime.timedelta",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
... |
87555860 | '''
Created on Jun 25, 2014
@author: pdono_000
'''
from bs4 import BeautifulSoup
import urllib2
from HTMLParser import HTMLParser
#site = 'http://www.4-traders.com/stock-exchange/shares/North-America-8/?Req=&p=2/'
#page = urllib2.urlopen('http://www.4-traders.com/stock-exchange/shares/North-America-8/').read()
page =... | null | GetURLs4T/src/GetURLsMain.py | GetURLsMain.py | py | 1,021 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "urllib2.urlopen",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 13,
"usage_type": "call"
}
] |
542043343 | # -*- coding: UTF-8 -*-
import torch as t
from PIL import Image
import torchvision as tv
import torchvision.transforms as transforms
from torchvision.transforms import ToPILImage
import torch.nn as nn
import torch.nn.functional as F
from ga import GaNet, GsNet
import os
device = t.device("cuda:0" if t.cuda.is_available... | null | load_net.py | load_net.py | py | 2,223 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "torch.device",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "torch.cuda.is_available",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "torchvision.tran... |
181422617 | """
Unit tests for fileio.py
"""
import pytest
from abcvoting import fileio
import os
@pytest.mark.parametrize(
"filename", ["test1.toi", "test2.soi", "test3.toc"]
)
def test_readfile(filename):
currdir = os.path.dirname(os.path.abspath(__file__))
profile = fileio.read_preflib_file(
currdir + "/d... | null | tests/test_fileio.py | test_fileio.py | py | 2,331 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.path.dirname",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "abcvoting.fileio.read_pr... |
518659073 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import ROOT
from enum import Enum
import json
import re
import EgammaUser.EgammaDAS2020.MathTools as MathTools
class PartStatus(Enum):
INITIAL = 1
PREFSR = 2
FINAL = 3
def genpart_to_str(genpart... | null | python/GenTools.py | GenTools.py | py | 5,421 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "enum.Enum",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "EgammaUser.EgammaDAS2020.MathTools.cal_delta_r2",
"line_number": 105,
"usage_type": "call"
},
{
"api_name": "EgammaUser.EgammaDAS2020.MathTools",
"line_number": 105,
"usage_type": "name"
... |
285366754 | import logging
from datetime import timedelta
from dateutil import parser
from django.contrib.auth.mixins import LoginRequiredMixin
from django.db import transaction
from django.http import HttpResponseRedirect
from django.shortcuts import get_object_or_404
from django.utils import timezone
from django.views.generic.ed... | null | zentral/contrib/munki/views.py | views.py | py | 6,545 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.mixins.LoginRequiredMixin",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "zentral.utils.api_views.BaseEnrollmentView",
"line_number": 21,
"usage_ty... |
136886749 | import pygame
pygame.init()
display = pygame.display.set_mode((400, 300))
pygame.display.update()
pygame.display.set_caption('Snek')
game_over = False
while not game_over:
for event in pygame.event.get():
if event.type == pygame.QUIT:
game_over = True
pygame.quit()
quit()
| null | Step 1 - Screen.py | Step 1 - Screen.py | py | 301 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pygame.init",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "pygame.display.u... |
415500078 | import torch
import torch.nn as nn
import torch.optim as optim
import torchvision.transforms as transforms
import time
import random
import os
import numpy as np
import torch
import configure as c
import pandas as pd
from DB_wav_reader import read_feats_structure
from SR_Dataset import read_MFB, TruncatedInputfromMFB,... | null | train_contrastive_loss.py | train_contrastive_loss.py | py | 8,512 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "torch.utils",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "random.sample",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "torch.Tensor",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "torch.cat",
"line_num... |
254177648 | import numpy as np
from lib.eigendecomp import get_inverse, get_dot_product, get_euclidean_norm, get_matrix_from_eigdec
def main():
print("---------- Define the input matrix.")
A = .25 * np.array([[7, -np.sqrt(3)], [-np.sqrt(3), 5]])
print(f"input matrix:\n{A}\n")
print("---------- Do the ... | null | ex01/run_eigen.py | run_eigen.py | py | 1,839 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.array",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.sqrt",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.linalg.eig",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.linalg",
"line_number... |
308597051 | from octras import Evaluator, Loop
from octras.matsim import MATSimSimulator
from octras.tracker import PickleTracker
from octras.algorithms import RandomWalk, CMAES, BatchBayesianOptimization
from toy_example_problem import ToyExampleProblem
import logging
logging.basicConfig(level = logging.INFO)
output_path = "o... | null | example/toy_example.py | toy_example.py | py | 1,241 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.basicConfig",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "octras.matsim.MATSimSimulator",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "t... |
339756955 | ##############################################################################
#
# Mahnoor Anjum
# manomaq@gmail.com
#
# References:
# SuperDataScience,
# Official Documentation
#
#
##############################################################################
# Importing the libraries
import... | null | U2-kmeans.py | U2-kmeans.py | py | 2,435 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pandas.read_csv",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.scatter",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "matplotli... |
265715470 | #!/usr/bin/python
#=========================================================================#
# Author : Ankit Vashistha #
# Script : USAVolcanoesMap.py #
# Py Versions : 3.5 ... | null | USAVolcanoesMap.py | USAVolcanoesMap.py | py | 1,827 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pandas.read_csv",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "folium.Map",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "folium.FeatureGroup",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "folium.CircleMarker",
... |
253288742 | # Section12-3
# 파이썬 데이터베이스 연동(SQLite)
# 테이블 데이터 수정 및 삭제
import sqlite3
# DB 생성(파일)
conn = sqlite3.connect('/Users/hyun/Desktop/FastCampus/python_basic/resource/database.db')
# Cursor 연결
c = conn.cursor()
# 데이터 수정 1
#c.execute("UPDATE users SET username = ? WHERE id = ?", ('niceman', 2))
#conn.commit() # 커밋 해줘야 반영됨... | null | section12-3.py | section12-3.py | py | 1,291 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sqlite3.connect",
"line_number": 8,
"usage_type": "call"
}
] |
193694954 | # http://stackoverflow.com/questions/1185634/how-to-solve-the-mastermind-guessing-game
from collections import deque
from collections import namedtuple
from collections import Counter
import itertools
import os
import sys
Pegs = namedtuple('Pegs', 'black, white')
combination = namedtuple("Combination", "colors, pegs"... | null | mm-solver.py | mm-solver.py | py | 3,089 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "collections.namedtuple",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "collections.namedtuple",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.system",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "collections.d... |
317993055 | import argparse
import logging
import sqlite3
import time
import datetime
import googlemaps
from commute.database import Database
from commute.model import Measurement
def measure(logger, database, api_key, force=False):
if force:
routes = database.get_all_routes()
else:
routes = database.get... | null | commute/measure.py | measure.py | py | 3,645 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "googlemaps.Client",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 51,
"usage_type": "attribute"
},
{
"api_name": "commut... |
231427628 | import torch
import torch
from torch import nn
from torch.nn import functional as F
from torch import tensor
import pyro
from pyro import distributions as dist
import numpy as np
from pyro.infer import mcmc
import deepppl
import os
import pandas as pd
import time
import pystan
from sklearn.datasets import make_blobs
f... | null | deepppl/tests/inference/test_kmeans.py | test_kmeans.py | py | 3,977 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pyro.infer.mcmc.NUTS",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "pyro.infer.mcmc",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "pyro.infer.mcmc.MCMC",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "pyro.infer.... |
622259529 | #
# Copyright 2011 Greg Bayer <greg@gbayer.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | null | livecount/counter.py | counter.py | py | 7,663 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "google.appengine.ext.db.Model",
"line_number": 34,
"usage_type": "attribute"
},
{
"api_name": "google.appengine.ext.db",
"line_number": 34,
"usage_type": "name"
},
{
"api_name": "google.appengine.ext.db.IntegerProperty",
"line_number": 35,
"usage_type": "ca... |
584717741 | #!/usr/bin/python3
from requests import get
from bs4 import BeautifulSoup
import re
import smtplib
from email.mime.text import MIMEText
url = 'some URL'
response = get(url)
wholemessage=""
html_soup = BeautifulSoup(response.text, 'html.parser')
type(html_soup)
titles = html_soup.find_all('a', title = re.compile("V... | null | webScrape.py | webScrape.py | py | 1,032 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "requests.get",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number":... |
69125686 | import pygame
class Ship():
# screen is where the ship will be drawn.
# Start each new ship at the bottom center of the screen.
# center of screen: center,centerx,centery
def __init__(self,screen):
"""Initialize the ship and set its starting position."""
self.screen=screen
# Lo... | null | alien invasion/ship.py | ship.py | py | 1,011 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pygame.image.load",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pygame.image",
"line_number": 12,
"usage_type": "attribute"
}
] |
328694948 | import os
import tensorflow as tf
import argparse
import numpy as np
import cv2
import tensorflow.contrib.layers as layers
from tensorflow.contrib.framework import arg_scope
import models.resnet.resnet_utils as resnet_utils
import eval_helper
import losses
import datasets.reader as reader
#import datasets.flip_reade... | null | OLD/models/resnet/ladder_old.py | ladder_old.py | py | 16,014 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "tensorflow.app",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.contrib.layers.variance_scaling_initializer",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "tensorflow.contrib.layers",
"line_number": 27,
"usage_type": "... |
445422913 | import glob
import io
import os
import secrets
import shutil
import json
from fastai.vision import Learner, ClassificationInterpretation
import utils as utils
import model_service as ms
def get_path() -> str :
return os.getcwd() + '/turmas/'
def new_filename(turma: str, extension : str) -> str :
filename ... | null | servidor/turma_service.py | turma_service.py | py | 7,758 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.getcwd",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "secrets.token_hex",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "secrets.token_hex",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.walk",
"line_num... |
151385447 | ### This module contains basic preprocessing functions for processing the unity VR log file
import pandas as pd
import numpy as np
from dataclasses import dataclass, asdict
from os import mkdir, makedirs
from os.path import sep, isfile, exists
import json
#dataframe column defs
objDfCols = ['name','collider','px','py... | null | unityvr/preproc/logproc.py | logproc.py | py | 11,423 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pandas.DataFrame",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "pandas.DataFrame",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "pandas.DataFrame",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "pan... |
161824698 | # -*- coding: utf-8 -*-
"""Verify local cluster."""
import sys
from dask.distributed import Client
def verify(master_ip):
"""Verify cluster."""
try:
Client("{}".format(master_ip))
except Exception:
raise ValueError("Client can't running")
if __name__ == "__main__":
verify(sys.argv[1]... | null | built-in/TensorFlow/Official/cv/image_classification/ResnetVariant_for_TensorFlow/automl/deploy/verify_local_cluster.py | verify_local_cluster.py | py | 322 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "dask.distributed.Client",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 16,
"usage_type": "attribute"
}
] |
219193275 | import smtplib
import re
import cookielib
import mechanize#
from BeautifulSoup import BeautifulSoup
import time
from datetime import date, datetime
saved_search_url = 'https://www.linkedin.com/vsearch/j?distance=50&countryCode=us&postalCode=94401&sortBy=DD&trk=vsrp_jobs_pivotbar_ssdviewall'
def sendemail(str1,str2=Non... | null | linkedinChecker.py | linkedinChecker.py | py | 3,873 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "smtplib.SMTP",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "re.findall",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "time.strptime",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "time.strptime",
"line_numbe... |
277523699 | # Created by Egor Kostan.
# GitHub: https://github.com/ikostan
# LinkedIn: https://www.linkedin.com/in/egor-kostan/
import allure
import unittest
import pytest
from tests.config import Config
from utils.get_args_from_cli import get_args
from utils.register_user import register_user
from utils.clean_database import... | null | tests/e2e_tests/login_logout/positive/user_login_from_about_us_page_test.py | user_login_from_about_us_page_test.py | py | 5,699 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "unittest.TestCase",
"line_number": 34,
"usage_type": "attribute"
},
{
"api_name": "expected_results.users.base_user.BaseUser",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "expected_results.users.valid_users_templates.jane_doe.JaneDoe",
"line_number... |
60085252 | """Test the Shift forms"""
from django.contrib.sessions.middleware import SessionMiddleware
from django.urls import reverse
from django.utils import timezone
from test_plus.test import RequestFactory, TestCase
from clock.shifts.forms import ShiftForm
from clock.shifts.models import Shift
class ShiftFormTest(TestCase... | null | clock/shifts/tests/test_forms.py | test_forms.py | py | 4,464 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "test_plus.test.TestCase",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "test_plus.test.RequestFactory",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "django.contrib.sessions.middleware.SessionMiddleware",
"line_number": 22,
"usage_ty... |
552006777 | # {
# "index":0,
# "timestamp":"",
# "transactions":[
# {
# "sender":"",
# "recipient":"",
# "amount":5
# }
# ],
# "proof":"",
# "previus_hash":"",
# }
#
# chain:链结构信息,数组
# current_transactions :当前的交易信息
# new_block方法:新的快
# new_transactions方法:新的交易
# hash静态方法:计算区块的hash
# last_block方法:当前区块中最后一个块
# sende... | null | blockchain.py | blockchain.py | py | 6,589 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "urllib.parse.urlparse",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 81,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 99,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_n... |
299097647 | from flask import Flask, request, jsonify
from flask_restful import abort
import json
def get(app):
with open('data.json', 'r') as f:
data = json.load(f)
if not data:
abort(400, message="Could not find any data.")
return data
def post(app):
data = request.get_json()
... | null | pythonReactProject/composetest/api/api.py | api.py | py | 505 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "json.load",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "flask_restful.abort",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "flask.request.get_json",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "flask.request",
... |
650334878 | import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
theta1_1,omega1_1,theta2_1,omega2_1 = np.genfromtxt("data/ersten.txt",unpack=True)
theta1_2,omega1_2,theta2_2,omega2_2 = np.genfromtxt("data/quasi.txt",unpack=True)
theta1_3,omega1_3,theta2_3,omega2_3 = np.genfromtxt("data/chaos.txt",unpack=True)
... | null | Lars/Blatt8/Aufgabe2/plot.py | plot.py | py | 5,202 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.genfromtxt",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "numpy.genfromtxt",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.genfromtxt",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.cos",
"line... |
70565698 | # -*- coding: utf-8 -*-
"""
Created on Sun Fir 23 19:50:38 2021
@author: JIA HB
"""
import numpy as np
import scipy.io.wavfile
import matplotlib.pylab as plt
sample_rate, signal = scipy.io.wavfile.read("C:\\Users\\12610\\Downloads\\Music\\OSR_us_000_0010_8k.wav")
signal = signal[0: int(3.5*sample_rate)]
#3.5秒... | null | MFCC.py | MFCC.py | py | 2,379 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "scipy.io.wavfile.io.wavfile.read",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "scipy.io.wavfile.io",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "scipy.io.wavfile",
"line_number": 9,
"usage_type": "name"
},
{
"api_name"... |
615381906 | from multiprocessing.dummy import Pool as ThreadPool
import numpy as np
from sklearn.cluster import DBSCAN
from sklearn import metrics
from ldms import *
import ldms_transform as lt
from PhaseDetection import *
from PhaseDetectionPlot import *
class PDExperiment(object):
"""A customer of ABC Bank with a check... | null | PhaseDetectionExperiments.py | PhaseDetectionExperiments.py | py | 31,441 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sklearn.metrics",
"line_number": 171,
"usage_type": "name"
},
{
"api_name": "ldms_transform.create_transform_event",
"line_number": 176,
"usage_type": "call"
},
{
"api_name": "sklearn.metrics",
"line_number": 206,
"usage_type": "name"
},
{
"api_name... |
219854563 | # Copyright 2021 Hathor Labs
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | null | hathor/transaction/resources/mempool.py | mempool.py | py | 3,909 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "hathor.conf.HathorSettings",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "typing.TYPE_CHECKING",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "twisted.web.resource.Resource",
"line_number": 34,
"usage_type": "attribute"
},
{
... |
630140648 | import os
import io
import time
import re
import tempfile
from PIL import Image
import argparse
from adb_shell.adb_device import AdbDeviceTcp
from adb_shell.auth.sign_pythonrsa import PythonRSASigner
from constants import *
# useful terminal commands:
# connect to phone via usb:
## adb start-server
# list connec... | null | adb_connector.py | adb_connector.py | py | 11,915 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "time.time",
"line_number": 111,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 125,
"usage_type": "call"
},
{
"api_name": "adb_shell.adb_device.AdbDeviceTcp",
"line_number": 136,
"usage_type": "call"
},
{
"api_name": "os.path.expa... |
184076430 | import sys
import logging
from homeassistant.helpers import device_registry as dr
from .const import *
_LOGGER = logging.getLogger(__name__)
class DeviceManager:
def __init__(self, hass, ha):
self._hass = hass
self._ha = ha
self._devices = {}
self._data_manager = self._ha.data_... | null | custom_components/edgeos/device_manager.py | device_manager.py | py | 2,470 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "homeassistant.helpers.device_registry.async_get_registry",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "homeassistant.helpers.device_registry",
"line_number": 20,
"usa... |
277679039 | import os, json
def ParseConfigFile(path):
with open(path, "r") as cfgFile:
config = json.loads(cfgFile.read())
cfgFile.close()
watch = config['watch']
exclude = config['exclude']
execute = config['execute']
if exclude is None or watch is None:
... | null | helper.py | helper.py | py | 454 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "json.loads",
"line_number": 5,
"usage_type": "call"
}
] |
89330650 | #!/usr/bin/env python3
"""Script to remove circular references
Example:
$ python3 oas_noloop.py input.yaml output.yaml
"""
import argparse
from pathlib import Path
import logging
import yaml
def create_parser():
"""Create the argument parse
Returns:
[Parser]: Returns a argument parser
"""
t... | null | scripts/oas-noloop.py | oas-noloop.py | py | 2,419 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "pathlib.Path",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "pathlib.Path",
... |
38690483 | import jsonpatch
def make_sender(uid, label):
# Up to date with apiary mock server: 16/11/2017
type = "multicast"
status = True
codec = "Calrec-32" # Test variable
packetTime = 125 # Test variable
sampleRate =... | null | lightsOut/constructJSON.py | constructJSON.py | py | 3,320 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "jsonpatch.JsonPatch",
"line_number": 102,
"usage_type": "call"
},
{
"api_name": "jsonpatch.JsonPatch",
"line_number": 117,
"usage_type": "call"
}
] |
379782021 | from itertools import product
from math import log
import find_max_path.FindMaxPath_DPBacktrack
from graph import DirectedGraph
from helpers.Utils import slide_window
with open('/home/user/Downloads/dataset_240400_7.txt') as f:
lines = f.read().splitlines(keepends=False)
emitted_symbols = lines[0]
symbols = set(l... | null | docs/data/learn/Bioinformatics/input/ch10_code/src/Stepik.10.6.CodeChallenge.ViterbiAlgorithm.py | Stepik.10.6.CodeChallenge.ViterbiAlgorithm.py | py | 3,703 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "itertools.product",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "itertools.product",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "graph.DirectedGraph.Graph",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "graph.D... |
562477608 | import torch
from torchnlp.encoders.text import DelimiterEncoder
import numpy as np
from rdkit import Chem
from ..utils import parse_smiles
def atom_to_string(atom: Chem.Atom) -> str:
return '{}|{}|{}|{}|{}|{}|{}|{}|{}|{}|{}|{}|{}|{}'.format(
atom.GetChiralTag(),
atom.GetDegree(),
atom.G... | null | graphchem/preprocessing/features.py | features.py | py | 3,086 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "rdkit.Chem.Atom",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "rdkit.Chem",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "rdkit.Chem.Bond",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "rdkit.Chem",
"... |
52845488 | import random
from typing import List
import matplotlib.lines as mlines
import matplotlib.pyplot as plt
import numpy as np
from sympy import Point
def cluster(x, y, deviation=10, n=100):
source = [x, y]
points = []
for _ in range(n):
newCoords = [source[i] + random.random() * deviation for i in ... | null | polyhedra/utils.py | utils.py | py | 2,230 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "random.random",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "numpy.append",
"line_number... |
579093684 | import os
from os import listdir
from os.path import join
from typing import Dict, Union, List
from overrides import overrides
from allennlp.common.file_utils import cached_path
from allennlp.data.dataset_readers.dataset_reader import DatasetReader
from allennlp.data.fields import LabelF... | null | library/dataset_readers/THUCNews_HAN.py | THUCNews_HAN.py | py | 2,349 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "allennlp.data.dataset_readers.dataset_reader.DatasetReader",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "allennlp.data.tokenizers.Tokenizer",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "typing.Dict",
"line_number": 25,
"usage_typ... |
121443849 | '''
Library Import
'''
# for filepath, fileopen, system
import os
import sys
from platform import system
# for excel
import numpy as np
import pandas as pd
# for docx
from docx import Document
'''
Resource Path: Mac vs Windows; Absolute vs. Relative
'''
_IS_MAC = system() == 'Darwin'
def resource_path(relati... | null | NameCard/ncUtils.py | ncUtils.py | py | 3,420 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "platform.system",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"l... |
267806745 | from fpdf import FPDF, HTMLMixin
from PydoNovosoft.utils import Utils
class HTML2PDF(FPDF, HTMLMixin):
def set_data(self, route=None, vehicle=None, start_date=None, tolerancia=1,total_pages=1):
self._route = route
self._vehicle = vehicle
self._start_date = start_date
self._tolera... | null | classes/pdfreport.py | pdfreport.py | py | 2,027 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "fpdf.FPDF",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "fpdf.HTMLMixin",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "PydoNovosoft.utils.Utils.format_date",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "PydoNovos... |
102017847 | import torch
def channelShuffle(input, groups=16):
M, C, H, W = input.data.size()
channels_per_group = C//groups
input = input.view(M, groups, channels_per_group, H, W)
print(input.size())
#- contiguous() required if transpose() is used before view().
input = torch.transpose(input,1,2).conti... | null | blocks/channelshuffle.py | channelshuffle.py | py | 481 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "torch.transpose",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "torch.randn",
"line_number": 19,
"usage_type": "call"
}
] |
649766584 | from typing import Tuple
from exercices.visualize import show_samples
import numpy as np
def random_sample(category: int) -> Tuple[np.ndarray, int]:
return (np.random.rand(28, 28, 1), category)
# select random images of each monkey category
'''
- iterate over train folder (n0,n1,n2,...)
- for each folder take... | null | mktd-keras-miniproject/project/visualize.py | visualize.py | py | 532 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.random.rand",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "typing.Tuple",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "numpy.ndarray",
"li... |
26623230 | # -*- coding: utf-8 -*-
"""
Created on Sun May 14 10:51:03 2017
@author: JasonJe
"""
import numpy as np
import pandas as pd
from sklearn.naive_bayes import MultinomialNB
filename = 'data.txt'
dataSet = pd.read_csv(filename, sep = '\t', index_col = '编号')
#哑变量处理
featureDict = []
new_dataSet = pd.DataFrame()
for i in ... | null | naive_Bayes/naiveBayes_sk.py | naiveBayes_sk.py | py | 1,092 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pandas.read_csv",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pandas.concat",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "sklearn.naive_bayes.Mu... |
229171587 | import pandas as pd
import numpy as np
from itertools import combinations
from scipy import sparse
import matplotlib.pyplot as plt
from sklearn.metrics import accuracy_score
from sklearn.model_selection import train_test_split
from sklearn.model_selection import GridSearchCV
from sklearn.metrics import classifi... | null | Learner&baseline/SVM_wtFSSS_v2.py | SVM_wtFSSS_v2.py | py | 4,749 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "scipy.sparse.load_npz",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "scipy.sparse",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "pandas.read_csv",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
... |
348824451 | '''
name of dataset and description of its contents
hyperlink to where raw data is hosted
brief summary of your import mechanism
movies scraped from wikipedia
https://raw.githubusercontent.com/prust/wikipedia-movie-data/master/movies.json
import mechanism
this is done with code that is garunteed to run a... | null | 11_mongoflask/moviemango.py | moviemango.py | py | 5,310 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pymongo.MongoClient",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 42,
"usage_type": "call"
}
] |
216046094 | import nltk, re, pprint, operator, sys, os, fnmatch, fileinput
from nltk import word_tokenize
from timeit import default_timer as timer
## fileToParse = open('RST_EDUs.txt').read()
## change dir to whereever dict is
hashdir = 'C:/Users/student/Dropbox/2016_05_RST/pRST/hash/'
#outdir = 'C:/Users/student/Dropbox/2016_0... | null | RST/data/RSTtrees-WSJ-main-1.0/TRAINING/1_EDU_tag.py | 1_EDU_tag.py | py | 2,900 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.chdir",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "fnmatch.fnmatch",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "nltk.word_tokenize",
"line_nu... |
487713964 | # coding:utf-8
'''
@author = super_fazai
@File : ali_1688_comment_parse.py
@Time : 2018/4/9 12:46
@connect : superonesfazai@gmail.com
'''
import sys
sys.path.append('..')
from my_phantomjs import MyPhantomjs
# from my_requests import MyRequests
from my_logging import set_logger
from my_utils import get_shangha... | null | python网络数据采集/my_爬虫_进阶_之路/scrapy框架/my_spiders/电商项目集合/阿里1688_淘宝_天猫_京东_折800_卷皮_拼多多_蜜芽_蘑菇街_楚楚街_唯品会_聚美优品/my_flask_server/comment_spiders/ali_1688_comment_parse.py | ali_1688_comment_parse.py | py | 9,794 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sys.path.append",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "my_logging.set_logger",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "settings.MY_SPIDE... |
645581027 | import time, random
import telegram
from selenium import webdriver
from apscheduler.schedulers.blocking import BlockingScheduler
# telegram 연결
my_token = '1452258160:AAE-vBhMASThkE90ZD0X7SygYyxIBemnm9c'
bot = telegram.Bot(token=my_token)
# 커리어 연세 접속
driver = webdriver.Chrome("C:\\Users\\user\\PycharmProjects\\chromed... | null | crawl.py | crawl.py | py | 1,516 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "telegram.Bot",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "time.sleep",... |
234751946 | """Neural Network class"""
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import torch.utils.data
import numpy as np
import matplotlib.pyplot as plt
"""
the neural network class inherits from nn.Module
the default functions
init (constructor) and forward
have to be defi... | null | torch_net_class.py | torch_net_class.py | py | 5,844 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "torch.nn.Module",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "torch.nn.ModuleList",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"lin... |
48146773 | #coding:utf-8
'''
1. python monitor_notice.py "CN2" "msg" "send test email"
2. python monitor_notice.py "CN2" "email" "test" "send test email"
'''
import os
import sys
import json
import time
import json
import urllib2
import logging
import logging.handlers
import traceback
SUCCESS_CODE = u"200"
NOTICE_EMAIL = u"ema... | null | Tasks/notice.py | notice.py | py | 5,639 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "urllib2.Request",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "urllib2.urlopen",
"l... |
250680392 | import numpy as np
from pydub import AudioSegment
from notes_directory import NotesDirectory
from audio_comparer import AudioComparer
from jmetal.core.problem import BinaryProblem
from jmetal.core.solution import BinarySolution
# Analizing frequencies
from scipy.io import wavfile
import crepe
class MusicProblem(Bina... | null | music_problem.py | music_problem.py | py | 2,398 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "jmetal.core.problem.BinaryProblem",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "audio_comparer.AudioComparer",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "notes_directory.NotesDirectory",
"line_number": 23,
"usage_type": "call"
... |
545707301 | import os
import sys
from tkinter.filedialog import askdirectory
from tkinter import messagebox
import threading
import pygame
from mutagen.id3 import ID3
from tkinter import *
from socket import *
class AudioPlayer:
def __init__(self,clientSocket,Tmpfolder):
self.root = Tk()
self.root.title("Cli... | null | Client/MultithreadingTCPClient2.py | MultithreadingTCPClient2.py | py | 7,550 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.path.dirname",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "pygame.mixer.quit",
"line_number": 69,
"usage_type": "call"
},
{
"api_name": "pygame.mixer",
"li... |
331775730 | import matplotlib
import matplotlib.pyplot as plt
import numpy
from datasetManager import cstDataset, cstSequence, reduceTwoSeqPlots
from plotUtilsForPaper import latexField, fixExponentialAxes, removeExponentialNotationOnAxis
import plot_defaults
sourceDb = '/home/jeff/work/rotNSruns/allRuns3-25-13.db'
ye = 0.1
colo... | null | diffRotPlots4-11-13.py | diffRotPlots4-11-13.py | py | 3,768 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "plotUtilsForPaper.latexField",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "datasetManager.cstDataset",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "datasetManager.cstSequence",
"line_number": 38,
"usage_type": "call"
},
{
... |
58609415 | from rest_framework import serializers
from .models import Vendor
from django.contrib.auth.models import User
class VendorViewSerializer(serializers.ModelSerializer):
class Meta:
model = Vendor
fields = ('id','name','products','address','city','pincode','phone','details')
class VendorCreat... | null | vendors/serializers.py | serializers.py | py | 1,246 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "rest_framework.serializers.ModelSerializer",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.serializers",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "models.Vendor",
"line_number": 7,
"usage_type": "name"
},
{
... |
502848258 | from django.urls import path, include
from request.views.views import CreateListPartView, ReadUpdatePartView, DeletePartView, ListPartView
app_name = 'part'
urlpatterns = [
path('list', ListPartView.as_view(), name='list'),
path('<int:order_pk>/insert', CreateListPartView.as_view(), name='insert'),
path('... | null | app/request/urls/order/part.py | part.py | py | 485 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "request.views.views.ListPartView.as_view",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "request.views.views.ListPartView",
"line_number": 7,
"usage_type": "name"
},
... |
599360534 | import pandas as pd
import json
import matplotlib.pyplot as plt
from sklearn import preprocessing
from sklearn.linear_model import LogisticRegression
from sklearn.model_selection import StratifiedShuffleSplit, train_test_split
from sklearn.preprocessing import StandardScaler
from sklearn.ensemble import RandomForestCla... | null | src/food_main.py | food_main.py | py | 5,384 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pandas.read_csv",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 98,
"usage_type": "call"
},
{
"api_name... |
350494205 | from django.db import models
from django.contrib.auth.models import AbstractUser
import json, requests
# Create your models here.
client_id = 'f3ea399637c141278aabea52b5c03384'
client_secret = 'a269bf48103c425cbcdf6edfb7f215d6'
class User(AbstractUser):
spotify_name = models.CharField(max_length=100)
access_to... | null | main_site/models.py | models.py | py | 4,150 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.contrib.auth.models.AbstractUser",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "django.db.models.CharField",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.db.models",
"line_number": 9,
"usage_type": "name"
},
{
"... |
46541200 | import cv2
import numpy as np
import time
video_capture = cv2.VideoCapture(0)
fourcc = cv2.VideoWriter_fourcc('m','p','4','v')# note the lower case
frame_width = int(video_capture.get(3))
frame_height = int(video_capture.get(4))
out = cv2.VideoWriter('Harry_Potter.mp4',fourcc , 10, (frame_width,frame_height), True)
for... | null | cloak2.py | cloak2.py | py | 2,301 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "cv2.VideoWriter_fourcc",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "cv2.VideoWriter",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.flip",
... |
248864784 | """
## Utility Tool (Self Serve)
For indexing datasets from s3 into an existing product and OWS layer/s.
#### Utility customisation
The DAG can be parameterized with run time configuration `product` and `s3_glob`
The commands which are executed are:
1. `s3-to-dc --no-sign-request --skip-lineage`
2. update ows
3. upd... | null | dags/utility/utility_annual_workflow.py | utility_annual_workflow.py | py | 3,397 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "datetime.datetime",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "datetime.timedelta",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "infra.variables.DB_HOSTNAME",
"line_number": 64,
"usage_type": "name"
},
{
"api_name": "infr... |
126720320 | from twisted.internet.defer import inlineCallbacks
from twisted.internet import reactor
from twisted.web import client, server
from genshi.template import TemplateLoader
from infobat.database import NoSuchBan
from infobat.config import conf
from infobat.util import parse_time_string
from klein.resource import KleinReso... | null | infobat/http.py | http.py | py | 3,797 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "twisted.web.client.HTTPPageGetter",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "twisted.web.client",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "twisted.web.client.HTTPClientFactory",
"line_number": 16,
"usage_type": "attrib... |
321000604 | import numbers
import openpyxl
import os
import sys
import requests
import subprocess
from django.conf import settings
PRICE_FILES_DIR = os.path.join(settings.PROJECT_DIR, 'price_files')
AUTO_NAME = 'price_file'
def isint(value):
try:
int(value)
return True
except ValueError:
return... | null | priceprocessor/utils.py | utils.py | py | 6,962 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.path.join",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "django.conf.settings.PROJECT_DIR",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "djang... |
595531505 | from photons_app.errors import PhotonsAppError
from photons_app import helpers as hp
from photons_messages import DeviceMessages, TileMessages
from photons_themes.coords import user_coords_to_pixel_coords
from photons_products_registry import capability_for_ids
from photons_themes.theme import ThemeColor as Color
from... | null | photons_tile_paint/animation.py | animation.py | py | 7,194 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "photons_app.errors.PhotonsAppError",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "photons_themes.coords.user_coords_to_pixel_coords",
"line_number": 21,
"usage_type":... |
193796557 | __author__ = "Grant Curell"
__copyright__ = "Do what you want with it"
__license__ = "GPLv3"
__version__ = "1.0.0"
__maintainer__ = "Grant Curell"
"""
An OpenFlow 1.3 L2 learning switch implementation.
"""
import json
import sys
import communityid
from webob import Response
from ryu.controller import ofp_event
from ... | null | restapi.py | restapi.py | py | 16,796 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "ryu.ofproto.ofproto_v1_3.OFP_VERSION",
"line_number": 40,
"usage_type": "attribute"
},
{
"api_name": "ryu.ofproto.ofproto_v1_3",
"line_number": 40,
"usage_type": "name"
},
{
"api_name": "ryu.controller.handler.set_ev_cls",
"line_number": 49,
"usage_type": "... |
172108823 | import requests
import json
def SanHu(number):
u""" 三户查询接口
:param number: 要查询手机号码
:return: 0:CBSS 1:ESS 其它返回具体错误信息
"""
url = 'http://m.hlj165.com/cp/aop/sanHu'
postdata = {
"user": "worp",
"pwd": "worp",
"number": str(number)
}
res = requests.post(url,data=po... | null | traffic.py | traffic.py | py | 3,248 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "requests.post",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_numb... |
278197814 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import numpy as np
from scipy.linalg import cho_factor, cho_solve, LinAlgError
from gprn.weightFunction import Linear
class simpleGP(object):
"""
Class to create our simple Gaussian process "branch".
Parameters:
node = node function being ... | null | gprn/simpleGP.py | simpleGP.py | py | 12,708 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.identity",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "numpy.zeros_like",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 84,
"usage_type": "call"
},
{
"api_name": "gprn.weightFunction.Linea... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.