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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
147796046 | # -*- coding: utf-8 -*-
import numpy as np
import cv2
import math
from matplotlib import pyplot as plt
import os
from sklearn.metrics import mean_squared_error
def CalculaCovarianceMatrix(sobelx, sobely, x, y, Wc):
c11=0
c12=0
c22=0
for i in range(y-int(Wc/2), y+math.ceil(Wc/2)):
for j in rang... | null | lista2/src/detector_de_harris.py | detector_de_harris.py | py | 5,906 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "math.ceil",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "math.ceil",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 25,
... |
485699757 | from rest_framework import serializers
from disturbance.components.main.models import CommunicationsLogEntry, Region, District, Tenure, ApplicationType, ActivityMatrix
from ledger.accounts.models import EmailUser
class CommunicationLogEntrySerializer(serializers.ModelSerializer):
customer = serializers.PrimaryKeyR... | null | disturbance/components/main/serializers.py | serializers.py | py | 2,153 | python | en | code | null | code-starcoder2 | 83 | [
{
"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": "rest_framework.serializers.PrimaryKeyRelatedField",
"line_number": 6... |
649402784 | from apscheduler.schedulers.background import BackgroundScheduler
from apscheduler.triggers.cron import CronTrigger
from kalliope.core.ConfigurationManager import BrainLoader
from kalliope.core.SynapseLauncher import SynapseLauncher
from kalliope.core import Utils
from kalliope.core.Models import Event
class EventMa... | null | kalliope/core/EventManager.py | EventManager.py | py | 2,029 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "kalliope.core.Utils.print_info",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "kalliope.core.Utils",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "apscheduler.schedulers.background.BackgroundScheduler",
"line_number": 14,
"usage_type... |
413544109 | import torch
import torch.nn as nn
from torch.nn.utils.rnn import pad_packed_sequence, pack_padded_sequence
class BiLSTM(nn.Module):
def __init__(self, vocab_size, emb_size, hidden_size, out_size):
"""Initializing parameters:
vocab_size: size fo vocab
emb_size: dimension of word-vector... | null | models/bilstm.py | bilstm.py | py | 5,300 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "torch.nn.Module",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "torch.nn.Embedding",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_n... |
578601890 | import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.feature_extraction.text import TfidfVectorizer
from model import BaselineModel
# Load data set
with open('data/train_set.csv', 'rb') as train_data:
df = pd.read_csv(train_data, nrows=1000)
new_df_2 = []
for idx,row in df.iterro... | null | src/train.py | train.py | py | 843 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pandas.read_csv",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 20,
"usage_type": "call"
},
{
"api_name... |
314601777 | # -*- coding: utf-8 -*-
"""
Created on Tue Mar 31 14:36:25 2020
@author: metalcorebear
"""
import random
import networkx as nx
import numpy as np
import matplotlib.pyplot as plt
import os
from datetime import date as datemethod
from datetime import datetime
#Random output generator
def coin_flip(ptru... | null | model_functions.py | model_functions.py | py | 5,382 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "random.uniform",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "networkx.Graph",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 107,
"usage_type": "call"
},
{
"api_name": "numpy.average",
"line_... |
531532957 | import json
class ProxyPollen(object):
default_tags = {}
def __init__(self, tags, enums):
for t in tags:
self.default_tags[t.tag] = t(self, enums)
@classmethod
def _check(cls, value):
for t in cls.default_tags.values():
if t.check(value):
retur... | null | ctpbee/json/pollen.py | pollen.py | py | 979 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "json.loads",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "tag.tags",
"line_number": 45,
"usage_type": "name"
},
{
"api_name": "ctpbee.constant.enums",
"line_numb... |
264040495 | import zmq
import numpy as np
import time
import json
import math
port = 5555
context = zmq.Context()
print ("Connecting to server...")
socket = context.socket(zmq.REQ)
socket.connect ("tcp://localhost:%d" % port)
def make_data(path_len=100):
d = { 'x' : 0, 'y': -1, 'psi': 0.0, 'speed' : 1.0, 'ptsx' : [], 'ptsy' :... | null | test/test_mpc_zmq.py | test_mpc_zmq.py | py | 892 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "zmq.Context",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "zmq.REQ",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "math.sin",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 21,
... |
51031774 | import re
import copy
import functools
import datetime
import keyword
import base64
IDENTIFIER_RE = re.compile(r"^[^\d\W]\w*\Z", re.UNICODE)
KEYWORD_SET = set(keyword.kwlist)
# This roughly models a Qt QAbstractItemModel, but it has no Qt dependency.
# See apputils.models for the rest of that.
class Unassigned:
... | null | rtlib/reportcore.py | reportcore.py | py | 14,148 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "re.compile",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "re.UNICODE",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "keyword.kwlist",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "copy.deepcopy",
"line... |
148354197 | import json
from models.tortoise_models.ingestor_state import IngestorState
async def ingestor_state_parser(fullstring: str):
modified_string = fullstring.replace("ingestor_state:", "")
state_json = json.loads(modified_string)
return {
"state": IngestorState.service.get_state_name(state_json["mo... | null | packages/reporting-server/parsers/ingestor_state_parser.py | ingestor_state_parser.py | py | 369 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "json.loads",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "models.tortoise_models.ingestor_state.IngestorState.service.get_state_name",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "models.tortoise_models.ingestor_state.IngestorState.service"... |
33051704 | import sys
from logs import LOGGER
from config import DEFAULT_TABLE
def do_count(table_name, milvus_cli, mysql_cli):
if not table_name:
table_name = DEFAULT_TABLE
try:
if not milvus_cli.has_collection(table_name):
return None
milvus_num = milvus_cli.count(table_name)
... | null | solutions/medical/molecular_similarity_search/quick_deploy/server/src/operations/count.py | count.py | py | 612 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "config.DEFAULT_TABLE",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "logs.LOGGER.debug",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "logs.LOGGER",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "logs.LOGGER.error",... |
129135704 | import numpy as np
from tensorflow.keras.datasets import mnist
from sklearn.decomposition import PCA
from xgboost import XGBClassifier
(x_train, y_train), (x_test, y_test) = mnist.load_data()
x = np.append(x_train, x_test, axis=0)
print(x.shape) # (70000, 28, 28)
x = x.reshape(70000, 28*28)
# pca = PCA()
# x = pca.fi... | null | ml/m33_pca_mnist1_xgb.py | m33_pca_mnist1_xgb.py | py | 814 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "tensorflow.keras.datasets.mnist.load_data",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "tensorflow.keras.datasets.mnist",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "numpy.append",
"line_number": 7,
"usage_type": "call"
},
{
... |
335804119 | from Model.frame_container import FrameContainer
from Controller.run_attention import find_light_sources_candidates
from View.results_visually import display_results_visually
from Controller.SFM import calc_TFL_dist
from Model.building_dataset import get_crop_img, get_padding_img
from PIL import Image
import numpy as n... | null | SRC/Controller/TFL_manager.py | TFL_manager.py | py | 3,658 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.environ",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.keras.models.load_model",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "tensorflow.keras.models",
"line_number": 21,
"usage_type": "attribute"
},
{
"a... |
598191713 | from cart.views import CartViewSet, RentalItemViewSet, PurchaseItemViewSet
from common.routers import CustomExtendedSimpleRouter
router = CustomExtendedSimpleRouter()
cart = router.register(r'carts', CartViewSet)
cart.register(r'rentals', RentalItemViewSet, base_name='cart-rental-item',
parents_query_loo... | null | src/cart/urls.py | urls.py | py | 488 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "common.routers.CustomExtendedSimpleRouter",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "cart.views",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "cart.views.CartViewSet",
"line_number": 5,
"usage_type": "argument"
},
{
"api_... |
15245315 | from django.core.paginator import Paginator
from django.shortcuts import get_object_or_404
from django.template.loader import render_to_string
from django.template.response import TemplateResponse
from django.urls import reverse
from django.utils.translation import gettext as _
from django.views.generic.base import Vie... | null | wagtail/documents/views/chooser.py | chooser.py | py | 6,940 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "wagtail.admin.auth.PermissionPolicyChecker",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "wagtail.documents.permissions.permission_policy",
"line_number": 19,
"usage_type": "argument"
},
{
"api_name": "wagtail.admin.modal_workflow.render_modal_workflow... |
339909309 | import streamlit as st
import numpy as np
import pandas as pd
import cv2
import random
import glob
st.set_page_config(layout="wide")
# st.title('U-2 net & Swin Tranformer on Ghetty Images')
"""
# Human Pose Estimation
## Comparing Performance of OpenPose & AlphaPose
on Leeds DataSet
"""
st.markdown('##')
df = pd... | null | HumanPoseEstimation/first_app.py | first_app.py | py | 3,104 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "streamlit.set_page_config",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "streamlit.markdown",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "streamli... |
352416387 | from django.conf.urls import patterns, include, url
import mysite.views as views
import contact.views as c_views
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
(r'^admin/', include(admin.site.urls)),
(r'^hello/$', views.hello),
... | null | mysite/mysite/urls.py | urls.py | py | 875 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.contrib.admin.autodiscover",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.contrib.admin",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "django.conf.urls.patterns",
"line_number": 8,
"usage_type": "call"
},
{
"api... |
607058626 | import torch
import numpy as np
import os, sys
import re
import matplotlib.pyplot as plt
from logistic_regression import LogisticRegression
from torch.autograd.variable import Variable
from utils.metric import get_accuracy
from utils import utils
# %matplotlib inline
# %config InlineBackend.figure_format = 'svg'
MODE... | null | eps_vs_accuracy.py | eps_vs_accuracy.py | py | 1,971 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.walk",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "re.search",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "utils.utils.load_obj",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "utils.utils",
"line_number... |
224365130 | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn import init
from xnas.search_space.utils import build_activation, SEModule, make_divisible, get_same_padding
from xnas.core.config import cfg
class ConvLayer(nn.Module):
"""Standard convolution layers with CBR"""
def __init__(s... | null | xnas/search_space/standard_mobilenet.py | standard_mobilenet.py | py | 5,554 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "torch.nn.Module",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "torch.nn.Conv2d",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_nu... |
418538719 | from django.urls import path
from . import views
urlpatterns = [
path('', views.profile, name='profile'),
path('user_management/', views.user_management, name='user_management'),
path('edit_user/<int:user_id>/', views.edit_user, name='edit_user'),
path('delete_user/<int:user_id>/', views.delete_user, n... | null | profiles/urls.py | urls.py | py | 398 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.urls.path",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
17597370 | """Support for the EXASOL database.
Auto Increment Behavior
-----------------------
``IDENTITY`` columns are supported by using SQLAlchemy
``schema.Sequence()`` objects. Example:
from sqlalchemy import Table, Integer, String, Sequence, Column
Table('test', metadata,
Column('id', Integer,
... | null | sqlalchemy_exasol/base.py | base.py | py | 33,919 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "logging.getLogger",
"line_number": 78,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 80,
"usage_type": "call"
},
{
"api_name": "re.I",
"line_number": 81,
"usage_type": "attribute"
},
{
"api_name": "re.UNICODE",
"line_number"... |
481787857 | # THIS CODE USES CV3
import numpy as np
import cv2
import matplotlib.pyplot as plt
imgL = cv2.pyrDown( cv2.imread('../images/baby/view1_4000.png') ) # downscale images for faster processing
imgR = cv2.pyrDown( cv2.imread('../images/baby/view5_4000.png') )
# disparity range is tuned for 'aloe' image pair
window_size... | null | src/stereo_depthmap.py | stereo_depthmap.py | py | 909 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "cv2.pyrDown",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "cv2.pyrDown",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 8,
... |
324425533 | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
from pant... | null | tests/python/pants_test/backend/jvm/tasks/jvm_compile/test_zinc_utils.py | test_zinc_utils.py | py | 1,308 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pants_test.base_test.BaseTest",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "os.path.join",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "os.path.join"... |
129624181 | import matplotlib.pyplot as plt
from matplotlib import ticker
from enum import Enum
import os
import numpy as np
COLOR_LIST = ['r', 'g', 'b', 'm', 'c', 'y', 'k']
STYLE_LIST = ['-', '--', '-.', ':', '-', '--', '-.', ':']
class Mode(Enum):
NORMAL = 0
DC = 1
RTO = 2
DECOMPOSING = 3
ADJUST = 4
FEC... | null | Analyzer/src/draw_graph.py | draw_graph.py | py | 25,931 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "enum.Enum",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "enum.Enum",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "enum.Enum",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.text",
"line_numb... |
527111727 | #Calculate the coverage offer most frequent words
import re,collections
import matplotlib.pyplot as plt
import numpy as np
def get_words(file):
with open (file) as f:
words_box=[]
for line in f:
if re.match(r'[a-zA-Z0-9]*',line):#避免中文影响
words_box.extend(line.strip().spli... | null | wordFrequency.py | wordFrequency.py | py | 2,347 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "re.match",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "collections.Counter",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 79,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot... |
608884425 | from datetime import datetime
import uuid
from typing import List, Union
from fastapi import Depends, HTTPException, status, APIRouter
from . import logger
from .. import schema, auth, db, utils
from ..config import settings
from ..utils import metrics, tg
router = APIRouter(
prefix="/tasks",
tags=["tasks"],... | null | app/api/api_tasks.py | api_tasks.py | py | 4,174 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "fastapi.APIRouter",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "typing.List",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "uuid.UUID",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "fastapi.HTTPException",
... |
48314075 | import matplotlib.pyplot as plt
# Build the plot
fig, ax = plt.subplots()
schedulingAlgos = ['Relatively high\npriority to IO\nintensive processes', 'Relatively high\npriority to CPU\nintensive processes', 'Same priority to\n all processes']
x_pos = [0, 1, 2]
meanTicksTaken = [3905, 4181, 3215]
ax.... | null | plotPBS.py | plotPBS.py | py | 686 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.savefig",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "... |
529844114 | from sklearn.preprocessing import LabelEncoder
from read_data_1d_other_classifiers import read_data
from sklearn.model_selection import StratifiedKFold
from sklearn.naive_bayes import GaussianNB
import numpy as np
import random
from sklearn.metrics import accuracy_score
from sklearn.model_selection import train_test_sp... | null | train_naive_bayes_1d.py | train_naive_bayes_1d.py | py | 2,166 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "read_data_1d_other_classifiers.read_data",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.StratifiedKFold",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.LabelEncoder",
"line_number": 15,
... |
182896894 | import random
from collections import OrderedDict
from src.config import Config
from src.genetics.genotype import GenotypeException
class Chromosome:
def __init__(self, genotype):
"""Create a new chromosome with specific genotype. The genotype provides information about what genes is the
chromos... | null | src/genetics/chromosome.py | chromosome.py | py | 4,086 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "src.config.Config.instance",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "src.config.Config",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "random.shuffle",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "random.ra... |
449717912 | #!/usr/bin/python2.7
# coding: utf-8
# CreateDataset for Bonnet
import time # Importing the time library to check the time of code execution
import os
import argparse
from ruamel.yaml import YAML # for comments
# from google_images_download import google_images_download
from google_images_crawler import GoogleImages... | null | create_dataset.py | create_dataset.py | py | 11,035 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 254,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 254,
"usage_type": "attribute"
},
{
"api_name": "os.makedirs",
... |
559052586 | from pprint import pprint
from eveapimongo import MongoProvider
from pymongo.errors import BulkWriteError
print('Loading function')
def lambda_handler(event, context):
message = event['Records'][0]['Sns']['Message']
print("SNS Message: " + message)
if message == "pos-parsing-done":
PosDayJourna... | null | functions/posDayJournalBuilder/posDayJournalBuilder.py | posDayJournalBuilder.py | py | 2,769 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "eveapimongo.MongoProvider",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "eveapimongo.MongoProvider",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "pymongo.errors.BulkWriteError",
"line_number": 42,
"usage_type": "name"
},
{
... |
79215124 | #!/usr/bin/env python
# Copyright 2017 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import argparse
import os
import string
import subprocess
import sys
BUILD_PATH = os.path.dirname(os.path.dirname(os.path.abspath(__fil... | null | rust/build_target.py | build_target.py | py | 9,589 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.path.dirname",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_num... |
231959793 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Feb 24 14:35:59 2019
@author: vman
"""
import mne
import numpy as np
import pandas as pd
import multiprocessing
num_cores = multiprocessing.cpu_count()
import fnmatch
from copy import deepcopy as dcopy
import os
homeDir = '/home/vman/Documents/uncerta... | null | glm_power_subject_ROI_v0.py | glm_power_subject_ROI_v0.py | py | 9,407 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "multiprocessing.cpu_count",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.chdir",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.sep",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "os.sep",
"line_num... |
139293607 | import matplotlib as mpl
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from scipy.interpolate import interp2d
import numpy as np
import os
def plot_data(ID, model_dir='./Data/', Rm_Outliers=False, Filter=True, Plot_Error=False, HIRES=False):
mpl.style.use('classic')
if HIRES:
... | null | Poisson_Varying_Domain/Setup/setup_reader.py | setup_reader.py | py | 4,432 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "matplotlib.style.use",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "matplotlib.style",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "numpy.load",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.min",
... |
473776798 | from flask import Flask, render_template
app = Flask(__name__)
posts = [
dict(author='Paul Browne', title='Blog Post 1', content='First post content', date_posted='November 26, 2020'),
{
'author': 'Christine Hanselmann',
'title': 'Blog Post 2',
'content': 'Second post content',
... | null | flaskblog.py | flaskblog.py | py | 610 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "flask.Flask",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 22,
"usage_type": "call"
}
] |
570423599 | import asyncio
import json
import websockets
import random
users = set()
usernames = []
playerNum = 0
randomNumbers = [0]
websocketIndex = {}
def users_event():
#count = 0
#for username in usernames:
list = websocketIndex.values()
newlist = []
for item in list:
newlist.app... | null | src/server.py | server.py | py | 2,724 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "json.dumps",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "asyncio.wait",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_num... |
558735778 | import pandas as pd
import numpy as np
from mlxtend.frequent_patterns import apriori, association_rules
import matplotlib.pyplot as plt
##df = pd.read_csv('https://gist.githubusercontent.com/Harsh-Git-Hub/2979ec48043928ad9033d8469928e751/raw/72de943e040b8bd0d087624b154d41b2ba9d9b60/retail_dataset.csv', sep=',')
df... | null | mymovies.py | mymovies.py | py | 1,600 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pandas.read_csv",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "mlxtend.frequent_patt... |
292868156 | from __future__ import unicode_literals
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
operations = [
migrations.CreateModel(
name='Member',
fields=[
... | null | locationUpdator/updator/migrations/0001_initial.py | 0001_initial.py | py | 2,856 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.CreateModel",
"line_number": 13,
"usage_type": "call"
},
... |
93258744 | #!/usr/bin/python
"""
-----------------------------------------------
DTX Select All Controls
Written By: Colton Fetters
Version: 1.0
First release: 12/19/2016
--------------------------------------------------
"""
import maya.cmds as cmds
class SelectControls(object):
def do_select_all_ctrls(self,... | null | _temp/work_temp/dtx_anim_tools/char_sel_tool.py | char_sel_tool.py | py | 1,807 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "maya.cmds.ls",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "maya.cmds",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "maya.cmds.listRelatives",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "maya.cmds",
"line_... |
251760735 | from __future__ import division
import numpy as np
from skimage.util.dtype import dtype_range
from skimage._shared.utils import skimage_deprecation, warn
import matplotlib.pyplot as plt
from skimage.measure import compare_ssim as ssim
import cv2
#check the numpy array
def _assert_compatiable(imageA, imageB):
if no... | null | Evaluate.py | Evaluate.py | py | 5,184 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "numpy.result_type",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.float32",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "numpy.sum",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "numpy.mean",
"line... |
384041252 | from flask import render_template, session, request
from flask_wtf import FlaskForm
from wtforms import StringField, HiddenField
from wtforms.validators import DataRequired, Length
class SearchObject(object):
class SearchBar(FlaskForm):
search_bar = StringField("SearchBar", validators=[], default='')
... | null | backend/admin/search_helper_admin.py | search_helper_admin.py | py | 2,712 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "flask_wtf.FlaskForm",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "wtforms.StringField",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "wtforms.HiddenField",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "wtforms.va... |
218345668 | from pprint import pprint
import glob, os
import base64
import cv2
import numpy as np
from TTNT import detect_output
from detect_output import save_a_img
# a = 1,2,3
# b= x,y,z
# zip(a,b) =(1,x)(2,y)(3,z)
def assign_to_line(list_boxes, list_class, list_conf):
zipped_list = zip(list_boxes, list_class, list_conf)... | null | plate_opencv.py | plate_opencv.py | py | 9,079 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "cv2.dnn_DetectionModel",
"line_number": 69,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 74,
"usage_type": "call"
},
{
"api_name": "cv2.getTextSize",
"line_number": 90,
"usage_type": "call"
},
{
"api_name": "cv2.FONT_HERSHEY_SI... |
637608390 | #coding:utf-8
import user_agents
from settings import TResource, TOnline, TMacHistory, TBDManager, TBDAccount
from collections import Counter
from datetime import datetime
def get_ap_online_status(self, _location):
online_count = self.mdb.list.find({'online': '1', '_location': {'$regex': _location}}).count()
... | null | statis.py | statis.py | py | 5,133 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "settings.TResource",
"line_number": 30,
"usage_type": "argument"
},
{
"api_name": "settings.TResource._location.like",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "settings.TResource._location",
"line_number": 30,
"usage_type": "attribute"
},... |
525683679 | from .import verify
from flask_httpauth import HTTPTokenAuth
from auth import verify
from flask import g,make_response
tokenauth = HTTPTokenAuth()
tokens = {
'secret-token-1':'john',
'secret-token-2':'susan'
}
@tokenauth.verify_token
def verify_token(token):
if token in tokens:
g.current_user = to... | null | auth/tokenauth.py | tokenauth.py | py | 578 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "flask_httpauth.HTTPTokenAuth",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "flask.g.current_user",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "flask.g",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "flask.m... |
225766683 | from game.data.creatures.monster_loader import *
from game.data.item.item_loader import *
from game.data.spells.spell_loader import *
from game.manager import MONSTERS, ITEMS, SPELLS
from game.player import Player
import json
import yaml
import sys
import os
gamename = 'game'
class Game:
player = N... | null | rpg/game/main.py | main.py | py | 9,249 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.system",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "os.system",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "os.system",
"line_number": 40,
"... |
237004378 | from netaddr import IPNetwork
class LabelDict(dict):
"""Wrapper around dict to render labels"""
def get_labels(self):
"""Prefix and replace invalid key chars for prometheus labels"""
return {
"__meta_netbox_" + str(key.replace("-", "_").replace(" ", "_")): val
for key,... | null | netbox_prometheus_sd/api/utils.py | utils.py | py | 2,087 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "netaddr.IPNetwork",
"line_number": 46,
"usage_type": "call"
}
] |
650649449 | from django.shortcuts import render
from django import forms
from django.views.decorators import csrf
from django.views.decorators.csrf import csrf_exempt
from django.http import JsonResponse
import csv
import sys
sys.path.append('/predictor')
from predictorR import predictRuns
class Newinput(forms.Form):
teams=(
... | null | predictor/views.py | views.py | py | 2,781 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sys.path.append",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "django.forms.Form",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
... |
148196943 | import argparse
parser = argparse.ArgumentParser()
parser.add_argument("FILE", help="file that is analyzed")
parser.add_argument("-l", "--lines", help="print the newline counts", action="store_true")
parser.add_argument("-w", "--words", help="print the word counts", action="store_true")
parser.add_argument("-c", "--ch... | null | wc.py | wc.py | py | 1,012 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 3,
"usage_type": "call"
}
] |
32724219 | import asyncio
import shutil
from functools import cached_property
from pathlib import Path
from typing import Optional
import aiopath
from datafiles import datafile, field
from furl import furl
from sanic import Sanic
from sanic.log import logger
from .. import settings, utils
from ..types import Dimensions
from .ov... | null | app/models/template.py | template.py | py | 8,417 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "typing.Optional",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "text.Text",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "datafiles.field",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "text.Text",
"line_numbe... |
495208864 | # -*- coding: Utf-8 -*-
from PyQt5 import QtCore, QtDBus
name_interface_pf = 'com.vektor'
class ARM_InterfaceAdaptor(QtDBus.QDBusAbstractAdaptor):
QtCore.Q_CLASSINFO("D-Bus Interface", name_interface_pf)
QtCore.Q_CLASSINFO("D-Bus Introspection", ''
' <interface name="com.vektor">\n'
... | null | common_blocks/interface_procces/arm_interface_adaptor.py | arm_interface_adaptor.py | py | 879 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "PyQt5.QtDBus.QDBusAbstractAdaptor",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "PyQt5.QtDBus",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtCore.Q_CLASSINFO",
"line_number": 8,
"usage_type": "call"
},
{
"api_nam... |
44964673 |
from __future__ import division
from __future__ import with_statement
from __future__ import print_function
from collections import OrderedDict
import torch
import torch.nn as nn
import os
import torch.optim as optim
from torch.utils import model_zoo
from torch.utils.data import Dataset, DataLoader
import numpy as np
... | null | c3dgrad/ress.py | ress.py | py | 3,914 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "numpy.random.seed",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "pandas.read_csv",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.random.perm... |
323748773 | import numpy
import matplotlib.pyplot as plt
def nSidedDie(p):
n = len(p)
cumulative = numpy.cumsum(p)
cumlist = numpy.append(0, cumulative)
rand = numpy.random.rand()
for k in range(0, n):
if rand > cumlist[k] and rand <= cumlist[k + 1]: #random number will always be bigger than the starti... | null | EE381/EE381 Python HW/Lab6/part3.py | part3.py | py | 1,629 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "numpy.cumsum",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "numpy.append",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.random.rand",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_num... |
27505966 | from flask import Flask, render_template, request, redirect
from apscheduler.schedulers.background import BackgroundScheduler
from urllib.parse import urlencode
import atexit
import sheets_api
import requests
# import sqlite3
# from urllib.request import Request, urlopen
app = Flask(__name__)
scheduler = None
data_bu... | null | app.py | app.py | py | 7,040 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "flask.Flask",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sheets_api.buffer",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "sheets_api.sign_in",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "sheets_api.addMultip... |
18619063 | # -*- coding: utf-8 -*-
import scrapy
from scrapy.selector import Selector, HtmlXPathSelector
from scrapy.http import Request
class PchomeSpider(scrapy.Spider):
name = 'pchome'
start_urls = ["https://shopping.pchome.com.tw/"]
HEADERS = {
# pchome 有檢察是否包含referer
"Referer": "https://shopping... | null | SelfLearn/爬蟲/190211_爬蟲練習/190211_PChome/myscrapy/myscrapy/spiders/pchome.py | pchome.py | py | 1,295 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "scrapy.Spider",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "scrapy.http.Request",
"line_number": 19,
"usage_type": "call"
}
] |
273107244 | import socket
import sys
import threading
import Channel
import User
import Util
import datetime
import argparse
class Server:
SERVER_CONFIG = {"MAX_CONNECTIONS": 15}
HELP_MESSAGE = """\n> The list of commands available are:
/HELP - ... | null | ChatServer.py | ChatServer.py | py | 19,056 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "socket.gethostbyname",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "threading.Event",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.today",
"line_number": 63,
"usage_type": "call"
},
{
"api_name": "datetime... |
570914241 | import requests
import re
from bs4 import BeautifulSoup
def PlayerScrape(url):
r = requests.get(url)
soup = BeautifulSoup(r.content)
name = soup.find_all("h1")
if name != []:
name = name[0].text.encode('ascii', 'ignore')
rows = soup.find_all("tr")
headers = soup.find_all("th", {"class": "tooltip"})
col... | null | Player Projection/cbballref_scrape.py | cbballref_scrape.py | py | 4,447 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "requests.get",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_numb... |
557536887 | from mmseg.datasets.builder import DATASETS
from mmseg.datasets.custom import CustomDataset
@DATASETS.register_module()
class CPSDataset(CustomDataset):
CLASSES = ('background', 'colon_polyp')
PALETTE = [[120, 120, 120], [6, 230, 230]]
def __init__(self, **kwargs):
super(CPSDataset, self).__init... | null | dataset_and_pipelines/cps_dataset.py | cps_dataset.py | py | 771 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "mmseg.datasets.custom.CustomDataset",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "mmseg.datasets.builder.DATASETS.register_module",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "mmseg.datasets.builder.DATASETS",
"line_number": 5,
"us... |
57196818 | #!/usr/bin/env python
__author__ = 'Stephen P. Henrie'
__license__ = 'Apache 2.0'
from interface.services.ans.iworkflow_management_service import BaseWorkflowManagementService
from pyon.util.containers import is_basic_identifier
from pyon.core.exception import BadRequest, NotFound, Inconsistent
from pyon.public impo... | null | ion/services/ans/workflow_management_service.py | workflow_management_service.py | py | 12,863 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "interface.services.ans.iworkflow_management_service.BaseWorkflowManagementService",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "pyon.util.containers.is_basic_identifier",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "pyon.core.exception.Ba... |
61430057 | # -*- coding: utf-8 -*-
from urllib.request import urlopen
from urllib.error import HTTPError
from bs4 import BeautifulSoup
import sys
def getTitle(url):
try:
html = urlopen(url)
#上行代码可能出现两种错误
#error1:网页在服务器上不存在或者获取页面发生错误
# 返回HTTPError:【404 page not found】or 【500 internal server error】等
#error2:服务器不存在
#... | null | chapter1/3-exceptionHandling.py | 3-exceptionHandling.py | py | 1,196 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "urllib.request.urlopen",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "urllib.error.HTTPError",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 23,
"usage_type": "call"
}
] |
159507708 | import urllib.request as rq
from hashlib import sha1
from bs4 import BeautifulSoup
import json
import time
import data_processing
current_webpage = rq.urlopen('https://www.binance.com/en/support/announcement/c-48').read()
soup = BeautifulSoup(current_webpage,'lxml')
current_data = json.loads(soup.find('script', id='... | null | binance_listings_twitter/binance_page.py | binance_page.py | py | 1,818 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "urllib.request.urlopen",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "urllib.request",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "json.loads",
... |
358968721 | import random
import torch
import numpy as np
import argparse
import os
from utils import WordVocabulary, LabelVocabulary, Alphabet, build_pretrain_embedding, my_collate_fn, lr_decay
import time
from dataset import MyDataset
from torch.utils.data import DataLoader
from model import NamedEntityRecog
import torch.optim a... | null | infer.py | infer.py | py | 4,160 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "random.seed",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "torch.manual_seed",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.random.seed",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"l... |
493458039 | #Go to https://polisci.wustl.edu/faculty/specialization
#Go to the page for each of the professors.
# Create a .csv file with the following information for each professor:
# -Specialization
# -Name
# -Title
# -E-mail
# -Web page
from bs4 import BeautifulSoup
import urllib2
import random
import time
import os
imp... | null | Class4-WebScraping/lab4.py | lab4.py | py | 1,733 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "urllib2.urlopen",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "urllib2.urlopen",
"line_... |
432055416 | """定义learning_logs的URL模式"""
from django.urls import path # 导入path 将URL映射到视图
from . import views # 导入模块views 句点. 让python从当前urls.py 模块所在的文件夹导入views.py
app_name = 'learning_logs' # 命名空间 name 属性指定别名
urlpatterns = [
# 主页
path('', views.index, name='index'),
# 显示所有主题
path('topics/', views.topics, name='topics'),
... | null | learning_logs/urls.py | urls.py | py | 1,861 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.urls.path",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "django.urls.path",... |
289703912 | '''
@Author : sean cheng
@Email : aya234@163.com
@CreateTime : 2022/9/9
@Program :
'''
from cocos.layer import Layer
from pyglet.gl import *
class BackgroundLayer(Layer):
def __init__(self, bg_name):
super().__init__()
if bg_name == "title":
self.... | null | renju/source/background.py | background.py | py | 585 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "cocos.layer.Layer",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "pyglet.gl.resource.image",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pyglet.gl.resource",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "py... |
83486087 | # 윈도우창 띄우기
# 필요한 모듈 불러오기. 기본적 UI 구성요소를 제공하는 위젯(클래스)들은
# PyQt.QtWidgets 모듈에 포함되어 있다. 상세설명은 QtWidget 공식문서 참조
# http://pyqt.sourceforge.net/Docs/PyQt5/QtWidgets.html#PyQt5-QtWidgets
import sys
from PyQt5.QtWidgets import QApplication, QWidget
class MyApp(QWidget):
def __init__(self):
super().__init__()
... | null | Lesson11_GUI/t1101FirstWindow.py | t1101FirstWindow.py | py | 1,077 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "PyQt5.QtWidgets.QWidget",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtWidgets.QApplication",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "sys... |
573280790 |
# coding=utf-8
from pprint import pprint
from . import category
from ..object import Show, Listing, Category
from flask import Blueprint
blueprint = Blueprint('routes', __name__, template_folder='templates')
@blueprint.route('/')
def root():
return category.root(None)
@blueprint.route('/debug')
def debug():
... | null | mokuroku/routes/main.py | main.py | py | 663 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "flask.Blueprint",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "object.Listing.get_by_category",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "object.Listing",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "object.... |
348247193 | from django.http import Http404, JsonResponse, HttpResponseBadRequest
from rest_framework import status
from rest_framework.permissions import IsAuthenticated
from rest_framework.response import Response
from rest_framework.views import APIView
from club.models.money import MoneySerializer, Money
class MoneyList(API... | null | club/views/moneys.py | moneys.py | py | 1,812 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "rest_framework.views.APIView",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "rest_framework.permissions.IsAuthenticated",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "rest_framework.response.Response",
"line_number": 17,
"usage_type... |
561233660 | from tkinter import *
from PIL import ImageTk, Image
root = Tk()
root.title("Learning GUI using tkinter")
root.iconbitmap("C:\\Users\\Vin\\Downloads\\Custom-Icon-Design-Mono-Business-2-Coffee.ico")
my_img = Image.open("C:\\Users\\Vin\\Desktop\\edBM5X.jpg")
my_img = my_img.resize((250, 250), Image.ANTIALIAS)
my_img =... | null | GUI_tkinter/Icons_images_exit_buttons.py | Icons_images_exit_buttons.py | py | 496 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "PIL.Image.open",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "PIL.Image.ANTIALIAS",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "PIL.Image",
"line... |
561182294 | from tripod2.items.streams.mets import Tripod2METSFile as Tripod2METSFileBase
from tripod2.local import owners
from django.conf import settings
import logging
logger = logging.getLogger('console')
SIZE_10_OFFSETS = ['bdsfl', 'bdsde', 'bdsdc', 'bdsny', 'bdsnb','bdsla', 'bdsnh', 'bdsms', 'bdsct', 'bdsia', 'bdsin', 'bds... | null | local/mungers/contentdm2mets/broadsides.py | broadsides.py | py | 1,648 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "logging.getLogger",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.conf.settings.LS_BASE_PATH",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "django.conf.settings",
"line_number": 23,
"usage_type": "name"
},
{
"api_... |
321091932 | #!/usr/bin/env python3
import asyncore
import logging
import socket
class EchoServer(asyncore.dispatcher):
def __init__(self, address):
self.logger = logging.getLogger("EchoServer")
super().__init__()
self.create_socket(socket.AF_INET, socket.SOCK_STREAM)
self.bind(address)
... | null | network_communication/_asyncore/asyncore_echo_server.py | asyncore_echo_server.py | py | 1,871 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "asyncore.dispatcher",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "socket.AF_INET",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "socket.... |
574910816 | #http://api.mongodb.com/python/current/tutorial.html
from pprint import pprint
from cfg_server import MONGODB_USER, MONGODB_PASSWORD, MONGODB_DATABASE, MONGODB_COLLECTION, MONGODB_URI
from pymongo import MongoClient, ASCENDING, DESCENDING
from pymongo.errors import ConnectionFailure
from bson.objectid import ObjectId... | null | Python/db_mongo_api.py | db_mongo_api.py | py | 5,349 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pymongo.MongoClient",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "cfg_server.MONGODB_URI",
"line_number": 18,
"usage_type": "argument"
},
{
"api_name": "cfg_server.MONGODB_DATABASE",
"line_number": 20,
"usage_type": "name"
},
{
"api_na... |
83314998 | from django.shortcuts import render_to_response
from django.template import RequestContext
from django.http import HttpResponseRedirect, HttpResponse
from ventures.volunteers.forms import InfoForm
from ventures.volunteers.models import Volunteer
def index(request):
if request.method == 'POST':
form = Info... | null | ventures/volunteers/views.py | views.py | py | 844 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "ventures.volunteers.forms.InfoForm",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.http.HttpResponse",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render_to_response",
"line_number": 15,
"usage_type": "call"... |
60269591 | import pickle
import csv
from pathlib import Path
import argparse
import pandas as pd
def run():
parser = argparse.ArgumentParser()
parser.add_argument(
"--input-gwas-file",
required=True,
type=str,
)
parser.add_argument(
"--common-variant-ids-file",
required=T... | null | nbs/15_gsa_gls/20-null_simulations/10_gwas_harmonization/15_common_variant_ids.py | 15_common_variant_ids.py | py | 1,429 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "pandas.read_table",
... |
594446269 | #PlatformBotProj
from . import model
from . import replay
import numpy as np
import torch
import torchvision
import gym
import PIL
import retro
import os
import threading
import itertools
from .replay import ReplayMemory
class PlatformBot:
def __init__(self):
self.device = "cuda"
self.save_path = ... | null | CNN PJ3 Code/platformerbot-master/PlatformerBot/bot.py | bot.py | py | 12,648 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "torch.optim.Adam",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "torch.optim",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "torch.tensor",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "torch.float",
"lin... |
61492836 | from flask import Flask, redirect, url_for, render_template, request
import os
import controller
app = Flask(__name__)
picFolder = os.path.join('/static')
app.config['UPLOAD_FOLDER'] = picFolder
@app.route("/", methods=['GET', 'POST'])
def home():
FinPic = os.path.join(app.config['UPLOAD_FOLDER'], 'FINNEAS.png'... | null | app.py | app.py | py | 2,910 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "flask.Flask",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": ... |
399969232 | #!/usr/bin/env python
# encoding: utf-8
import os
import numpy as np
import scipy as sp
import matplotlib as mpl
mpl.rcParams['pdf.fonttype'] = 42
import matplotlib.pylab as plt
import seaborn as sns
import pandas as pd
from IPython import embed as shell
from sim_tools import DDM_traces_get, one_accumulater_traces_ap... | null | simulations/1_ddm_rts.py | 1_ddm_rts.py | py | 6,130 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "matplotlib.rcParams",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "seaborn.set",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "seaborn.plotting_context",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "sim_tool... |
89675361 | #!/usr/bin/python3
# -*- coding: utf-8 -*-
import argparse
import collections
import json
import sys
import numpy as np
def eprint(*args, **kwargs):
print(*args, file=sys.stderr, **kwargs)
def traverse(obj,path):
if isinstance(obj,dict):
for k,v in obj.items():
for c,w in traverse(v,path+... | null | jsonl_fstats/jsonl_fstats.py | jsonl_fstats.py | py | 6,241 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sys.stderr",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "sys.stderr",
"line_number": 58,
"usage_type": "attribute"
},
{
"api_name": "sys.stdin",
... |
284605827 | import argparse
import json
from geopy import distance
def load_data(filepath):
with open(filepath, 'r') as json_file:
return json.load(json_file)['features']
def get_biggest_bar(bars_info):
biggest_bar_info = max(
bars_info,
key=lambda bar: bar['properties']['Attributes']['SeatsCou... | null | bars.py | bars.py | py | 2,138 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "json.load",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "geopy.distance.distance",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "geopy.distance",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "argparse.ArgumentPars... |
299505982 | #!/usr/bin/env python3
import nessus_file_reader as nfr
import os
import glob
import traceback
import time
import sys
import csv
csvwriter = csv.writer(sys.stdout,quoting=csv.QUOTE_ALL)
from datetime import date
today = date.today()
mmddYY = today.strftime("%m/%d/%Y")
if len(sys.argv) == 1:
print('please provid... | null | parse-nessus-xml.py | parse-nessus-xml.py | py | 3,282 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "csv.writer",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sys.stdout",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "csv.QUOTE_ALL",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "datetime.date.today",
... |
347497509 | from django.urls import path, include
from django.conf import settings
from . import views
from django.views.static import serve
urlpatterns = [
path('', views.index, name='index'),
path('searchResults', views.searchBar, name='search'),
path('viewPost/<int:post_id>/', views.viewPost, name='viewPost'),
... | null | wikiProject/wikiApp/urls.py | urls.py | py | 1,064 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
338880344 | import json
import requests
from flask import url_for
from config import Config
PAY_API_URL = 'https://sandbox-api-pay.line.me/v2/payments/request'
CONFIRM_API_URL = 'https://sandbox-api-pay.line.me/v2/payments/{transactionId}/confirm'
class LinePay:
def __init__(self, currency='TWD'):
self.channel_id =... | null | models/linepay.py | linepay.py | py | 2,017 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "config.Config.LINE_PAY_ID",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "config.Config",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "config.Config.LINE_PAY_SECRET",
"line_number": 14,
"usage_type": "attribute"
},
{
"a... |
8563035 | #!/usr/bin/python3
'''
License (MIT)
Copyright (c) 2016 by Magnus Erik Hvass Pedersen
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, including without limitation the rights to... | null | archived_code/sed_train_cnn_eq.py | sed_train_cnn_eq.py | py | 19,190 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "tensorflow.truncated_normal",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "tensorflow.Variable",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "tensorflow.constant",
"line_number": 59,
"usage_type": "call"
},
{
"api_name": "t... |
136513517 | from flask import Flask, render_template, jsonify, redirect
from flask_pymongo import PyMongo
import scrape_mars as scrape1
app = Flask(__name__)
mongo = PyMongo(app)
@app.route('/scrape')
def scrape():
data = scrape1.strip()
return data
@app.route('/')
def index():
return render_templat... | null | app.py | app.py | py | 380 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "flask.Flask",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "flask_pymongo.PyMongo",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "scrape_mars.strip",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "flask.render_templa... |
615063408 | from django import forms
from .models import Oglas
class Forma_postavljanja_oglasa(forms.ModelForm):
class Meta:
model = Oglas
fields = ["naslov", "tekst", "vidljivost",
#"datum",
];
# vidljivost = forms.ChoiceField(
# label="Видљивост"
... | null | oglasi/forms.py | forms.py | py | 1,772 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.forms.ModelForm",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "models.Oglas",
"line_number": 6,
"usage_type": "name"
}
] |
603023114 | from kivy.uix.screenmanager import (ScreenManager, Screen,
FallOutTransition, RiseInTransition)
from kivy.uix.behaviors.focus import FocusBehavior
class Manager(ScreenManager):
def __init__(self):
super(Manager, self).__init__()
self.history = []
def en... | null | pytt/manager.py | manager.py | py | 1,887 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "kivy.uix.screenmanager.ScreenManager",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "kivy.uix.screenmanager.RiseInTransition",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "kivy.uix.screenmanager.FallOutTransition",
"line_number": 45,
... |
488184872 | import numpy as np
from scipy.optimize import curve_fit
def func(x, a, b, c):
return a * np.exp(-b * x) + c
xdata = np.linspace(0, 4, 50)
y = func(xdata, 2.5, 1.3, 0.5)
y_noise = 0.2 * np.random.normal(size=xdata.size)
ydata = y + y_noise
popt, pcov = curve_fit(func, xdata, ydata)
popt, pcov = curve_fit(fu... | null | T2/curvefittest.py | curvefittest.py | py | 364 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "numpy.exp",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "numpy.linspace",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.random.normal",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_... |
509126605 | import psycopg2, json, codecs
conn = psycopg2.connect(host="localhost", user="postgres", password="Kkutu0410!", database="main")
cur = conn.cursor()
# DB에서 경쟁전 정보 추출
cur.execute("select * from kkutu_competition;")
dbUserList = cur.fetchall()
outString = ""
forSearch = []
# 경쟁전 참여여부 확인
for userId, tier, count in d... | null | R3turn-ExtraScripts/KkuTu Competition - Attendant Listing/main.py | main.py | py | 1,455 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "psycopg2.connect",
"line_number": 3,
"usage_type": "call"
}
] |
1807086 | """
##プログラム概要
- 手法Aの概要版
- 被験者に知っているひみつ道具を入力させる
+ 質問形式(ランダム)
+ 入力した結果から被験者の知識リストを作成
- 学習済みモデルに入力
+ 既知と推測される語をリスト化
- 推定結果を出力
"""
from keras.models import Sequential
from keras.layers import Dense, Activation, Dropout
from keras.optimizers import SGD
from sklearn.model_selection import train_test_split
from keras.mod... | null | predict_main_himitsu_5.py | predict_main_himitsu_5.py | py | 5,244 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "random.sample",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 97,
"usage_type": "call"
},
{
"api_name": "himitsu_data_gd_5.mk_allword_list",
"line_number": 133,
"usage_type": "call"
},
{
"api_name": "himitsu_... |
308269547 | from django.shortcuts import render, render_to_response, HttpResponseRedirect,HttpResponse, get_object_or_404
from django.contrib.auth.decorators import login_required
from encuestas.models import GRAFICAS_GUARDADAS,FILTROS,USUARIOS,FORMULARIO,FORMULARIO_TITULACION,FORMULARIO_PREGUNTA,BANCO_PREGUNTAS,BANCO_RESPUESTAS,P... | null | alumnos-egresados/encuestas/informes.py | informes.py | py | 2,470 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "encuestas.models.FORMULARIO.objects.all",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "encuestas.models.FORMULARIO.objects",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "encuestas.models.FORMULARIO",
"line_number": 17,
"usage_... |
409763412 | import json
import logging
from dataclasses import asdict
from typing import List, Optional
import tldextract
from models.tls_result import TlsResult
from sslyze import (JsonEncoder, ScanCommand, Scanner, ServerConnectivityInfo,
ServerConnectivityTester,
ServerNetworkLocationVia... | null | scans/tls_scan.py | tls_scan.py | py | 4,286 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sslyze.ScanCommand.SSL_2_0_CIPHER_SUITES",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "sslyze.ScanCommand",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "sslyze.ScanCommand.SSL_3_0_CIPHER_SUITES",
"line_number": 19,
"usage_typ... |
163550697 | #!/usr/bin/env python
#encoding:utf-8
"""
tasks/package.py
author: px
"""
from src.tasks import celery
from src.misc.build import Build
from celery.utils.log import get_task_logger
logger = get_task_logger(__name__)
@celery.task(bind=True, default_retry_delay=60, max_retries=3)
def package_service(self, service_id,... | null | src/tasks/package.py | package.py | py | 1,607 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "celery.utils.log.get_task_logger",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "src.misc.build.Build",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "src.tasks.celery.task",
"line_number": 15,
"usage_type": "call"
},
{
"api_n... |
479704143 | __all__ = (
'create_requests_http_connection_factory',
)
import typing
from elasticsearch import RequestsHttpConnection
from requests.adapters import (
DEFAULT_POOLBLOCK,
DEFAULT_POOLSIZE,
DEFAULT_RETRIES,
HTTPAdapter,
)
from urllib3.util.retry import Retry
# https://stackoverflow.com/questions/... | null | chatora/elasticsearch_ext/connection/http_requests.py | http_requests.py | py | 1,579 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "typing.Callable",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "typing.Union",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "urllib3.util.retry.Retry",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "elast... |
459258283 | import requests
# from collections import namedtuple
from time import sleep
import xml.etree.ElementTree as ET
from .models import GoodReadsData
from dexer.settings import GOODREADS_KEYS
import random
# GoodReadsBook = namedtuple("GoodReadsBook", [
# "gr_id", "nr_reviews", "nr_text_reviews", "pub_year", "pub_month... | null | dexer/caudexer/goodreads.py | goodreads.py | py | 2,683 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "time.sleep",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "xml.etree.ElementTree.fromstring",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "xml.etree.El... |
547560629 | import json
import folium
import pandas as pd
import urllib.request
import webbrowser
from map_test.config import *
def get_request_url(url):
req = urllib.request.Request(url)
req.add_header("X-Naver-Client-Id", client_id)
req.add_header("X-Naver-Client-Secret", client_secret)
try:
response = u... | null | Python/BookEX/map_test/chickenstore_map.py | chickenstore_map.py | py | 1,992 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "urllib.request.request.Request",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "urllib.request.request",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "urllib.request",
"line_number": 9,
"usage_type": "name"
},
{
"api_name":... |
566961348 | import numpy as np
from flask import Flask, request, jsonify
from flask_restful import Resource, Api
import pickle, sys
from models import Model
app = Flask(__name__)
api = Api(app)
with open('model.p', 'rb') as file:
model = pickle.load(file)
with open('lat_dict.p', 'rb') as file:
lat_dict = pickle.load(fi... | null | prediction_model/server.py | server.py | py | 1,920 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "flask.Flask",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "flask_restful.Api",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"line_numbe... |
504671793 | """
This module contains an example how to use methods from GaNode class.
"""
from bitstring import BitArray
from ga_node import GaNode
def main():
# creating GA tree
root = GaNode('--', BitArray(bin = '0110000001100000'))
my1 = GaNode('A+', BitArray(bin = '0111000001100000'), parent=root)
my2 = Ga... | null | ga_node_ilustration_01.py | ga_node_ilustration_01.py | py | 832 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "ga_node.GaNode",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "bitstring.BitArray",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "ga_node.GaNode",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "bitstring.BitArray",... |
300673251 |
import requests
global business_list
def search(term, location, api_key):
global business_list
headers = {'Authorization': 'Bearer {}'.format(api_key)}
search_api_url = 'https://api.yelp.com/v3/businesses/search'
# -- We can start adding price range or minimum rating as parameters --
params = {'t... | null | model.py | model.py | py | 789 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "requests.get",
"line_number": 16,
"usage_type": "call"
}
] |
601543783 | import tornado.httpserver
import tornado.ioloop
import tornado.options
import tornado.web
import tornado.httpclient
import urllib, json, datetime, time
from tornado.options import define, options
define('port', default=8000, type=int, help='run on the given port')
class Application(tornado.web.Application):
def... | null | tornado/6/tor1_async_gen.py | tor1_async_gen.py | py | 1,876 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "tornado.options.define",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "tornado.httpserver.web",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "tornado.httpserver",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": ... |
285069436 | import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as manimation
import math
def main():
# Domain settings
NumberOfElements= 100
Max = 0.1
Min = 0.0
SpatialStep = abs( Max - Min ) / ( NumberOfElements - 1 )
x = np.linspace( Min, Max, NumberOfElements )
# Geo... | null | wave.py | wave.py | py | 4,010 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "numpy.linspace",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "math.pi",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "math.sin",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "math.pi",
"line_number": 46,... |
309722073 | import os
import pygame
import time
import random
from math import pi
pygame.init()
BLACK = ( 0, 0, 0)
WHITE = (255, 255, 255)
BLUE = ( 0, 0, 255)
GREEN = ( 0, 255, 0)
RED = (255, 0, 0)
size = [800, 600]
screen = pygame.display.set_mode(size)
#Loop until the user clicks the close button.
done = F... | null | equation-triangle~centroid-hack8.py | equation-triangle~centroid-hack8.py | py | 2,096 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pygame.init",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "pygame.time.Cl... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.