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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
91870029 | #-------------------------------------------------------------------------------
# Name: ResolutionSlider
# Purpose:
#
# Author: Michael Blackwood
#
# Created: 07/10/2012
# Copyright: (c) Monxcleyr Productions 2012
# License: See License.txt
#-------------------------------------------------------... | null | lib/gui/resslider.py | resslider.py | py | 4,787 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pygame.transform.rotate",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "pygame.transform",
"line_number": 39,
"usage_type": "attribute"
},
{
"api_name": "pygame.transform.rotate",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": ... |
13285083 | #! python3
# Get the directory name in this module.
def getdir():
''' '''
global f
f = input('test(for testing) or work(for working):')
FILE = 'd:\\_PythonWorks\\mark\\directory' + f + '.txt'
try:
dirname = open(FILE).read()
except IOError:
print('No such filename.')
dir... | null | getdir.py | getdir.py | py | 4,279 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "openpyxl.load_workbook",
"line_number": 85,
"usage_type": "call"
},
{
"api_name": "openpyxl.load_workbook",
"line_number": 106,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 138,
"usage_type": "call"
},
{
"api_name": "re.compile... |
135048428 | import cv2
import math
from matplotlib import pyplot as plt
import sys
import numpy as np
from scipy.spatial import distance
import glob
import pandas as pd
import os
import imutils
star = cv2.xfeatures2d.StarDetector_create()
freakExtractor = cv2.xfeatures2d.FREAK_create()
np.set_printoptions(threshold=sys.maxsize)
... | null | precision_recall - FREEK.py | precision_recall - FREEK.py | py | 3,553 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "cv2.xfeatures2d.StarDetector_create",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "cv2.xfeatures2d",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "cv2.xfeatures2d.FREAK_create",
"line_number": 12,
"usage_type": "call"
},
{
... |
473536594 | # coding=utf-8
import time
import logging
from tornado.ioloop import IOLoop
from tornado.concurrent import Future
async_logger = logging.getLogger('frontik.async')
class AsyncGroup(object):
"""
Grouping of several async requests and final callback in such way that final callback is invoked
after the la... | null | frontik/async.py | async.py | py | 4,252 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "tornado.ioloop.IOLoop.current",
... |
44590805 | # file mygame/web/chargen.views.py
from django.shortcuts import render
# Create your views here.
from web.chargen.models import CharApp
from django.http import HttpResponseRedirect
from datetime import datetime
from evennia.objects.models import ObjectDB
from django.conf import settings
from evennia.utils import cre... | null | web/chargen/views.py | views.py | py | 5,125 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "web.chargen.models.CharApp.objects.filter",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "web.chargen.models.CharApp.objects",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "web.chargen.models.CharApp",
"line_number": 20,
"usage_... |
158760058 | from django.conf.urls import url
from . import views
urlpatterns = [
# ex: /fbase/
url(r'^$', views.index, name='index'),
# ex: /fbase/categories/
url(r'^categories/$', views.foodcat, name='foodcat'),
# ex: /fbase/categories/5
url(r'^categories/(?P<foodcategories_id>[0-9]+)/$', views.category,... | null | fbase/urls.py | urls.py | py | 345 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.conf.urls.url",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 11,
"usage_type": "call"
}
] |
250722124 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Sep 9 15:25:23 2019
@author: mhayman
Script to merge overlapping water vapor PTV retrievals into a single
profile.
"""
import matplotlib
matplotlib.use('Agg')
import numpy as np
import xarray as xr
import matplotlib.pyplot as plt
# import LidarPro... | null | processors/WVPTV_MergeProfiles_MPD.py | WVPTV_MergeProfiles_MPD.py | py | 8,081 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "matplotlib.use",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "xarray.set_options",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "glob.glob",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "xarray.open_dataset",
... |
33788373 | #importing openCV
import cv2
# load the input image
img = cv2.imread('picture.jpg')
# Converting the image into grayscale
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
# Loading the cascade
cascade_faces = cv2.CascadeClassifier('haarcascade_frontalface_default.xml')
# Detecting faces
faces = cascade_fac... | null | Face_Detection.py | Face_Detection.py | py | 559 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "cv2.imread",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2GRAY",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "cv2.CascadeClassifier",
... |
525870968 | import random
import matplotlib.pyplot as plt
import numpy as np
# 0 - empty, 1 - wall, 2 - snake pit, 3 - reward
class Gridworld:
def __init__(self, dimensions, coords_walls, coords_snake_pits, coords_rewards, rewards, actions, policy):
self.dimensions = dimensions
self.grid = np.zeros(s... | null | rl.py | rl.py | py | 12,516 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.zeros",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "random.choice",
"line_number"... |
273832143 | import pandas
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import numpy as np
from particle_filter import *
# Number of particles to use for the simulation
# If particleCount > 10000 then only the heat map is shown
particleCount = 50
# Whether to include air resistance in the model
airResis... | null | data_visualizer.py | data_visualizer.py | py | 6,296 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.pi",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "numpy.array",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "numpy.cos",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "numpy.sin",
"line_number": 28... |
583309905 | import torch
import torch.nn as nn
import numpy as np
# from methods.meta_template import MetaTemplate
from .gnn import GNN_nl
from torch.autograd import Variable
import models.backbone as backbone
import copy
class Classifier(nn.Module):
def __init__(self, dim, n_way):
super(Classifier, self).__init__()
... | null | MCPM/models/gnnnet.py | gnnnet.py | py | 14,646 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "torch.nn.Module",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "torch.nn.Linear",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_nu... |
145600619 | # uncompyle6 version 3.7.4
# Python bytecode 3.4 (3310)
# Decompiled from: Python 3.6.9 (default, Apr 18 2020, 01:56:04)
# [GCC 8.4.0]
# Embedded file name: /home/nazrul/www/python/Contributions/apps/hybrid-access-control-system/hacs/utils.py
# Compiled at: 2016-07-12 02:07:20
# Size of source mod 2**32: 12101 bytes
f... | null | pycfiles/django_hacs-1.0b1-py2.py3-none-any/utils.cpython-34.py | utils.cpython-34.py | py | 11,593 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.contrib.auth.get_user_model",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "models.SiteRoutingRules.objects.get",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "models.SiteRoutingRules.objects",
"line_number": 36,
"usage_type":... |
398496149 | ### Austomatically detect the input size from the architecture
# That way we don't have to hard code anything
import torch
from torch import nn, optim
from collections import OrderedDict
from torchvision import models
def find_input_size(arch, model):
"""
Austomatically detect the input size from the architec... | null | build_model.py | build_model.py | py | 2,558 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "torch.nn",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "torch.nn.Linear",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number": 58,
"usage_type": "name"
},
{
"api_name": "torch.nn.ReLU",
"line_numb... |
211635918 | from collections import defaultdict
import numpy as np
from anago.metrics import get_entities
class Tagger(object):
def __init__(self, model, preprocessor=None):
self.model = model
self.preprocessor = preprocessor
def predict(self, words):
length = np.array([len(words)])
X ... | null | anago/tagger.py | tagger.py | py | 3,588 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.array",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.argmax",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "numpy.max",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "anago.metrics.get_entities",
"... |
88076917 | #!/usr/bin/python
class AppendWeatherData:
def __init__(self):
from pyspark.sql import SparkSession
import os
self.psql_user = os.environ['POSTGRESQL_USER']
self.psql_pw = os.environ['POSTGRESQL_PASSWORD']
self.spark = SparkSession \
.builder \
.a... | null | data-processing/append_weather_data.py | append_weather_data.py | py | 3,783 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.environ",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "pyspark.sql.SparkSession.builder.appName",
"line_number": 13,
"usage_type": "call"
},
{
"api_name... |
380904543 | import streamlit as st
import numpy as np
import pandas as pd
import altair as alt
import matplotlib.pyplot as plt
from sklearn.preprocessing import StandardScaler
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LinearRegression
from sklearn.ensemble import RandomForestClassifier... | null | Question4/Q4_Selangor.py | Q4_Selangor.py | py | 10,009 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pandas.read_csv",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.StandardScaler",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": ... |
377272182 | import django_filters
from django.db.models import Avg
from django_filters import FilterSet
from django import forms
from review.choices import GENRE_CHOICES, CATEGORY_CHOICES
from review.models import Review
__all__ = [
"average_filter",
'MoviesRatingsFilter',
'SimpleHighChartFilter',
'ChartByGenreF... | null | ratings/filters.py | filters.py | py | 1,809 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "review.models.Review.objects.all",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "review.models.Review.objects",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "review.models.Review",
"line_number": 22,
"usage_type": "name"
},
... |
59107048 | import matplotlib.pyplot as plt
loss = []
with open('./a.train.log','r',encoding='utf8') as f:
f.readline()
for line in f.readlines():
loss.append(float(line.split(',')[1][1:]))
val_loss = []
with open('./a.valid.log','r',encoding='utf8') as f:
f.readline()
for line in f.readlines():
v... | null | pku-deep-learning/lg-course/assignment4/src/plot.py | plot.py | py | 680 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "mat... |
357783142 | from PySide import QtCore, QtGui
from SafetyPlayUtils import *
from time import sleep
from datetime import datetime
class Clock(QtGui.QWidget):
ten_sec_signal = QtCore.Signal(float)
five_sec_signal = QtCore.Signal()
zero_sec_signal = QtCore.Signal()
reset_initial = QtCore.Signal()
def __init__(self... | null | Clock.py | Clock.py | py | 3,334 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "PySide.QtGui.QWidget",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "PySide.QtGui",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "PySide.QtCore.Signal",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "PySide.QtCor... |
154008111 | import sys
import Pyro4
import Pyro4.util
sys.excepthook = Pyro4.util.excepthook
master = Pyro4.Proxy("PYRONAME:master-pi@10.0.0.2:9090")
def main():
print("Writing to File")
master.write_to_file(['Test\n', 'T'])
if __name__ == '__main__':
main() | null | Object-Detection/coms/write_test.py | write_test.py | py | 262 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.excepthook",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "Pyro4.util",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "Pyro4.Proxy",
"line_number": 7,
"usage_type": "call"
}
] |
46620200 | # WmData.py
import sys
import Xlib.X as X
import Xlib.XK as XK
################################################################################
class WmDataStack(object):
def __init__(self, dispaly, screen, config):
self.border_width = config.stack.border_width
########################################... | null | WmData.py | WmData.py | py | 7,018 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "Xlib.X.Mod4Mask",
"line_number": 165,
"usage_type": "attribute"
},
{
"api_name": "Xlib.X",
"line_number": 165,
"usage_type": "name"
},
{
"api_name": "Xlib.X.Mod3Mask",
"line_number": 167,
"usage_type": "attribute"
},
{
"api_name": "Xlib.X",
"lin... |
510475664 | from mock import MagicMock, mock_open, patch # create_autospec
from mock_libraries.fabric import Result
from mock_libraries.psycopg2 import MockConnect
from mock_libraries.selenium import MockBrowser, MockWebDriverWait
class Patcher:
"""
Initializes mock objects and exposes them so that each py.test method c... | null | mocks.py | mocks.py | py | 2,239 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "mock.MagicMock",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "mock_libraries.psycopg2.MockConnect",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "mock.MagicMock",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "moc... |
413286401 | """Module for logging messages"""
import logging
import sys
CONSOLE_FORMATTER = logging.Formatter("%(name)s - line %(lineno)d - %(message)s")
FILE_FORMATTER = logging.Formatter("%(asctime)s - %(name)s - line %(lineno)d - " \
"%(levelname)s - %(message)s")
LOG_FILE = "debug.log"
# O... | null | src/debug_logger.py | debug_logger.py | py | 1,341 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.Formatter",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "logging.Formatter",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "logging.StreamHandler",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "sys.stdout",
... |
307283203 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Setup script for the Hord
"""
from setuptools import setup
with open('README.rst') as readme_file:
README = readme_file.read()
def read_requirements(filename):
"""
Reads requirements from the given file
"""
with open(filename) as file_handle:
... | null | setup.py | setup.py | py | 1,351 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "setuptools.setup",
"line_number": 25,
"usage_type": "call"
}
] |
335199907 | # -*- coding: utf-8 -*-
"""
The idea is to provide glue between events to string together implicit
workflow chains of actions.
"""
from nameko.events import EventDispatcher, event_handler
from nameko.rpc import RpcProxy
class RulesService(object):
"""Microservice layer to provide event-driven automation."""
... | null | cghq/rules.py | rules.py | py | 2,613 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "nameko.events.EventDispatcher",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "nameko.rpc.RpcProxy",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "nameko.rpc.RpcProxy",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": ... |
278142464 | import sqlite3
from os.path import expanduser,join,exists
from os import mkdir
from subprocess import getoutput
#create directories
home_dir = expanduser("~")
#eyetv_movies directory
eyetv_movies_dir = join(home_dir, "movie_catalogue_eyetv")
if (not exists(eyetv_movies_dir)):
mkdir(eyetv_movies_dir)
#pictures direc... | null | setup_refresh_install.py | setup_refresh_install.py | py | 2,134 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.expanduser",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.mkdir",
"line_nu... |
398766132 | import torch
from torch import nn
class UNetDown(nn.Module):
def __init__(self, in_size, out_size, normalize=True, dropout=0.0):
super(UNetDown, self).__init__()
layers = [nn.Conv2d(in_size, out_size, 4, 2, 1, bias=False)]
if normalize:
layers.append(nn.InstanceNorm2d(ou... | null | utils.py | utils.py | py | 2,311 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "torch.nn.Module",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "torch.nn.Conv2d",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_numbe... |
141729853 | #!/usr/bin/python
from numpy import *
import matplotlib.pyplot as plt
from matplotlib.collections import LineCollection
from mesh_structure import *
V1 = [Vertex([1.,1.]),
Vertex([2.,1.]),
Vertex([3.,2.]),
Vertex([4.,.5])]
V2 = [Vertex([2.,1.]),
Vertex([3.,2.]),
Vertex([4.,.5]),
... | null | cob_mesh_mapping/scripts/drafts/test_simplification_cost.py | test_simplification_cost.py | py | 659 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "matplotlib.collections.LineCollection",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.cm",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 24,
"usage_type": "name"
},
{
... |
178954160 | from utils import img_util
from utils import hed_util
import numpy as np
import cv2
import os
MODEL_NAME = 'model'
HED_NAME = 'HED'
# Grab path to current working directory
CWD_PATH = os.getcwd()
IMAGE_NAME = 'test_images/001459.jpeg'
PATH_TO_IMAGE = os.path.join(CWD_PATH,IMAGE_NAME)
HED_PROTOTEXT_PATH = os.path.join(... | null | test_hed.py | test_hed.py | py | 845 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.getcwd",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number":... |
134648948 | # encoding: utf-8
from django.dispatch import receiver
from django.db.models.signals import post_save
from accounts.signals import user_first_log_in
from bonuses.models import Bonus, UserBonus, BonusType
from wallets.models import WalletTransaction, WalletTransactionType
@receiver(user_first_log_in)
def on_user_sign... | null | cherrygame/bonuses/signals.py | signals.py | py | 1,143 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "bonuses.models.Bonus.objects.filter",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "bonuses.models.Bonus.objects",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "bonuses.models.Bonus",
"line_number": 13,
"usage_type": "name"
},... |
184659767 | import os
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.utils.data as data
import torchvision.transforms as transforms
import torch.optim as optim
import pandas as pd
import torchvision.models as models_res
import matplotlib.pyplot as plt
from skimage impo... | null | pytorch/resnet.py | resnet.py | py | 11,252 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "torch.nn.Conv3d",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "torch.nn.Linear",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "torch.nn.init.orth... |
240285533 | import sqlite3
import webbrowser
from tkinter import *
from tkinter import simpledialog, Button
import tkinter.messagebox
import base64
import csv
def get_me(userInput):
root = Tk()
w = Label(root)
w.pack()
tkinter.messagebox.showinfo("Welcome","Please enter here")
s=simpledialog.asks... | null | Lab10.py | Lab10.py | py | 1,269 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "tkinter.messagebox.showinfo",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "tkinter.messagebox",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "tkinter.simpledialog.askstring",
"line_number": 14,
"usage_type": "call"
},
{
... |
461717020 | # Copyright (c) The Fancy Corporation. All rights reserved.
# This program is currently licence-free
from copy import deepcopy
from math import *
import time
import os
import pygame
from pygame.locals import *
import webbrowser
cog=open(os.path.dirname(os.path.abspath(__file__))+"\\settings.dat","r+")
temp=open(os.p... | null | Source/GOL.py | GOL.py | py | 11,764 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.dirname",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"l... |
456156394 | __all__ = [
"Pendulum",
"MultiPendulum",
]
import pymunk
from manim import *
from manim_physics.rigid_mechanics import *
class MultiPendulum(VGroup):
def __init__(
self,
*bobs,
pivot_point=UP * 2,
rod_style={},
bob_style={
"radius": 0.1,
"co... | null | src/manim_physics/pendulum.py | pendulum.py | py | 2,513 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pymunk.Body",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "pymunk.PinJoint",
"line_number": 51,
"usage_type": "call"
}
] |
580313409 | import datetime
import random
import sys
import time
import xml.etree.ElementTree as etree
import xivelymqtt as xively
XIVELY_API_KEY = "xwVWouuvRk5KNZkHl4vyAhaCCiDEl2zFRyG0HcUq0ulLz34y"
XIVELY_FEED_ID = 1659394686
XIVELY_SUBSCRIPTIONS = ['command', 'alarm', 'update']
def XIVELY_ON_MESSAGE(api, userdata, msg):
pr... | null | venv/example/bongate.py | bongate.py | py | 1,933 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "xivelymqtt.XivelyAPIClient",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.utcnow",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_na... |
264462461 | # The purpose of this script is to display the results contained
# in the Crowdstorming SQLite Database in a clean, graphical manner.
#
# Created by Madison Treat, Kodi Tapie and Blake Robertson
#
#
# REQUIREMENTS TO DISPLAY:
#
# install numpy, matplotlib from sourceforge installers
# install networkx from pip
# instal... | null | src/mturk-draw.py | mturk-draw.py | py | 3,069 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.argv",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "networkx.Graph",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "networkx.pydot_layout",
... |
99173073 | import numpy as np
import scw
from matplotlib import pyplot
def plot(X, teachers, weights):
red_t = []
blue_t = []
for x, teacher in zip(X, teachers):
if(teacher > 0.):
red_t.append(x)
else:
blue_t.append(x)
red_t = np.array(red_t)
blue_t = np.array(blue_t)... | null | test.py | test.py | py | 1,757 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.array",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.dot",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 25... |
322429154 | #!/usr/bin/env python
import os
import sys
from django.template import Context, Template
from django.template.loader import get_template
class Table:
def __init__(self, tableName):
self.name = tableName
self.columns = []
class DatabaseDoc:
def __init__(self, databaseName):
self.name ... | null | PythonPostgres/PythonPostgres/pg_dgen/manage.py | manage.py | py | 881 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.environ.setdefault",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "django.template.loader.get_template",
"line_number": 28,
"usage_type": "call"
},
{
"api_nam... |
22719101 | from os import fdopen
from PyQt5 import QtCore
from PyQt5.QtWidgets import QWidget, QGridLayout, QVBoxLayout, QHBoxLayout, QPushButton, QLineEdit, QLabel, QMessageBox
import connectDB
import global_var
#import websockets.legacy.server
#import websockets.legacy.client
from td.client import TDClient
class LoginUrlWind... | null | dlgLoginUrl.py | dlgLoginUrl.py | py | 2,459 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "PyQt5.QtWidgets.QWidget",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtCore.pyqtSignal",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtCore",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "PyQt5.Qt... |
339596628 | from __future__ import division, absolute_import
__copyright__ = "Copyright (C) 2012 Andreas Kloeckner"
__license__ = """
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, incl... | null | sumpy/expansion/multipole.py | multipole.py | py | 9,546 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "sumpy.expansion.ExpansionBase",
"line_number": 44,
"usage_type": "name"
},
{
"api_name": "sumpy.kernel.DirectionalSourceDerivative",
"line_number": 61,
"usage_type": "name"
},
... |
366760436 | import pickle
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtWidgets import (
QWidget, QToolTip, QPushButton, QApplication, QMessageBox)
from .TablesWindowCross import TablesWindowCross
class WrappedTablesWindowCross(TablesWindowCross, QtWidgets.QMainWindow):
def __init__(self):
super().__... | null | SmartMedApp/GUI/apps/BioequivalenceApp/WrappedTablesWindowCross.py | WrappedTablesWindowCross.py | py | 2,293 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "TablesWindowCross.TablesWindowCross",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtWidgets.QMainWindow",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "PyQt5.QtWidgets",
"line_number": 10,
"usage_type": "name"
},
{
... |
185503825 | import pytest
from unittest.mock import MagicMock, call
from typing import List, Tuple, Dict, Any
from opentrons.calibration_storage import modify, helpers
from opentrons.types import Mount, Point
from opentrons.hardware_control import pipette
from opentrons.config.pipette_config import load
from robot_server.service.... | null | robot-server/tests/robot/calibration/pipette_offset/test_user_flow.py | test_user_flow.py | py | 7,996 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "opentrons.types.Point",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "opentrons.hardware_control.pipette.Pipette",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "opentrons.hardware_control.pipette",
"line_number": 35,
"usage_type": "n... |
393691901 | from dal import autocomplete
from django import forms
from django.utils.crypto import get_random_string
from django.utils.safestring import mark_safe
from extra_views import InlineFormSetFactory
from apps.wiki.models import Tag, Article, ExternalLink, ArticleFile
class ArticleModelForm(forms.ModelForm):
tags = f... | null | apps/wiki/forms.py | forms.py | py | 2,325 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.forms.ModelForm",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "django.forms.ModelMultipleChoiceField",
"line_number": 11,
"usage_type": "call"
},
{
"ap... |
574526837 | import config
from serial.tools import list_ports
from serial import Serial
# Get the Serial USB Device
port = list(list_ports.comports())
for p in port:
if(p.usb_description() == 'USB Serial'):
thisDevice = p.device
# Setup and Write to the Serial Device
serialIF = Serial(thisDevice, config.arduinoSerialBa... | null | MeetingSign/meetingSignUARTRx/test/allBlue.py | allBlue.py | py | 435 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "serial.tools.list_ports.comports",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "serial.tools.list_ports",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "serial.Serial",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "... |
81968212 | # pylint: disable=missing-docstring,unused-argument
import pytest
from faker import Faker
import numpy as np
from tests.fixtures.factories import MLModelFactory
from tipping.db.faunadb import GraphQLError
from tipping.models import MLModel
from tipping.models.base_model import ValidationError
FAKE = Faker()
@pyte... | null | tipping/src/tests/integration/models/test_ml_model.py | test_ml_model.py | py | 2,637 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "faker.Faker",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "tests.fixtures.factories.MLModelFactory.create",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "tests.fixtures.factories.MLModelFactory",
"line_number": 36,
"usage_type": "na... |
17685304 | from django.contrib.auth.decorators import user_passes_test, login_required
from django.contrib.auth import authenticate, login
from django.shortcuts import render, redirect
from .forms import LoginForm, PortfolioForm, ImageForm, SummaryForm, QualityForm, JobForm, SchoolForm, JobResponsibilityForm
from django.forms.mod... | null | admin/views.py | views.py | py | 8,684 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "forms.LoginForm",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.authenticate",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.login",
"line_number": 17,
"usage_type": "call"
},
{
"api_na... |
107439929 | # For curtana.surge.sh
# By Priyam Kalra
from shutil import rmtree
from datetime import date
from time import sleep
from production import Config
from markdown import markdown
from numpy.random import choice
from subprocess import check_output
from os import rename, listdir, remove, path
from jinja2 import Environment... | null | app.py | app.py | py | 5,155 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "datetime.date.today",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "production.Config.CHATS",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "produc... |
226419084 | """
:Date: 2016-08-03
:Version: 0.0.1
:Author:
- Jackson McCrea (jacksonmccrea@gmail.com)
"""
import asyncio
import discord
from guilty_spark.bot import Monitor
from guilty_spark.plugin_system.plugin import Plugin
class PluginAdmin(Plugin):
def __init__(self, name, bot: Monitor):
super().__init__(nam... | null | plugins/plugin_admin.py | plugin_admin.py | py | 2,557 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "guilty_spark.plugin_system.plugin.Plugin",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "guilty_spark.bot.Monitor",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "discord.Message",
"line_number": 25,
"usage_type": "attribute"
},
{... |
52835984 | """FF Logs web API interaction.
Functions and classes for interacting with the FF Logs rest API:
https://www.fflogs.com/v1/docs
"""
from typing import Optional
import logging
import sys
import requests
FF_LOGS_BASE_URL = "https://www.fflogs.com/"
FF_LOGS_API_URL = FF_LOGS_BASE_URL + "v1/"
FF_LOGS_CLASSES_URL = FF... | null | fflogs_fight_analyzer/fflogs.py | fflogs.py | py | 2,950 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number":... |
152802113 | from multiprocessing import Process,Pipe
def func(conn1,conn2):
conn2.close()
while True:
try:
msg=conn1.recv()
# if msg==None:break
print(msg)
except EOFError :
conn1.close()
break
if __name__=='__main__':
conn1,conn2=Pipe()
... | null | day18/01管道.py | 01管道.py | py | 575 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "multiprocessing.Pipe",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "multiprocessing.Process",
"line_number": 17,
"usage_type": "call"
}
] |
588721359 | import csv
import math
from datetime import datetime
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from matplotlib.widgets import Slider
from scipy.spatial.transform import Rotation
odom_path = "../../src/db_config/bags/motors_2020-09-13-15-42-20-dodobot-odom.csv"
linear_pa... | null | scripts/bag_analyzer/bp_path_profiler.py | bp_path_profiler.py | py | 5,568 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "datetime.datetime.strptime",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.strftime",
"line_number": 22,
"usage_type": "call"
},
{
"api_name"... |
40443794 | import requests
from bs4 import BeautifulSoup
import bs4
def getHtmlText(url):
try:
r = requests.get(url,timeout = 30)
print("raise_stsus = {}".format(r.raise_for_status()))
print("获取状态完毕")
r.encoding = r.apparent_encoding
return r.text
except:
print("get informa... | null | 网络爬虫/python爬虫之bs4的基本使用/bs4.soup方法_豆瓣电影网排行.py | bs4.soup方法_豆瓣电影网排行.py | py | 2,033 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "requests.get",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "bs4.element",
"line_number": 33,
"usage_type": "attribute"
}
] |
256179926 | # encoding:utf-8
from selenium import webdriver
import time
"""
多个浏览器窗口
"""
driver = webdriver.Chrome(r"C:\Users\19663\Desktop\chromedriver.exe")
driver.get("https://www.baidu.com")
time.sleep(3)
driver.find_element_by_link_text(u"登录").click()
time.sleep(3)
driver.find_element_by_link_text(u"立即注册").click()
firstwin ... | null | selenium_test/selenium_test_10.py | selenium_test_10.py | py | 999 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "time.sleep",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "time.sleep",
... |
280924591 | from __future__ import unicode_literals
import os
import uuid
import base64
import binascii
import hashlib
import threading
from decimal import Decimal as D
from django.core.files.base import ContentFile
from django.core.exceptions import ValidationError
from django.db.models import Q
from django.contrib.gis.db import ... | null | parkstay/models.py | models.py | py | 69,470 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.contrib.gis.db.models.Model",
"line_number": 45,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.gis.db.models",
"line_number": 45,
"usage_type": "name"
},
{
"api_name": "django.contrib.gis.db.models.CharField",
"line_number": 46,
"usage_t... |
536802664 | import torch
from torch import nn
from torch import optim
from torch.autograd import Variable
from torch.utils.data import DataLoader
from pspnet import PSPNet
from extractors import __all__
import logging
import click
import os
import numpy as np
logging.basicConfig(format='%(asctime)s - %(message)s', level=logging... | null | train.py | train.py | py | 3,814 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.basicConfig",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "torch.log1p",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "torch.sum",
"li... |
207540127 | # -*- coding: utf-8 -*-
"""
A SVM classifier based on scikit-learn with SMOTE apply it to classify bio datasets.
Date: 2020-04-01
"""
# import os
import time
from argparse import ArgumentDefaultsHelpFormatter, ArgumentParser
__author__ = 'Min'
if __name__ == "__main__":
start_time = time.time()
parser = Argu... | null | sk-svm-kfold-smote-run.py | sk-svm-kfold-smote-run.py | py | 3,560 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "time.time",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentDefaultsHelpFormatter",
"line_number": 16,
"usage_type": "name"
},
{
"api_name... |
544848900 | import numpy as np
import matplotlib.pyplot as plt
from sklearn import datasets
from sklearn.model_selection import train_test_split
from sklearn.linear_model import SGDClassifier, Perceptron
from sklearn.linear_model import PassiveAggressiveClassifier
from sklearn.linear_model import LogisticRegression
heldout = [0.... | null | src/perceptron/test_perceptron.py | test_perceptron.py | py | 1,037 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sklearn.datasets.load_digits",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sklearn.datasets",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "sklearn.datasets.load_iris",
"line_number": 15,
"usage_type": "call"
},
{
"api_name... |
106234205 | # Импортируем нужные компоненты
from telegram.ext import Updater, CommandHandler, MessageHandler, Filters
import logging
from apikey import API_KEY, PROXY
# Добавляем логгирование
import logging
logging.basicConfig(format='%(asctime)s - %(levelname)s - %(message)s',
level=logging.INFO,
... | null | podbot/bot.py | bot.py | py | 1,275 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.basicConfig",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "logging.info",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "telegram.ext.Updater... |
487520348 | import matplotlib.pyplot as plt
import numpy as np
from numpy import array
import operator
# Read N(HI)_fukui N(H)_Planck N(HI)_Heiles #
#
# params string fname Filename
#
# return dict info of N(H) and N(HI)
#
# Author Van Hiep
##
def read_nhi_fukui_nh_planck(fname = 'result/26nhi_nh_halfbeam_accurate_... | null | gas_col_density/nh_correlation_hist.py | nh_correlation_hist.py | py | 2,962 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.array",
"line_number": 105,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 106,
"usage_type": "call"
},
{
"api_name": "numpy.histogram",
"line_number": 108,
"usage_type": "call"
},
{
"api_name": "numpy.hstack",
"line_n... |
347648014 | # -*- coding: utf-8 -*-
"""
This spider is a GoodjobJobs spider created on top of the ATSSpider
scrapy crawl goodjobjobs -a mining_job_id=9999 -a iteration=1 -a extract=1 -a url="http://job.goodjob.cn/JobList.aspx?"
sample job url:
http://job.goodjob.cn/Job284944.html
"""
from re import compile
fr... | null | brightcorp/brightcorp/spiders/goodjobjobs.py | goodjobjobs.py | py | 3,881 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "brightcorp.base.atsspiders.ATSSpider",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "re.compile",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "scrapy.selector.Selector",
"line_number": 33,
"usage_type": "call"
},
{
"api_name... |
36789473 | import requests
base_url = 'localhost:8080/v1'
def test_add_new_task_using_title_only_data():
data = {
'title': "Test Task That To Throw",
}
resp = requests.post(url=f"{base_url}/tasks/", json=data)
assert resp.status_code == 200
assert "Test Task That To Throw" in resp.text | null | tests/test_pomo_task_ops.py | test_pomo_task_ops.py | py | 306 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "requests.post",
"line_number": 10,
"usage_type": "call"
}
] |
187682754 | #!/usr/bin/env python
'''
To install qmcpy, open a terminal, in directory QMCSoftware/qmcpy, run:
python setup.py install
Reference: Writing the Setup Script, https://docs.python.org/3/distutils/setupscript.html
'''
import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setupto... | null | qmcpy/setup.py | setup.py | py | 923 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "setuptools.setup",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "setuptools.find_packages",
"line_number": 25,
"usage_type": "call"
}
] |
159650701 | #!/usr/bin/env python3
import argparse
from time import sleep
from serialdevices import MCPC
def main():
parser = argparse.ArgumentParser()
parser.add_argument('mcpc_port')
parser.add_argument('--mcpc-baud', type=int, required=False, default=115200)
parser.add_argument('savefile', type=argparse.FileT... | null | log.py | log.py | py | 639 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "argparse.FileType",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "serialdevices.MCPC",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "time... |
439048450 | #!/usr/bin/python3
''' city file '''
from api.v1.views import app_views
from models.state import State
from models.city import City
from models import storage
from flask import jsonify, abort, request
@app_views.route('/states/<state_id>/cities', methods=['GET'],
strict_slashes=False)
def get_city(st... | null | api/v1/views/cities.py | cities.py | py | 2,306 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "models.storage.get",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "models.storage",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "flask.abort",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "flask.jsonify",
"li... |
434566895 | #
# Copyright (c) 2016 Intel Corporation
#
# 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 i... | null | project/tests/test_functional/kubernetes_broker/test_cluster.py | test_cluster.py | py | 3,851 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "modules.constants.TapComponent.demiurge",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "modules.constants.TapComponent",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "modules.constants.TapComponent.kubernetes_broker",
"line_number":... |
154662651 | import setuptools
with open("readme.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="DotMeme",
version="0.2.4",
author="Jake Leahy",
author_email="darhyaust@gmail.com",
description="A package to use .meme files",
long_description=long_description,
long_description_content_type="text/markd... | null | pypi_install_script/DotMeme-0.2.4.tar/setup.py | setup.py | py | 647 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "setuptools.setup",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "setuptools.find_packages",
"line_number": 15,
"usage_type": "call"
}
] |
553304651 | from openapi_server.models.location import Location
from openapi_server.models.locations import Locations
from backbone_server.location.fetch import LocationFetch
from backbone_server.errors.missing_key_exception import MissingKeyException
import logging
class LocationGetByGPS():
def __init__(self, conn):
... | null | server/backbone_server/location/get_by_gps.py | get_by_gps.py | py | 1,295 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "openapi_server.models.locations.Locations",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "backbone_server.location.fetch.LocationFetch.fetch",
"line_number": 31,
"usag... |
457991997 | from flask import Flask, escape, request
app = Flask(__name__)
students = {}
id = 0
classid = 99999
classes = {}
@app.route('/')
def hello():
name = request.args.get("name", "World")
return f'Hello, {escape(name)}!'
"""
POST /students
# Request
{
"name": "Bob Smith"
}
# Response
# HTTP Code: 201
{
... | null | lab2/app.py | app.py | py | 2,376 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask.Flask",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "flask.request.args.get",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "flask.request.args",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "flask.reque... |
649557020 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Apr 4 14:54:04 2020
@author: Aishazhan Abuova
"""
import math
import numpy as np
import matplotlib.pyplot as plt
from scipy.integrate import odeint
# projectile2 outputs range, flight time, maximum height, and a
# trajectory plot of a sphere projectil... | null | project 2/projectile2.py | projectile2.py | py | 2,863 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.pi",
"line_number": 37,
"usage_type": "attribute"
},
{
"api_name": "math.sin",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "math.cos",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 40,
... |
201985623 | import logging
from metal import analysis
from metal.label_model import LabelModel
from metal.multitask import MTLabelModel, TaskHierarchy
logger = logging.getLogger(__name__)
def LabelLearner(cardinalities=2, dependencies=[], **kwargs):
"""
A generative factory function for data programming (MeTal).
""... | null | src/fonduer/supervision/label_learner.py | label_learner.py | py | 933 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "metal.label_model.LabelModel",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "metal.multitask.TaskHierarchy",
"line_number": 21,
"usage_type": "call"
},
{
"api_n... |
547887879 | from PIL import ImageDraw, Image, ImageFont
COLORS = {
'red': (255, 0, 0),
'green': (0, 255, 0),
'yellow': (255, 255, 0),
'white': (255, 255, 255),
'black': (0, 0, 0),
'grey': (200, 200, 200),
'water': (51, 51, 204),
'mountain': (166, 166, 166),
'forest': (45, 134, 45),
'grassla... | null | Assignment_3/graphics.py | graphics.py | py | 2,439 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "PIL.Image.new",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "PIL.ImageDraw.Draw",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "PIL.ImageDraw",
"line_... |
599616897 | import os
import cv2
import dlib
import numpy as np
import argparse
from wide_resnet import WideResNet
import glob
def get_args():
parser = argparse.ArgumentParser(description="This script detects faces from web cam input, "
"and estimates age and gender for the det... | null | predict.py | predict.py | py | 3,251 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentDefaultsHelpFormatter",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "cv2.FONT_HERSHEY_SIMPLEX",
"line_number": 23,
"usage_type": "attribut... |
107367436 | # coding: UTF-8
import pymysql.cursors
from distinct import distinctValue as dV
import datetime
# -----------------------------------
# 概要:"sc_daily"テーブルのUPSERT処理
# -----------------------------------
def tb_upsert_sc_daily(scrapedLink, scrapedTitle, scrapedPermaLink, scrapedDormitory, scrapedPicture, scrapedOccupatio... | null | upsert_mysql/sc_daily.py | sc_daily.py | py | 3,183 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pymysql.cursors.connect",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pymysql.cursors",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "pymysql.cursors.cursors",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "... |
34047403 | """Support for switch platform for Hue resources (V2 only)."""
from __future__ import annotations
from typing import Any, TypeAlias
from aiohue.v2 import HueBridgeV2
from aiohue.v2.controllers.events import EventType
from aiohue.v2.controllers.sensors import (
LightLevel,
LightLevelController,
Motion,
... | null | homeassistant/components/hue/switch.py | switch.py | py | 3,292 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "typing.TypeAlias",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "aiohue.v2.controllers.sensors.LightLevelController",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "aiohue.v2.controllers.sensors.MotionController",
"line_number": 25,
"... |
566840500 | #!/usr/bin/env python3
"""
`stack` implementation
@authors: Adam Mertzenich
@version: 2021.4
"""
from queue import SimpleQueue
from typing import Any
class StackError(Exception):
"""Stack errors"""
def __init__(self, *args, **kwargs):
"""Initializer"""
Exception.__init__(self, *args, **kwar... | null | src/projects/interview/stack.py | stack.py | py | 2,341 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "queue.SimpleQueue",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "typing.Any",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "typing.Any",
"line_number": 40,
"usage_type": "name"
},
{
"api_name": "typing.Any",
"line_number... |
332321651 | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# (C) British Crown copyright. The Met Office.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are me... | null | improver_tests/acceptance/test_map_to_timezones.py | test_map_to_timezones.py | py | 2,662 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pytest.mark",
"line_number": 37,
"usage_type": "attribute"
},
{
"api_name": "pytest.mark.parametrize",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "pytest.mark",
"line_number": 45,
"usage_type": "attribute"
}
] |
531143854 | import numpy as np
from PIL import Image
if __name__ == '__main__':
srcIm = Image.open('example.png')
sizeJ, sizeI = srcIm.size
srcPixels = srcIm.load()
skelIm = Image.open('example_kernel2.png')
skelPixels = skelIm.load()
outPixels = np.zeros((sizeI, sizeJ), dtype='uint8')
for jj in xra... | null | py/mergeSkel.py | mergeSkel.py | py | 645 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "PIL.Image.open",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "PIL.Image.open",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 9... |
121592897 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
''' Utilities file
This file contains utility functions for bookkeeping, logging, and data loading.
Methods which directly affect training should either go in layers, the model,
or train_fns.py.
'''
from __future__ import print_function
import sys
import os
import numpy a... | null | utils.py | utils.py | py | 46,077 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "matplotlib.pyplot.cm",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "d... |
45155781 | # !/usr/bin/eny python3
# -*- coning: utf-8 -*-
__author__ = 'Lfrom tkinter import '
from tkinter import *
from urllib.request import urlretrieve
from selenium import webdriver
import os
headers = {
'Host': 'music.163.com',
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, li... | null | demo_test/test2.py | test2.py | py | 3,204 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.makedirs",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "urllib.request.urlretrieve",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "sele... |
280812588 | from __future__ import absolute_import
import logging
import os
from byplay.recording import Recording
from byplay.wrappers.houdini_object import HoudiniObject
class HoudiniPointCloud(HoudiniObject):
def __init__(self, recording, refined):
node_name = u"AR_point_cloud"
self.path = recording.scene... | null | package/python2.7/byplay/wrappers/houdini_point_cloud.py | houdini_point_cloud.py | py | 945 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "byplay.wrappers.houdini_object.HoudiniObject",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "os.path.exists",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name"... |
157818569 | # Load CASIA offline character and paragraph databases
# @NOTE: the CASIA datasets are distributed in .alz fileformat, use unalz to
# unpack it.
# @author: _john
# =============================================================================
import os
import pdb
import struct
from codecs import decode
import numpy as ... | null | generate_data/synthesizeData/loaders/casia.py | casia.py | py | 7,089 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "codecs.decode",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "struct.unpack",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "struct.unpack",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "struct.unpack",
"line_n... |
34919748 | import json
# Stuff I wanna change:
# 1) Read and set default values for the Skill class
# 2) Think of a good place to put "cast skill"
# 3) Case distinction for conditions that have duration lower than global timer
# 4) Build in a way to track other effects than damages of conditions (VULNERABILITY)
# 5) Change the p... | null | various.py | various.py | py | 6,970 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "json.load",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 198,
"usage_type": "call"
}
] |
430710126 | from skimage.io import imread, imshow
from PIL import Image
from skimage.transform import resize
import matplotlib.pyplot as pl
import numpy as np
from scipy import ndimage
import cv2 as cv
from keras.datasets import mnist
from skimage.color import rgb2gray
import csv
import pandas
from numpy import linalg a... | null | hog.py | hog.py | py | 3,891 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "scipy.ndimage.sobel",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "scipy.ndimage",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "scipy.ndimage.sobel",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "scipy.ndimage",... |
386768479 | import datetime
import flask
import random
import model
import string
import hashlib
import uuid
import requests
OPENWEATHERMAP_API_KEY = "55d79b326f3720654f6ab31b68231d4a"
from flask import request
from flask import url_for
N_USERS = 10
N_RECEIPES = 10
N_BOOKS = 10
app = flask.Flask(__name__)
db = model.db
db.cr... | null | Flask/main.py | main.py | py | 15,237 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask.Flask",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "model.db",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "requests.get",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "hashlib.blake2s",
"line_nu... |
81815726 | """Test the module SMOTE ENN."""
from __future__ import print_function
import os
import numpy as np
from numpy.testing import assert_raises
from numpy.testing import assert_equal
from numpy.testing import assert_array_equal
from sklearn.datasets import make_classification
from unbalanced_dataset.combine import SMOT... | null | Version0.9/unbalanced_dataset/combine/tests/test_smote_tomek.py | test_smote_tomek.py | py | 3,328 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sklearn.datasets.make_classification",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.testing.assert_raises",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "unbalanced_dataset.combine.SMOTETomek",
"line_number": 29,
"usage_type":... |
560285962 | from typing import Dict
from jury.metrics import Metric
__class_names__ = {"bertscore": "BERTScore"}
class BERTScore(Metric):
def __init__(self, metric_name: str = None, resulting_name: str = None, params: Dict = None):
metric_name = self.__class__.__name__ if metric_name is None else metric_name
... | null | jury/metrics/bertscore.py | bertscore.py | py | 906 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "jury.metrics.Metric",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "typing.Dict",
"line_number": 9,
"usage_type": "name"
}
] |
591259177 | from api import api, tw_api
from flask import jsonify, request
from api.helper import convert_resp2list, get_response
from TwitterAPI import TwitterPager
@api.route('/hashtags/<string:hashtag>', methods=['GET'])
def getByHashtags(hashtag):
"""
Returns the list of tweets with a given hashtag in JSON format
... | null | api/routes.py | routes.py | py | 1,645 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask.request.args.get",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "flask.request.args",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "api.help... |
394206275 | #!/usr/bin/python3
import nmap
import argparse
parser = argparse.ArgumentParser(version='0.1',description='Scan a network segment')
parser.add_argument('-r', action='store', required=True,
dest='addr', help='range of IPs to scan (cidr)')
parser.add_argument('-o', action='store', required=True,
dest="results", help... | null | converge.py | converge.py | py | 836 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "nmap.PortScanner",
"line_number": 18,
"usage_type": "call"
}
] |
496461256 | #!/usr/bin/env python3
import socket
import asyncore
import select
import random
import pickle
import time
BUFFERSIZE = 512
outgoing = []
minionmap = {}
bombs_map = []
class Minion:
def __init__(self, ownerid):
self.x = 50
self.y = 50
self.ownerid = ownerid
class Bomb:
def __init_... | null | server.py | server.py | py | 2,716 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pickle.loads",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "pickle.dumps",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "pickle.dumps",
"line_number": 73,
"usage_type": "call"
},
{
"api_name": "asyncore.dispatcher",
"lin... |
205551851 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.shortcuts import render
from rest_framework.generics import RetrieveUpdateDestroyAPIView, CreateAPIView
from .serializers import *
from appointments.models import *
from rest_framework.response import Response
from rest_framework import status... | null | billing/views.py | views.py | py | 3,061 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "rest_framework.generics.CreateAPIView",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "rest_framework.response.Response",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "rest_framework.status.HTTP_201_CREATED",
"line_number": 26,
"usage... |
442372127 | '''python -m unittest discover'''
import os
import sys
import unittest
import socketio
import gevent
from datetime import datetime
sys.path.append('../server')
sys.path.append('../interface')
os.environ['RH_INTERFACE'] = 'Mock'
import server
from Node import Node
class ServerTest(unittest.TestCase):
def setUp(s... | null | src/tests/test_server.py | test_server.py | py | 9,417 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.path.append",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "sys.path.append",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_numb... |
468941660 | from django.shortcuts import render
from django.shortcuts import redirect
from django.http import HttpResponse
from django.db.models import Avg
from .models import T1
# Create your views here.
def books_short(request):
### 从models取数据传给template ###
shorts = T1.objects.all()
# 评论数量
counter = T1.object... | null | week06/myDjango/index/views.py | views.py | py | 1,806 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "models.T1.objects.all",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "models.T1.objects",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "models.T1",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "models.T1.obje... |
582704129 | import json
import os
import uuid
import zmq
LOAD_BALANCER_PORT = 15600
LOAD_BALANCER_URL = 'tcp://localhost:%d' % LOAD_BALANCER_PORT
def main():
context = zmq.Context()
socket = context.socket(zmq.REQ)
socket.setsockopt(zmq.IDENTITY, str(uuid.uuid4()))
socket.connect(LOAD_BALANCER_URL)
socket.send('Hello, World... | null | src/Client/BadClient.py | BadClient.py | py | 359 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "zmq.Context",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "zmq.REQ",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "zmq.IDENTITY",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "uuid.uuid4",
"line_num... |
387303840 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | null | azure-cognitiveservices-vision-face/azure/cognitiveservices/vision/face/models/hair_color.py | hair_color.py | py | 1,215 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "msrest.serialization.Model",
"line_number": 15,
"usage_type": "name"
}
] |
563133987 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
def apply_display_order(apps, schema_editor):
initial_display_order = {1: 1, 4: 2, 5: 3, 2: 4, 3: 5}
PortalCategory = apps.get_model('v1', 'PortalCategory')
for category in PortalCategory.objects.all():
... | null | cfgov/v1/migrations/0164_apply_sort_order.py | 0164_apply_sort_order.py | py | 606 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.RunPython",
"line_number": 22,
"usage_type": "call"
},
... |
164798409 | import numpy as np
import pickle
import sys
import argparse
import os
def concatenate_all_residuals(residual_name, language, num_layers, model_type, layer, agg_type, total_batches):
final_residuals = []
for i in range(total_batches):
specific_file = "parallel-english-to-" + str(language) + "-model-" + str(num_laye... | null | get_residuals.py | get_residuals.py | py | 2,233 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pickle.load",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path.isdir",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "os.path",
"line... |
183820877 | #!/usr/bin/env python3
"""
A simple Python script to receive messages from a client over
Bluetooth using PyBluez (with Python 2).
"""
import bluetooth
import sys
bd_addr = "30:AE:A4:CC:26:12" #itade address
port = 1
sock=bluetooth.BluetoothSocket( bluetooth.RFCOMM )
sock.connect((bd_addr, port))
print('Connected')
s... | null | BT/testBT.py | testBT.py | py | 460 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "bluetooth.BluetoothSocket",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "bluetooth.RFCOMM",
"line_number": 11,
"usage_type": "attribute"
}
] |
522085113 | #!/usr/bin/python3
'''script start flask application to listen
on 0.0.0.0 port 5000 with variables'''
from flask import render_template
from flask import Flask
from models import State
from models import storage
app = Flask(__name__)
app.url_map.strict_slashes = False
@app.route('/states_list')
def city_by_state():... | null | web_flask/7-states_list.py | 7-states_list.py | py | 652 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask.Flask",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "models.storage.all",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "models.State",
"line_number": 17,
"usage_type": "argument"
},
{
"api_name": "models.storage",
"... |
25399138 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
def setMasterFundIndex(apps, schema_editor):
Fund = apps.get_model("fund", "Fund")
FundIndex = apps.get_model("fund", "FundIndex")
funds = Fund.objects.all()
indexes = FundIndex.objects.all()
... | null | fund/migrations/0004_master_fund_index_data.py | 0004_master_fund_index_data.py | py | 1,217 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.RunPython",
"line_number": 36,
"usage_type": "call"
},
... |
230017377 | from libs.hdf5datasetgeneratormultilabel import HDF5DatasetGenerator
from keras import layers
from keras.applications import DenseNet121, MobileNetV2,ResNet50
from keras.models import Sequential
from keras.optimizers import Adam
import pandas as pd
from sklearn.metrics import cohen_kappa_score, accuracy_score
import te... | null | old_balance_t1t2/5_ResNet50.py | 5_ResNet50.py | py | 2,119 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "keras.models.Sequential",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "keras.layers.GlobalAveragePooling2D",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "keras.layers",
"line_number": 19,
"usage_type": "name"
},
{
"api_name... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.