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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
236653733 | import json
import tornado.ioloop
import tornado.web
import tornado.gen
import sys
import os
from pubnub import utils
from pubnub.enums import PNStatusCategory, PNOperationType
d = os.path.dirname
PUBNUB_ROOT = d(d(d(os.path.dirname(os.path.abspath(__file__)))))
APP_ROOT = d(os.path.abspath(__file__))
sys.path.append... | null | examples/tornado/http/app.py | app.py | py | 7,741 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path",
"line_number": 11,
"usage_type": "attribute"
},
{
"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... |
631815930 | #Programmer: Brent E. Chambers (q0m)
#Date: 2/21/2014
#Description: This program is a part of the DEFTRN training module.
import xlrd
import sets
class PenInstance:
tArray = []
sArray = []
dArray = []
CurrentModeData = (tArray, sArray, dArray)
book = xlrd.open_workbook(".\ForensicsResource.xls")
secMode = bo... | null | deftrn.py | deftrn.py | py | 3,719 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "xlrd.open_workbook",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sets.Set",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "sets.Set",
"line_number": 63,
"usage_type": "call"
},
{
"api_name": "sets.Set",
"line_number": 71... |
513087732 | import paramiko, json
from kubernetes import client, config
from . import static_value
def init_kubernetes():
with open(static_value.KUBE_CONFIG_PATH+'/kubernetes_config.json','r', encoding='utf-8') as f:
kubeconfig = json.load(f)
configuration = client.Configuration()
configuration.api_key... | null | gse_infra_configuration/common/utils.py | utils.py | py | 1,332 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "json.load",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "kubernetes.client.Configuration",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "kubernetes.client",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "kubernetes.c... |
400079703 | #coding=utf-8
import flask
server=flask.Flask(__name__)#__name__代表当前的python文件。把当前的python文件当做一>个服务启动
from gevent.pywsgi import WSGIServer
@server.route('/sub_ssr',methods=['get'])#只有在函数前加上@server.route (),这个函数才是>个接口,不是一般的函数
def reg():
with open('ssr_res','r') as f:
res=f.read()
return res
#server.run(po... | null | server.py | server.py | py | 672 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask.Flask",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "gevent.pywsgi.WSGIServer",
"line_number": 13,
"usage_type": "call"
}
] |
558101979 | from django.urls import path, include
from rest_framework.routers import DefaultRouter
from .views import RideViewSet, PlaygroundViewSet, UsageViewSet
app_name = "rideApp"
# app_name will help us do a reverse look-up latter.
router = DefaultRouter()
router.register(r'rides', RideViewSet)
router.register(r'playgrounds... | null | students/Y2336/Makurin_Alexandr/laboratory_work_4/djangoPraktika/rideApp/urls.py | urls.py | py | 436 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "rest_framework.routers.DefaultRouter",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "views.RideViewSet",
"line_number": 9,
"usage_type": "argument"
},
{
"api_name": "views.PlaygroundViewSet",
"line_number": 10,
"usage_type": "argument"
},
{
... |
505755092 |
import warnings
from sklearn.exceptions import UndefinedMetricWarning
warnings.filterwarnings("ignore", category=UndefinedMetricWarning)
warnings.filterwarnings("ignore", category=UserWarning)
from sklearn.multiclass import OneVsRestClassifier
import pandas as pd
from sklearn.metrics import f1_score
from sklearn.svm... | null | evaluate_utils.py | evaluate_utils.py | py | 6,678 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "sklearn.exceptions.UndefinedMetricWarning",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "warnings.filterwarnings",
"line_number": 5,
"usage_type": "call"
},
{... |
322923730 | """
this class is base class of LinearRegression
"""
from abc import ABCMeta, abstractmethod
import numpy as np
import logging as Log
class BaseRegression(metaclass=ABCMeta):
NORMAL_EQUATION = "normal equation"
GRADIENT_DESCENT = "gradient descent"
REGULAR_L1 = "l1"
REGULAR_L2 = "l2"
@abstractmeth... | null | MLer/LinearModel/BaseRegression.py | BaseRegression.py | py | 1,845 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "abc.ABCMeta",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "abc.abstractmethod",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "abc.abstractmethod",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "abc.abstractmethod",... |
162617489 | # CSC-395 Programming Assignment 1
# Authors: Won Seok Chung, Yoon Choi
# Date: September 24th, 2019
# The following script will is a mini search engine which
# 1. Server crawls at least 100 unique pages, parse them, create index, build web-graph by analyzing the links, and rank them
# 2. Crawls pages whose title cont... | null | csc395_programming_assignment_1_chungwon_choijong_092419.py | csc395_programming_assignment_1_chungwon_choijong_092419.py | py | 9,922 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "nltk.corpus.stopwords.words",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "nltk.corpus.stopwords",
"line_number": 35,
"usage_type": "name"
},
{
"api_name": "urllib.parse.urlparse",
"line_number": 52,
"usage_type": "call"
},
{
"api_name"... |
182698022 | from django.shortcuts import render, redirect, get_object_or_404, reverse
from django.http import JsonResponse, Http404
from django.db.models import Q
from django.views import generic
from comment.models import CommentModel
from tag.models import Tag
from .models import Article, Subscription
from .forms import ArticleF... | null | article/views.py | views.py | py | 8,143 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.http.JsonResponse",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "django.views.generic.ListView",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "django.views.generic",
"line_number": 23,
"usage_type": "name"
},
{
"... |
406648794 | import json
import glob
import nltk
import extractweatherclimate
import extractroadtypedirection
def TokenizePOSTaggedParagrapgh(summary):
taggedList=[]
summ_text = nltk.sent_tokenize(summary) # this gives us a list of sentences
# now loop over each sentence and tokenize it separately
for sentence in ... | null | summary_features_extraction/summary_analyzer.py | summary_analyzer.py | py | 2,271 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "nltk.sent_tokenize",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "nltk.word_tokenize",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "nltk.pos_tag",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "nltk.sent_tokenize"... |
126436116 | from rest_framework import viewsets
from rest_framework.response import Response
from django.db import connection
from django.db.models import Count
from django.http import JsonResponse, Http404
from rest_framework.views import APIView
from bounties.utils import dictfetchall, extractInParams, sqlGenerateOrList
from std... | null | bounties_api/std_bounties/views.py | views.py | py | 6,216 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "rest_framework.viewsets.ReadOnlyModelViewSet",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.viewsets",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "std_bounties.serializers.BountySerializer",
"line_number": 18,
... |
74417948 | # -*- coding: utf-8 -*-
"""
garage.logger
Logging for debug purposes.
* created: 2011-03-13 Kevin Chan <kefin@makedostudio.com>
* updated: 2012-07-17 kchan
"""
import logging
from garage import get_setting
# settings for debug log - add to project settings:
# LOG_DIR = os.path.join(SITE_ROOT, 'log')
# LOG_FILE ... | null | requirements/django-garage/build/lib/garage/logger.py | logger.py | py | 2,103 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.NOTSET",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "logging.DEBUG",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "logging.INFO",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "logging.WARN... |
137774065 | from django.conf.urls import patterns, include, url
from dajaxice.core import dajaxice_autodiscover, dajaxice_config
dajaxice_autodiscover()
# Uncomment the next two lines to enable the admin:
#from django.contrib import admin
#admin.autodiscover()
urlpatterns = patterns('',
# Examples:
url(r'^$', 'todebateit... | null | todebateit/urls.py | urls.py | py | 892 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "dajaxice.core.dajaxice_autodiscover",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.patterns",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 11,
"usage_type": "call"
},
{
"... |
344829534 | # Copyright (c) 2020 The Chromium 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 itertools
import os
import random
import threading
import gerrit_util
import git_common
import owners as owners_db
import scm
APPROVED = 'APPRO... | null | depot_tools/owners_client.py | owners_client.py | py | 6,082 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "itertools.combinations",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "git_common.ScopedPool",
"line_number": 69,
"usage_type": "call"
},
{
"api_name": "owners.intersection",
"line_number": 87,
"usage_type": "call"
},
{
"api_name": "owne... |
571909179 | #coding=utf-8
# ycat 2018/07/20 create
import sys,os,bottle
import pytest
import platform
import setup
if __name__ == '__main__':
setup.setCurPath(__file__)
import alarmApi
import alarmMgr
import alarmForward
import alarmThreshold
import utility
import webutility
import scadaUtility
import dbQuery.bigTable... | null | hucais/trunk/alarm/main_alarm.py | main_alarm.py | py | 5,124 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "setup.setCurPath",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "meta.install",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "dbQuery.bigTable.install",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "dbQuery.bigTabl... |
285088619 | # 1.导入图形库
import sys
from PIL import Image
# 根据像素点获得字符的函数
def get_chars(pixel):
# 替换字符的列表(从左到右颜色逐渐加深)
chars = [' ', ',', '1', '+', 'n', 'D', '@', 'M']
for k in range(0, 8):
if pixel < (k + 1) * 32:
return chars[7 - k]
# 保存文件的函数
def save_to_file(image_name, data):
# 6. save the l... | null | Pic_to_Str/pic_to_str.py | pic_to_str.py | py | 1,615 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.argv",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "PIL.Image.open",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_numb... |
338605534 | from django import forms
from django.contrib.auth.models import User
from django.contrib.auth.forms import UserCreationForm,UserChangeForm
from .models import *
class RegistrationForm(UserCreationForm):
email=forms.EmailField( required='True');
is_active=False
class Meta:
model=User
field... | null | accounts/forms.py | forms.py | py | 2,509 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.contrib.auth.forms.UserCreationForm",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.forms.EmailField",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.forms",
"line_number": 8,
"usage_type": "name"
},
{
"api_... |
419379377 | """
Example usage docstrings and help, type hints
"""
from typing import List
from typing import Dict
class Skateboard:
"""
class: Skateboard - contains information about parts
"""
def __init__(self, width: int, brand: str):
"""
__init__(self) - constructor of a Skateboard class obje... | null | Python/PythonBasics/DocStringsAndTypeHints.py | DocStringsAndTypeHints.py | py | 1,763 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "typing.List",
"line_number": 50,
"usage_type": "name"
},
{
"api_name": "typing.Dict",
"line_number": 50,
"usage_type": "name"
}
] |
538558613 | """empty message
Revision ID: 14e6883b5284
Revises: 964ac652a90b
Create Date: 2019-11-22 15:37:29.449908
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '14e6883b5284'
down_revision = '964ac652a90b'
branch_labels = None
depends_on = None
def upgrade():
# ... | null | migrations/versions/14e6883b5284_.py | 14e6883b5284_.py | py | 664 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "alembic.op.add_column",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.String"... |
466027947 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.shortcuts import render
from quadratics.forms import QuadraticForm
# Create your views here.
def quadratic(request):
form = QuadraticForm()
return render(request, 'result.html', {'form': form})
def is_parametr_right(p):
if p[0]=='-':
... | null | quadratics/views.py | views.py | py | 1,078 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "quadratics.forms.QuadraticForm",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "quadratics.forms.QuadraticForm",
"line_number": 25,
"usage_type": "call"
},
{
... |
142605480 | # Copyright (C) 2009 Alexandre da Silva
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
#
# This program is distribute... | null | plugins3/rubyonrailsloader.py | rubyonrailsloader.py | py | 2,931 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "gi.repository.GObject.Object",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "gi.repository.GObject",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "gi.repository.Gedit.ViewActivatable",
"line_number": 22,
"usage_type": "attribute... |
87798456 | from flask import Flask, jsonify
import json
import sqlalchemy
import datetime
from sqlalchemy.ext.automap import automap_base
from sqlalchemy.orm import Session
from sqlalchemy import create_engine, inspect, func, desc, extract
from dateutil.relativedelta import relativedelta
engine = create_engine("sqlite:///hawaii.... | null | Hawaii_Flask.py | Hawaii_Flask.py | py | 4,239 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sqlalchemy.create_engine",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.ext.automap.automap_base",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.orm.Session",
"line_number": 17,
"usage_type": "call"
},
{
... |
362757235 | import time
import zmq
import numpy as np
context = zmq.Context()
sender = context.socket(zmq.PUSH)
sender.connect("tcp://127.0.0.1:12321")
arr = np.zeros([512,512])
for num in range(1000):
sender.send_pyobj(arr)
arr+=1
time.sleep(1)
| null | test/LCLS/zmqsend.py | zmqsend.py | py | 247 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "zmq.Context",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "zmq.PUSH",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "numpy.zeros",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 12... |
426251343 | # uncompyle6 version 3.7.4
# Python bytecode 3.7 (3394)
# Decompiled from: Python 3.6.9 (default, Apr 18 2020, 01:56:04)
# [GCC 8.4.0]
# Embedded file name: C:\Users\sboon\AppData\Local\Temp\pip-install-ptdbtr91\quarchpy\quarchpy\connection_specific\serial\tools\list_ports_osx.py
# Compiled at: 2020-03-25 05:10:07
# S... | null | pycfiles/quarchpy-2.0.14-py2.py3-none-any/list_ports_osx.cpython-37.py | list_ports_osx.cpython-37.py | py | 7,966 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "ctypes.cdll.LoadLibrary",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "ctypes.cdll",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "ctypes.util.find_library",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "cty... |
51165377 | from django.shortcuts import render, HttpResponse
import time
# Create your views here.
def index(request):
currently = (time.strftime('%Y/%m/%d %I:%M:%S %Z'))
context = {
"time":currently
}
return render(request,"htmls/index.html", context)
| null | TimeDisplay/apps/time_display/views.py | views.py | py | 267 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "time.strftime",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 10,
"usage_type": "call"
}
] |
560108535 | __author__ = 'Titi'
import torch
import torch.nn as nn
import numpy as np
import cv2
import os
import shutil
import time
from torch.optim import Adam
from torch.nn import DataParallel
from model import BiLSTM, BiLSTM3
from model import Criterion
from utils.tools import calc_metrics, save_image
from utils.load_checkp... | null | model/.ipynb_checkpoints/model_factory-checkpoint.py | model_factory-checkpoint.py | py | 6,361 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "model.BiLSTM.RNN",
"line_number": 34,
"usage_type": "attribute"
},
{
"api_name": "model.BiLSTM",
"line_number": 34,
"usage_type": "name"
},
{
"api_name": "model.BiLSTM3.RNN",
"line_number": 35,
"usage_type": "attribute"
},
{
"api_name": "model.BiLST... |
42590899 | #!/usr/bin/python
from multiprocessing.pool import ThreadPool
import math
import sys
def is_prime(n):
prim=1
for i in range(2,int(math.sqrt(n))+1):
if n % i == 0:
prim=0
break
if prim == 1:
return n
return -1
min=int(sys.argv[1])
max=int(sys.argv[2])
tPool=ThreadPool(10)
rez=tPool.map_async(is_prime,r... | null | python/thread_pool/primes_thrpool.py | primes_thrpool.py | py | 379 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "math.sqrt",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "multiprocessing.pool.ThreadPool"... |
191371904 | from snumap.models import Spot, Edge, Shuttle, Route
import json
spots = Spot.objects.all()
edges = Edge.objects.all()
v = spots.count()
dist = []
key = []
edgeId = []
# 100.0 for no possible route
for row in range(v+1):
row = []
for column in range(v+1):
row.append(100.0)
dist.append(row)
#-1 ... | null | pathFinder.py | pathFinder.py | py | 2,153 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "snumap.models.Spot.objects.all",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "snumap.models.Spot.objects",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "snumap.models.Spot",
"line_number": 4,
"usage_type": "name"
},
{
"ap... |
599054384 | import chart_studio.plotly as py
import plotly.figure_factory as ff
import pandas as pd
import plotly
import numpy as np
import streamlit as st
import plotly.express as px
import plotly.graph_objs as go
from PIL import Image
import plotly.figure_factory as ff
import matplotlib.pyplot as plt
import altair as alt
alt.ren... | null | FIFA19.py | FIFA19.py | py | 6,585 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "altair.renderers.enable",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "altair.renderers",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "streamlit.title",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "streaml... |
82531074 | from flask import Flask
import os, yaml
from flask_sqlalchemy import SQLAlchemy
import psycopg2
__version__ = '1.0.1'
app = Flask(__name__)
#config init
config_file = 'config/config.yaml'
class Config(object):
if (os.path.isfile(config_file)):
with open(config_file, 'r') as f:
yaml_config = yaml.safe_load(... | null | flask_app/__init__.py | __init__.py | py | 1,210 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask.Flask",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path.isfile",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "yaml.safe_load",
"line_nu... |
258195821 | #------------------------------------------------------------------------------+
#
# Title: COMB-PSO Particle Class
# Author: Nathan Fox <nathanfox@miami.edu>
# Date Written: June 1, 2018
# Date Modified: June 9, by Nathan Fox <nathanfox@miami.edu>
#
#--------------------------------------------------------------------... | null | pso/backups_from_merge_conflict_180611/cpso_particle_REMOTE_9817.py | cpso_particle_REMOTE_9817.py | py | 12,488 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.zeros",
"line_number": 122,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 123,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 126,
"usage_type": "call"
},
{
"api_name": "numpy.random.uniform",
"li... |
334565504 | import argparse
import json
import os
import xml.etree.ElementTree as xml
from xml.dom import minidom
from PIL import Image
from cvat2coco import cvat2coco
from metrics_eval import print_metrics
from correct_detections import correct_detections
# def build_parser():
# parser = argparse.ArgumentParser()
# pars... | null | retinanet/validate.py | validate.py | py | 6,029 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_nu... |
341733855 | import json, subprocess
import pymongo, bson
from django.http import HttpResponse
RUBYCODE = 'outfit_chooser.rb'
def prepare_outfit(request, user_id):
client = pymongo.mongo_client.MongoClient()
user = client.outfitter.users.find_one({'_id':bson.objectid.ObjectId(user_id)})
#print user
prep = {}
for type_, li... | null | outfitter/dress/views.py | views.py | py | 1,397 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pymongo.mongo_client.MongoClient",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pymongo.mongo_client",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "bson.objectid.ObjectId",
"line_number": 11,
"usage_type": "call"
},
{
... |
413540443 | #!/usr/bin/env python
# Copyright 2013-2014 NaviNet Inc.
#
# 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 appli... | null | setup.py | setup.py | py | 2,829 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.path.append",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"lin... |
394710567 | import re
import time
import requests
from bs4 import BeautifulSoup
import datetime
import smtplib
now = datetime.datetime.now()
minute=now.minute+2
maxhour=1
emailstatus=False
minhour=6.5
dateprinted=False
currentminute=now.minute
prevminute=0
hour=now.hour
decimalminute=now.minute
decimalminute=float(decimalminute)/f... | null | Old Stuff/stockemail.py | stockemail.py | py | 2,883 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "datetime.datetime.now",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "requests.get",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "bs4.Beautiful... |
464211239 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import cms.models.fields
class Migration(migrations.Migration):
dependencies = [
('cms', '0011_auto_20150419_1006'),
]
operations = [
migrations.CreateModel(
name='FlexMo... | null | notcms/migrations/0001_initial.py | 0001_initial.py | py | 699 | python | en | code | null | code-starcoder2 | 76 | [
{
"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": 15,
"usage_type": "call"
},
... |
88901416 | import torch
import numpy as np
from gym.spaces.box import Box
from gym.spaces.discrete import Discrete
# run the model in a cpu, cause i don't have gpu
# device = torch.device('cpu')
#
class GaussianDistrib(object):
def __init__(self, mean, log_std):
self.mean = mean
self.log_std = log_std
... | null | rl/DCPO/policy.py | policy.py | py | 2,659 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "torch.exp",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.log",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.pi",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "numpy.e",
"line_number": 21,
... |
100311269 | #!/usr/bin/ python3.5
########################################
# TODO #
# #
# Refactor each function #
# Save weights into a file #
# Implement the network as a library #
########################################
#Import l... | null | neuraltest.py | neuraltest.py | py | 4,667 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.random.normal",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "numpy.random.normal",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "numpy.rando... |
146749747 |
import psycopg2
import psycopg2.extras
import faker
import random
def add_user(connection, user_name, user_email, user_balance):
try:
cursor = connection.cursor(cursor_factory = psycopg2.extras.DictCursor)
cursor.execute('''
INSERT INTO users(user_name, user_email, user_balance)
... | null | example1/populate_users.py | populate_users.py | py | 1,747 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "psycopg2.extras",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "psycopg2.DatabaseError",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "psycopg2.connect",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "fak... |
166327922 | import pickle
import numpy as np
from collections import Counter
from sklearn.feature_extraction.text import CountVectorizer
from sklearn import ensemble
from sklearn import linear_model
from sklearn import metrics
from sklearn import tree
from sklearn import svm
from sklearn.naive_bayes import MultinomialNB
import tim... | null | test_byDStype.py | test_byDStype.py | py | 5,561 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pickle.load",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 76,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"line_number": 84,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"line_number": 85... |
603680731 | import torch
cuda_index = 2
cpu = torch.device('cpu') # Default CUDA device
cuda = torch.device('cuda:{}'.format(cuda_index)) # Default CUDA device
device = cuda
if torch.cuda.is_available() is False:
device = cpu
default_tensor_type = "torch.DoubleTensor"
| null | robertson_pinn_qssa/config.py | config.py | py | 274 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "torch.device",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "torch.device",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "torch.cuda.is_available",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line... |
64310297 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
Compatible desde la version Facil2
'''
import pickle
from uuid import uuid1
from tempfile import gettempdir
from os import remove as BORRAR
from os.path import join as UNIR
from os.path import isfile as EXISTE
import logging
logger = logging.getLogger(__name__... | null | modules/SimpleSoft/F2S_PagLogicas.py | F2S_PagLogicas.py | py | 4,094 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "uuid.uuid1",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_nu... |
406639869 | # spa_ger a, o, h, e, n
# ger_eng e, o, n t, a
# eng_spa t, h, a, c, d
# spa e, a, o, s, n
# ger e, n, i, r, s
# eng e, t, a, o, s
from collections import Counter
import re
with open('test_eng.txt') as txt:
texto_prueba = txt.read()
def indentificador_idioma(texto):
letters = list(re.sub("[^a-z]+", "", text... | null | pre_identificador_idioma.py | pre_identificador_idioma.py | py | 1,226 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "re.sub",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "collections.Counter",
"line_number": 18,
"usage_type": "call"
}
] |
388281271 | from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
#url(r'^$', 'home.views.home', name='home'),
url(r'^$', 'home.views.signin', name='signin'),
url(r'^server1/', 'home.views.server1', name='server1'),
url(r'^server2/', 'ho... | null | vulcantech/urls.py | urls.py | py | 688 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.contrib.admin.autodiscover",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "django.contrib.admin",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "django.conf.urls.patterns",
"line_number": 6,
"usage_type": "call"
},
{
"api... |
32417883 | """Class for the Query-Adaptive Convolution (QAConv) in the evaluation phase
QAConv is an effective image matching method proposed in
Shengcai Liao and Ling Shao, "Interpretable and Generalizable Person Re-Identification with Query-Adaptive
Convolution and Temporal Lifting." In The European Conference on Co... | null | reid/loss/qaconv.py | qaconv.py | py | 3,171 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "torch.nn.Module",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "torch.zeros",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "torch.nn.functional.conv2d",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "torch.nn.funct... |
269535311 | import pytest
from flask_restx import inputs
from bulkloader import repository as bulkloader
from tests.integration_tests.test_resources import test_data
pytestmark = pytest.mark.unit
def test_regex_input_bulk_zip():
bulk_regex = r'(\d{4}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])|all)$'
input_regex = inputs.re... | null | tests/unit_tests/test_bulkloader.py | test_bulkloader.py | py | 3,761 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pytest.mark",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "flask_restx.inputs.regex",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "flask_restx.inputs",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "pytest.ra... |
478097014 | import matplotlib.pyplot as plt
import numpy as np
import sys
from PIL import Image
def LinearTransform(im, k1, k2, a, b):
x = np.arange(0,1,0.01)
y = k1*x + k2
y[ x < a] = 0
y[ x > b] = 1
y[ y > 1] = 1
y[ y < 0] = 0
print(y)
# Update y for main use
k1 = int(k1*255)
k2 = int(... | null | DIP/Assignment1/src/linearTransform.py | linearTransform.py | py | 1,163 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.arange",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
... |
512093012 | from copy import deepcopy
import datetime
from django.conf.urls.defaults import *
from nano.blog.models import *
news_dict = {
'queryset': Entry.objects.all().order_by('-pub_date'),
'extra_context': {
'me': 'news',
'now_today': datetime.date.today(),
},... | null | nano/blog/urls.py | urls.py | py | 1,539 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "datetime.date.today",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "copy.deepcopy",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "copy.deepcopy",
... |
253593380 | import keras
from keras.datasets import cifar10
from keras.preprocessing.image import ImageDataGenerator
from keras.models import Sequential
from keras.layers import Dense, Dropout, Activation, Flatten
from keras.layers import Conv2D, MaxPooling2D, BatchNormalization
from keras import optimizers
import numpy as np
from... | null | apple/apple-python/classify.py | classify.py | py | 7,476 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "keras.backend.set_image_dim_ordering",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "keras.backend",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "sklearn.preprocessing.LabelEncoder",
"line_number": 27,
"usage_type": "call"
},
{
... |
155081262 | # -*- coding: utf-8 -*-
__author__ = 'lwang'
from bs4 import BeautifulSoup
import json
import requests
import random
import datetime
import codecs
# import MySQLdb
import re
from decimal import Decimal as D
from commons.const import const
from commons import common
class Login:
def __init__(self):
self.ba... | null | testCase/login/testLogin.py | testLogin.py | py | 11,211 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "commons.const.const.BASE_URL",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "commons.const.const",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "commons.const.const.SIGN_IN_BASE_URL",
"line_number": 19,
"usage_type": "attribute"... |
327508724 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Tue May 21 22:31:51 2019
@author: safeer
"""
#import libraries
import pandas as pd
import numpy as np
import scipy.sparse as scp
import random
import os
import sys
#importing datasets from files
original = pd.read_csv("../Bio_Dataset_text/GROUND_TRUTH1200.... | null | Experiment/preprocess_BioDataset_new1.py | preprocess_BioDataset_new1.py | py | 3,181 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pandas.read_csv",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "numpy.asarray",
"line... |
159501798 | import os
import json
import codecs
import jmespath
BUFSIZE = 4096
BOMLEN = len(codecs.BOM_UTF8)
from enum import Enum
class Mode(Enum):
INVALID = 0
ASM = 1
ARM = 2
class FileType(Enum):
CLISA = 1
PSSA = 2
CLIVM = 3
PSVM = 4
validFilesARM = ['armpssa.json','ar... | null | samplecode/transform/transformHelper.py | transformHelper.py | py | 2,104 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "codecs.BOM_UTF8",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "enum.Enum",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "enum.Enum",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "codecs.BOM_UTF8",
"line_n... |
302652681 | '''
Enable autopause feature for AWS RDS database clusters
'''
from botocore.exceptions import ClientError
def run_remediation(rds, RDSIdentifier):
print('Executing RDS Cluster remediation')
response=''
DBenginemode=''
autopause=''
try:
response = rds.describe_db_clusters(DBClusterIdenti... | null | remediation-functions/rds_cluster/rdscluster_autopause.py | rdscluster_autopause.py | py | 1,996 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "botocore.exceptions.ClientError",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "botocore.exceptions.ClientError",
"line_number": 38,
"usage_type": "name"
}
] |
109943825 | import ROOT as R
import os
import numpy as np
import argparse
parser=argparse.ArgumentParser()
parser.add_argument("--file1", type = str)
parser.add_argument('--file2', type=str)
parser.add_argument('--outputdir', type=str)
parser.add_argument('--outputfile', type=str)
parser.add_argument("--func1", nargs="+", type=st... | null | Configurations/VBS_ZV/2017_dec21/compose_morph_function.py | compose_morph_function.py | py | 1,202 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.makedirs",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "ROOT.gStyle.SetOptStat",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "ROOT.gStyle... |
348886892 | import cv2
import Feature
import numpy as np
import HarrisCorner
import FeatureMatch as Match
# Display keypoints on images side by side
def display(img1, img2, keys1, keys2, title):
img1 = cv2.drawKeypoints(img1, keys1, None, color=(0, 255, 0), flags=0)
img2 = cv2.drawKeypoints(img2, keys2, None, color=(... | null | main.py | main.py | py | 3,823 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "cv2.drawKeypoints",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "cv2.drawKeypoints",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.concatenate",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.uint8",
... |
443378537 | #coding:utf-8
import matplotlib.pyplot as plt
import numpy as np
'''
绘制sin函数
'''
def drawSin0():
x=np.arange(-np.pi,np.pi,0.01)
y=np.sin(x)
plt.plot(x,y,'b')
plt.show()
'''
显示多图
'''
def drawSinAndCos():
x=np.arange(-np.pi,np.pi*2,0.01)
y1=np.sin(x)
y2=np.cos(x)
plt.figure(figsize=(8, 6... | null | matploatlib-demo/MatploatLib-demo.py | MatploatLib-demo.py | py | 4,408 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.arange",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.pi",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "numpy.sin",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.plot",
"line... |
491179272 | # -*- coding: utf-8 -*-
"""
RENDERING SCRIPT for Blender passed as a parameter at launch Blender
with primitives and only for one image
"""
import bpy # blender python - can run only from blender(
from datetime import datetime
import os, sys, math
import pwd
import numpy as np
np.bool = np.bool_
bl_version = bpy.app... | null | rendering/blender/blender_primitives.py | blender_primitives.py | py | 16,757 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.bool",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "numpy.bool_",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "bpy.app.version_string.split",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "bpy.app... |
236360118 | from django.urls import path
from . import views
app_name = 'persoonsgegevens'
urlpatterns = [
path('', views.ProfielView.as_view(), name='profiel'),
path('ledenlijst/', views.LedenlijstView.as_view(), name='ledenlijst'),
path('oudleden/', views.OudledenView.as_view(), name='oudleden'),
path('profiel/... | null | django/azotobacter/persoonsgegevens/urls.py | urls.py | py | 465 | python | en | code | null | code-starcoder2 | 76 | [
{
"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",
... |
327949764 | import datetime
import requests
import subprocess
from time import sleep
# time in seconds
UpperThreshold = 0.5
LowerThreshold = 0.2
T = 0.1
SampleTime = 1
NewResponseTimeWeight = 0.1
RecoveryTime = 5
while(True):
sleep(SampleTime)
time1 = datetime.datetime.now()
requests.get('http://192.168.69.4:8080/b.php')
tim... | null | first_autoscaling_attempt.py | first_autoscaling_attempt.py | py | 770 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "time.sleep",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "requests.get"... |
498870138 | #Generic libraries
from __future__ import print_function
import sys
import numpy as np
np.random.seed(17)
#from sklearn.model_selection import StratifiedKFold
import utils
import pickle
#Keras libraries
import keras
from keras.preprocessing.text import Tokenizer
from keras.preprocessing.sequence import pad_sequences
... | null | sources/task2_1dir.py | task2_1dir.py | py | 5,181 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.random.seed",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "utils.load_dataset",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "utils.load_word_... |
469167107 | import scrapy
from bs4 import BeautifulSoup
from weatherDemo.items import WeatherdemoItem
class WeatherSpider(scrapy.Spider):
name = 'myweatherDemo'
allowed_domains = ['sina.com.cn']
cities = ['beijing','shanghai','guangzhou','shenzhen','tianjin','chongqing','chengdu','zhengzhou','xianggang','nanjing']
... | null | weatherDemo/weatherDemo/spiders/WeatherSpider.py | WeatherSpider.py | py | 1,380 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "scrapy.Spider",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "weatherDemo.items.WeatherdemoItem",
"line_number": 26,
"usage_type": "call"
}
] |
142107972 | #import cv2
import itertools
import numpy as np
from struct import pack
from functools import reduce
from collections import Counter
from skimage.color import rgb2grey
from skimage.transform import resize
def get_indexes(lst, sub_lst, compare_function=None):
"""Return the indexes of a sub list in a list.
:pa... | null | src/functions.py | functions.py | py | 7,089 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "itertools.zip_longest",
"line_number": 104,
"usage_type": "call"
},
{
"api_name": "skimage.color.rgb2grey",
"line_number": 136,
"usage_type": "call"
},
{
"api_name": "skimage.transform.resize",
"line_number": 136,
"usage_type": "call"
},
{
"api_name... |
247412541 | #!/usr/bin/env python
import sys, re
from nltk.corpus import stopwords
from nltk.tokenize import word_tokenize
import sys
import re
import nltk
#from nltk.corpus import stopwords
#Top 10 words found in NYTimes Data
top_words = ['soccer', 'baseball', 'softball', 'soccer', 'football', 'players', 'wwe', 'wrestlemania', '... | null | Part2/mapper_reducerFiles/Twitter/twt_cooccur_mapper.py | twt_cooccur_mapper.py | py | 1,378 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.stdin",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "re.sub",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "nltk.corpus.stopwords.words",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "nltk.corpus.stopwor... |
356921664 | import logging
import sys
log = logging.getLogger("bdcalc")
log.setLevel(logging.INFO)
ch = logging.StreamHandler(sys.stdout)
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
ch.setFormatter(formatter)
log.handlers.clear()
log.addHandler(ch) | null | src/common.py | common.py | py | 281 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "logging.StreamHandler",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sys.stdout",
... |
438030786 | __author__ = 'admin'
import urllib2, base64
message = '{"sensor_id":"0","sensor_temperature":"0.5","sensor_status":"0","sensor_hl1":"22","sensor_hl2":"03.2","sensor_hl3":"03.2","sensor_x_position":"0","sensor_y_position":"0","fk_area":"http://127.0.0.1:8000/Crop_Area/0/"}'
request = urllib2.Request("http://riego.chi.... | null | Socket/PUT_Test.py | PUT_Test.py | py | 603 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "urllib2.Request",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "base64.encodestring",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "urllib2.urlopen",
"line_number": 11,
"usage_type": "call"
}
] |
70739749 | from api.models import Poll
from rest_framework import viewsets, views, generics, status
from api.serializers import (
PollSerializer,
PollCreateSerializer
)
from rest_framework_jwt.authentication import JSONWebTokenAuthentication
from rest_framework.authentication import SessionAuthentication
from rest_framew... | null | api/views/poll.py | poll.py | py | 2,426 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "rest_framework.viewsets.ModelViewSet",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.viewsets",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "api.models.Poll.objects.all",
"line_number": 16,
"usage_type": "call"
... |
208793567 | #!/usr/bin/env python
"""
Client code for server setup for nlp.
Script will connect to the server that we setup to reduce the nlp time stuff.
"""
import csv
import requests
def send__receive_data(new_Qs, old_Qs):
stuff_to_give = {"new_ques": new_Qs, "old_ques": old_Qs}
res = requests.post('https://nlp-hosty.... | null | users/reducer/client.py | client.py | py | 994 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "requests.post",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "csv.reader",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "csv.reader",
"line_number": 27,
"usage_type": "call"
}
] |
310261556 | import os
from torch.utils.data import TensorDataset, DataLoader,Dataset
import warnings
warnings.filterwarnings('ignore')
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import os
import copy
from tqdm.notebook import tqdm
from sklearn.preprocessing import OrdinalEncoder
im... | null | transformer/losses.py | losses.py | py | 4,225 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "torch.nn.Module",
"line_number": 37,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 37,
"usage_type": "name"
},
{
"api_name": "torch.nn.MSELoss... |
420816176 | import os
from glob import glob
import git
class GitScriptReader(object):
def __init__(self, url, dir):
self.dir = dir
self.url = url
self.gitc = git.Git()
self.templates = {}
self.populate()
@property
def repo(self):
# don't add any exception logic into p... | null | be/pranksters/pranksters/repo_reader.py | repo_reader.py | py | 2,267 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "git.Git",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "git.Repo",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 21,
... |
53432751 | #!/usr/bin/env python3
# -*- encoding: utf-8 *-*
from typing import Callable, List
def filtrarNonesFora(a:list,b:list):
while len(a) > len(b):
del a[-1]
while len(a) < len(b):
del b[-1]
i = len(a) - 1
while i >= 0:
if a[i] is None or b[i] is None:
del a[i]
... | null | libRecomendacao.py | libRecomendacao.py | py | 1,518 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "typing.List",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 44,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": ... |
63930790 | """CS 61A Presents The Game of Hog."""
from dice import four_sided, make_test_dice, six_sided
from ucb import interact, log_current_line, main, trace
GOAL_SCORE = 100 # The goal of Hog is to score 100 points.
######################
# Phase 1: Simulator #
######################
def roll_dice(num_rolls, dice=six_si... | null | hog.py | hog.py | py | 17,231 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "dice.six_sided",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "dice.six_sided",
"line_number": 112,
"usage_type": "name"
},
{
"api_name": "dice.six_sided",
"line_number": 130,
"usage_type": "name"
},
{
"api_name": "dice.six_sided",
"... |
261698603 | from django.shortcuts import render, get_object_or_404
from django.http import HttpResponse
from .models import GradeOneQuestion
from django.template import RequestContext, loader
from django.http import Http404
from django.core.urlresolvers import reverse
from .models import GradeOneChoice, GradeOneQuestion, GradeTwoQ... | null | mysite/polls/views.py | views.py | py | 16,727 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "models.GradeOneQuestion.objects.all",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "models.GradeOneQuestion.objects",
"line_number": 38,
"usage_type": "attribute"
},
{
"api_name": "models.GradeOneQuestion",
"line_number": 38,
"usage_type": "name... |
630308778 | import enum
@enum.unique
class Feature(enum.Enum):
PYTHON_DOMAIN = 1
KERNEL_FILTERING = 2
_FEATURES = {
2: {
6: [],
7: [
Feature.PYTHON_DOMAIN,
Feature.KERNEL_FILTERING,
],
8: [
Feature.PYTHON_DOMAIN,
Feature.KERNEL_FILTERIN... | null | lttngc/features.py | features.py | py | 752 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "enum.Enum",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "enum.unique",
"line_number": 4,
"usage_type": "attribute"
}
] |
448179049 | import time
import cv2
img = cv2.imread('cat.jpg')
wind_row, wind_col = 45, 45 # dimensions of the image
img_rows, img_cols = 45, 45
# resized = img[65:200, 250:631] / 255 # Pre-processing the image and normalize
# generating the sliding window
def sliding_window(image, stepSize, windowSize):
for y in range(0,... | null | SlidingWindow/slidingWindow.py | slidingWindow.py | py | 1,049 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "cv2.imread",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "cv2.rectangle",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "cv2.imshow",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "cv2.imshow",
"line_number": 26... |
503642467 | #!/usr/bin/python
# coding=UTF-8
'''
@Author: recar
@Date: 2019-05-30 18:05:15
@LastEditTime: 2019-06-27 17:08:55
'''
from lib.base import Base
import requests
class Scan(Base):
def __init__(self, scan_domain):
super().__init__(scan_domain)
self.name = "hackertarget"
self.base_url = "https:... | null | scripts/hackertarget.py | hackertarget.py | py | 875 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "lib.base.Base",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "requests.get",
"line_number": 20,
"usage_type": "call"
}
] |
553850515 | from typing import List
class Solution:
def inorder_traversal(self, root)->List[int]:
"""递归"""
traversal = []
self.helper(root, traversal)
return traversal
def helper(self, root, traversal):
if not root:
return
self.helper(root.left, traversal)
... | null | Week_02/inorder_traversal.py | inorder_traversal.py | py | 757 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "typing.List",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 18,
"usage_type": "name"
}
] |
520087328 | #------------------------------------------------------------------------------------------------
#import libraries
from __future__ import division
import numpy as np
import os
import glob
from random import *
from PIL import Image
from keras.utils import to_categorical
from sklearn.preprocessing import LabelEncoder
fr... | null | code/4_layer_CNN_SGD.py | 4_layer_CNN_SGD.py | py | 8,724 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pandas.read_csv",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 33,
"usage_type": "attribute"
},
{
"api_name": "glob.glob",
"line_numbe... |
609283401 | import cvxpy as cvx
import numpy as np
from typing import Optional, List, NamedTuple, Dict, Any
from snc.agents.hedgehog.params import StrategicIdlingParams
from snc.agents.hedgehog.strategic_idling.compute_dual_effective_cost \
import ComputeDualEffectiveCost
from snc.agents.solver_names import SolverNames
from s... | null | src/snc/agents/hedgehog/strategic_idling/strategic_idling.py | strategic_idling.py | py | 16,226 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "typing.NamedTuple",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "snc.utils.snc_types.WorkloadSpace",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "snc.utils.snc_types.Array1D",
"line_number": 16,
"usage_type": "name"
},
{
"a... |
250029404 | #!/usr/bin/env python
####
# This Python script reads 2014 national county shapefile for the United States,
# and filters for Massachusetts data. Writes the county names of Massachusetts to the
# console and then saves the filtered results to a new shapefile called "massachusetts".
####
# Import ogr libraries
from o... | null | gis/python_gdal/read_shapefile/read_shapefile_ex.py | read_shapefile_ex.py | py | 1,157 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "osgeo.ogr.UseExceptions",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "osgeo.ogr",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "osgeo.ogr.GetDriverByName",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "osgeo.ogr... |
327853646 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import web.models
class Migration(migrations.Migration):
dependencies = [
('web', '0002_footer'),
]
operations = [
migrations.CreateModel(
name='Brand_fabric',
... | null | web/migrations/0003_auto_20150626_1558.py | 0003_auto_20150626_1558.py | py | 4,522 | python | en | code | null | code-starcoder2 | 76 | [
{
"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": 15,
"usage_type": "call"
},
... |
599321747 | import requests
import pandas as pd
from io import StringIO
def GetData():
response = requests.Session()
dtype = {
'X': float,
'Y': float,
'OBJECTID': str,
'Province_State': str,
'Country_Region': str,
'Last_Update': str,
'Lat': float,
'Long_': float,
'Confirmed': str,
'Recovere... | null | automation.py | automation.py | py | 912 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "requests.Session",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "io.StringIO",
"line_number": 28,
"usage_type": "call"
}
] |
170742646 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Author: Aman Gupta github.com/aman566
# https://support.f5.com/csp/article/K52145254
import socket
import socks
import time
import json
import threading
import string
import random
import sys
import struct
import re
import os
from OpenSSL import crypto
import ssl
from co... | null | lib/vuln/f5_cve_2020_5902/engine.py | engine.py | py | 11,159 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "socks.SOCKS5",
"line_number": 38,
"usage_type": "attribute"
},
{
"api_name": "socks.SOCKS4",
"line_number": 38,
"usage_type": "attribute"
},
{
"api_name": "socks.set_default_proxy",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "socket.so... |
147383199 | """ Compiled: 2020-09-18 10:38:51 """
#__src_file__ = "extensions/BankDebtWSO/etc/FWSOFileFormatHook.py"
"""--------------------------------------------------------------------------
MODULE
FWSOFileFormatHook
(c) Copyright 2015 SunGard FRONT ARENA. All rights reserved.
DESCRIPTION
--------------------------... | null | Extensions/WSO Bank Debt/FPythonCode/FWSOFileFormatHook.py | FWSOFileFormatHook.py | py | 1,158 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "xml.etree.cElementTree.fromstring",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "xml.etree.cElementTree",
"line_number": 25,
"usage_type": "name"
}
] |
537397670 | from django.db import models
class GymServices(models.Model):
SERVICES_CHOICES = (
('GY', 'Тренажерный зал'),
('GP', 'Групповые программы'),
('SP', 'Бассейн'),
('MA', 'Боевые искусства'),
('BH', 'Банный комплекс'),
('BS', 'Салон красоты'),
('CC', 'Занятия дл... | null | gymnacity/services/models.py | models.py | py | 4,137 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.db.models.Model",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "django.db.models.CharField",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": ... |
548555093 | from rest_framework import status, permissions
from rest_framework import mixins, generics
from rest_framework.parsers import JSONParser, MultiPartParser, FormParser
from .models import Note
from .serializers import NoteSerializer
from rest_framework import permissions
from rest_framework.response import Response
from ... | null | nino/api/views.py | views.py | py | 5,768 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "ner_recognizer.NERRecognizer",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "keyphrase_extractor.KeyPhraseExtractor",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "abbyy_repository.AbbyyRepository",
"line_number": 40,
"usage_type": "... |
481900831 | """
Copyright (c) 2019 Red Hat, Inc
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.
"""
from __future__ import absolute_import
import os
import tempfile
import koji
from six import string_types
from atomic_reactor.constants imp... | null | atomic_reactor/plugins/pre_fetch_sources.py | pre_fetch_sources.py | py | 13,697 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "atomic_reactor.plugin.PreBuildPlugin",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "atomic_reactor.constants.PLUGIN_FETCH_SOURCES_KEY",
"line_number": 35,
"usage_type": "name"
},
{
"api_name": "six.string_types",
"line_number": 57,
"usage_type"... |
1143168 | import numpy as np
import matplotlib.pyplot as plt
######################################################
# constants and helper functions
######################################################
baseline_accs=[
[67.49, 60.09, 53.64, 53.52],
[71.26, 56.05, 58.52, 50.95],
[67.99, 58.40, 53.08, 51.76],
[... | null | src/GMM_finetune_analysis.py | GMM_finetune_analysis.py | py | 3,509 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.load",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "numpy.load",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 93,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
... |
181585922 | # Definition for a binary tree node.
# class TreeNode:
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
from collections import deque
class Solution:
def largestValues(self, root: TreeNode) -> List[int]:
ret = []
if not r... | null | 515_Find_Largest_Value_In_Each_Tree_Row/main.py | main.py | py | 800 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "collections.deque",
"line_number": 19,
"usage_type": "call"
}
] |
189943870 | import csv
import cv2
import numpy as np
lines = []
#with open("../data/driving_log.csv") as csvfile:
with open("C:\\Users\\hang\\Desktop\\Project_03_Behavioral_Cloning\\data\\driving_log.csv") as csvfile:
reader = csv.reader(csvfile)
for line in reader:
lines.append(line)
images = []
measurements = []
for line ... | null | Project_03_Behavioral_Cloning/model_test_2.py | model_test_2.py | py | 1,391 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "csv.reader",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 34,... |
246806880 | from keras.models import Sequential
from keras.layers import Flatten, Dense, Conv2D, MaxPooling2D, Dropout, BatchNormalization, Activation
from keras.optimizers import Adam
class SteeringNeuralNetwork():
def __init__(self, input_shape, output_shape, curr_model=None):
self.input_shape = input_shape
... | null | steering_neural_network.py | steering_neural_network.py | py | 2,480 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "keras.models.Sequential",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "keras.layers.BatchNormalization",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "keras.layers.Conv2D",
"line_number": 25,
"usage_type": "call"
},
{
"api_n... |
600168072 | """
@File : 9_css选择器倒数次序获取元素.py
@Time : 2020/5/15 11:17 上午
@Author : FeiLong
@Software: PyCharm
"""
from selenium import webdriver
# 加r的目的是防止转译,获取驱动的路径时直接把驱动拖入终端就会出现路径
web_driver=webdriver.Chrome(r'/Users/feilong/02_应用/chromedriver_mac64/chromedriver')
web_driver.implicitly_wait(5)
web_driver.get('http://f.pyt... | null | 10_Demo_Selenium/4_Selenium_Css表达式选择元素/9_css选择器倒数次序获取元素.py | 9_css选择器倒数次序获取元素.py | py | 624 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 10,
"usage_type": "name"
}
] |
645886804 | # pip install yolo34py-gpu
from pydarknet import Detector, Image
import cv2
import numpy as np
import pickle as pkl
def detect(cfg, weights, coco_data, source_video):
print('Detecting vehicles (This may take time)...')
net = Detector(bytes(cfg, encoding="utf-8"), bytes(weights, encoding="utf-8"), 0, bytes(c... | null | detect_vehicles.py | detect_vehicles.py | py | 728 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pydarknet.Detector",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "cv2.VideoCapture",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pydarknet.Image",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "pickle.dump",
... |
445788828 | from tabulate import tabulate
def ingresoCantidadJug ():#Esta función es para obtener y retornar la cantidad de jugadores ingresada por el usuario.
cantidad = int(input("Por favor, ingrese la cantidad de jugadores: "))
return cantidad
def ingresoNombres (cantidad):#Esta función sirva para agregar los nombres ... | null | tablero_laura.py | tablero_laura.py | py | 5,048 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "tabulate.tabulate",
"line_number": 56,
"usage_type": "call"
}
] |
641178078 | # Data Preprocessing
# Importing the libraries
import pandas as pd
# Importing the dataset
dataset = pd.read_csv('train.csv')
X = dataset.iloc[:, [2,4,5,6,7,9]].values
y = dataset.iloc[:, 1].values
# Taking care of missing data
from sklearn.preprocessing import Imputer
imputer = Imputer(missing_values = 'NaN', strat... | null | Titanic/1.py | 1.py | py | 1,789 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pandas.read_csv",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.Imputer",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.LabelEncoder",
"line_number": 21,
"usage_type": "call"
},
{
"a... |
47814083 | from importlib import import_module
import time
from django.conf import settings
from django.contrib.auth import SESSION_KEY, BACKEND_SESSION_KEY, load_backend, get_user, user_logged_out, login
from django.contrib.auth.forms import AuthenticationForm
from django.http import HttpRequest
from django.shortcuts import ren... | null | apps/routes/views.py | views.py | py | 4,384 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "apps.routes.models.UserPreference.objects.filter",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "apps.routes.models.UserPreference.objects",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "apps.routes.models.UserPreference",
"line_num... |
303975214 | from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('logs', '0005_auto_20171011_0303'),
]
operations = [
migrations.AlterModelOptions(
name='entry',
options={
'verbose_n... | null | logs/migrations/0006_auto_20171021_2212.py | 0006_auto_20171021_2212.py | py | 416 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.AlterModelOptions",
"line_number": 13,
"usage_type": "call"
... |
85462391 | #-------------------------------------------------------------------------------
# Name: module2
# Purpose:
#
# Author: catineau
#
# Created: 13/08/2019
# Copyright: (c) catineau 2019
# Licence: <your licence>
#-------------------------------------------------------------------------------
from ... | null | tools/orixel.py | orixel.py | py | 15,457 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "proto.fillclip.float2int.Triangle_UL",
"line_number": 253,
"usage_type": "call"
},
{
"api_name": "proto.fillclip.float2int",
"line_number": 253,
"usage_type": "attribute"
},
{
"api_name": "proto.fillclip",
"line_number": 253,
"usage_type": "name"
},
{
... |
171738283 | import time
# kafka
from kafka import KafkaConsumer
consumer = KafkaConsumer('topic-basic-test', bootstrap_servers=['techhublabs.com:9092'],group_id='topic-basic-test')
for msg in consumer:
servo = msg.key.decode("utf-8")
grados = msg.value.decode("utf-8")
print ("Servo:" + msg.key.decode("ut... | null | consumer_kfk_test.py | consumer_kfk_test.py | py | 369 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "kafka.KafkaConsumer",
"line_number": 5,
"usage_type": "call"
}
] |
537980505 | #coding:utf-8
import matplotlib.pyplot as plt
from mpl_toolkits.basemap import Basemap
from matplotlib.patches import Polygon
from matplotlib.colors import rgb2hex
import xlrd
import re
from adjustText import adjust_text
import numpy as np
from scipy import interpolate
from neo4j.v1 import GraphDatabase
import neo4j.v1... | null | maps/map_util.py | map_util.py | py | 32,040 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "matplotlib.pyplot.rcParams",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.rcParams",
"line_number": 18,
"usage_type": "attribute"
},
{
... |
177671864 | from flask import Flask
from flask_restful import Api, Resource, reqparse
import settings
import pymysql
app = Flask(__name__)
api = Api(app)
class Workers(Resource):
def post(self, id):
parser = reqparse.RequestParser()
parser.add_argument("id")
parser.add_argument("name")
parser... | null | with flask/main.py | main.py | py | 4,165 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask.Flask",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "flask_restful.Api",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "flask_restful.Resource",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "flask_restful.reqp... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.