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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
47580724 | import matplotlib.pyplot as plt
import numpy as np
import torch
# functions to show an image
def imshow(img):
img = img / 2.0 + 0.5 # unnormalize
npimg = img.numpy()
plt.imshow(np.transpose(npimg, (1, 2, 0)))
plt.show() #you need this only if you want to actually see the images
def save_checkpoi... | null | utils.py | utils.py | py | 1,632 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "matplotlib.pyplot.imshow",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "numpy.transpose",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "matplotlib... |
107167936 | from sqlite3 import connect
class Database:
def __init__(self, db):
self.conn = connect(db)
self.cursor = self.conn.cursor()
self.cursor.execute("""
CREATE TABLE IF NOT EXISTS books (id INTEGER PRIMARY KEY,
title TEXT, author TEXT, year INTEGER, isbn INTEGER)
""")
... | null | App5_DesktopDB/backend.py | backend.py | py | 1,661 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sqlite3.connect",
"line_number": 6,
"usage_type": "call"
}
] |
145176338 | import cv2
import numpy as np
import sys
import os
import math
from PyQt5.QtCore import *
from PyQt5 import QtGui, QtWidgets
from PyQt5.QtWidgets import QMainWindow, QApplication, QSlider
from PyQt5 import uic
from math import cos, sin, pi, trunc, exp
form_class = uic.loadUiType("Log.ui")[0]
class MainWindow(QMainWin... | null | Log.py | Log.py | py | 4,922 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "PyQt5.uic.loadUiType",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "PyQt5.uic",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtWidgets.QMainWindow",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "cv2.imread... |
141864690 | import flask
from ENT_sql import init_cart, sql_write, sql_read, cleanup_db
from ENT_assets import build_response, html_dict, user_gen, column_dict, price_dict, color_dict
from flask import session, request, jsonify
from flask.json import loads, tojson_filter
from time import time
from waitress import serve
last_sql_c... | null | teh_server.py | teh_server.py | py | 5,454 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "time.time",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "flask.Flask",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "flask.redirect",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "flask.session.get",
"line_num... |
61221735 | import pygame
from constants import *
from mapgen import Map
import textStyle
class Screen(object):
# draws the map and sprites to screen
#
def __init__(self):
self.screen = pygame.display.set_mode((SCREEN_WIDTH, SCREEN_HEIGHT))
pygame.display.set_caption('DE-3439')
def draw_map(self, main_map, passability)... | null | de/screen.py | screen.py | py | 2,912 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pygame.display.set_mode",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "pygame.display.set_caption",
"line_number": 12,
"usage_type": "call"
},
{
"api_name":... |
549518726 | #
# Copyright (c) 2015 Juniper Networks, Inc. All rights reserved.
#
from gevent import monkey
monkey.patch_all()
from pysandesh.sandesh_base import sandesh_global
from sandesh_common.vns.ttypes import Module
from nodemgr.common.cassandra_manager import CassandraManager
from nodemgr.common.event_manager import Event... | null | src/nodemgr/config_nodemgr/config_event_manager.py | config_event_manager.py | py | 2,049 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "gevent.monkey.patch_all",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "gevent.monkey",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "nodemgr.common.event_manager.EventManager",
"line_number": 15,
"usage_type": "name"
},
{
"api... |
555075876 | #!/usr/bin/python
# author: Jan Hybs
import os
import sys
import subprocess as sp
from datetime import datetime
from time import time
import proc.step.step_measure as step_measure
import utils.strings as strings
from files.temp_file import TempFile
from proc import merge_dict
from utils.events import EnterExitEvent
... | null | ci-hpc/proc/step/step_shell.py | step_shell.py | py | 4,300 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "utils.events.EnterExitEvent",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "utils.events.EnterExitEvent",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "utils.events.EnterExitEvent",
"line_number": 25,
"usage_type": "call"
},
{
... |
381505335 | from allennlp.models.archival import load_archive
from allennlp.predictors.predictor import Predictor
from allennlp_models.tagging.models.crf_tagger import CrfTagger
from addresses_ner.predictors.itn_entity_tagger import ItnEntityTaggerPredictor
import allennlp_models
from spacy.tokens import Token, Doc, Span
import ya... | null | realtime_server/location_v2(5000)/server/pipeline_components/itn_entity_tagger.py | itn_entity_tagger.py | py | 2,598 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "yaml.load",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "allennlp.models.archival.load_archive",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "allennlp.predictors.predictor.Predictor.from_archive",
"line_number": 26,
"usage_type": "... |
173339032 | #!/usr/bin/env python3
#~/miniconda3/bin/python3
'''
This file was originally written by Annamarie. I copied it and modified it to load the data in a format that is compatible with my deep learning code.
'''
import gzip
import numpy as np
from numpy import array
import ntpath
from Bio import SeqIO
from glob im... | null | load_kmer_cnts_Katherine_jf.py | load_kmer_cnts_Katherine_jf.py | py | 12,113 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "numpy.asarray",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "os.path.path.expanduser",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "os.path.path",
"line_number": 42,
"usage_type": "attribute"
},
{
"api_name": "os.path",
... |
467617533 | '''
Created on 2012-11-16
@author: daizhaolin
'''
from app import app, db
from models import weibo_user as user
from models import weibo_user_count as user_count
from models import content_library_bind as library_bind
from sina.weibo.client import client
from flask import request
from flask.views import MethodView
fr... | null | toolswei/trunk/api/weibo/user.py | user.py | py | 2,985 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "flask.views.MethodView",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "datetime.datetime",
"line_number": 36,
"usage_type": "argument"
},
{
"api_name": "datetime.date",
"line_number": 38,
"usage_type": "argument"
},
{
"api_name": "models... |
72092907 | import os
import json
ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
BASE_DIR = os.path.dirname(ROOT_DIR)
with open(os.path.join(BASE_DIR, 'secret.json'), 'r') as f:
secret = json.loads(f.read())
def get_secret(setting, secret=secret):
try:
return secret[setting]
except:
... | null | ch1/mysite/settings/common.py | common.py | py | 3,721 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.path.dirname",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line... |
316600552 | #%% [markdown]
# ## Install a pip package in the current Jupyter kernel
#%%
import sys
get_ipython().system('{sys.executable} -m pip install pokebase')
#%% [markdown]
# ## Import PokeAPI wrapper library for Python 3
#%%
import pokebase as pb
#%% [markdown]
# ## Quick lookup
#%%
rayquaza = pb.pokemon('rayquaza')
p... | null | FinalProject.py | FinalProject.py | py | 6,358 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pokebase.pokemon",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "urllib.request.urlopen",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 64,
"usage_type": "call"
},
{
"api_name": "pokebase.pok... |
547092341 | from django.http import HttpResponse
from django.template import RequestContext, loader
from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import User
from django.core import serializers
import json
from taskmng.models import *
from social.apps.django_app.default.models import Use... | null | apps/taskmng/views.py | views.py | py | 5,095 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.template.loader.get_template",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "django.template.loader",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "django.template.RequestContext",
"line_number": 21,
"usage_type": "call"
},
... |
63861522 | import gzip
import numpy as np
from typing import Tuple, List
def read_fasta(fn: str, gz: bool = False) -> Tuple[
List[str], np.array]:
'''
Read the provided fasta file, returning the
headers (lines starting with >) and sequences
'''
headers = []
seqs = []
f = None
if gz:
... | null | code/misc/read_fasta.py | read_fasta.py | py | 798 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "gzip.open",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.asarray",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "typing.Tuple",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": ... |
358134084 | # -*- coding: utf-8 -*-
'''
索引工具类入口
'''
#python自带类库
import os,re,json
#外部倒入类
import sh
import click
#custom
from common.utils import *
from common.model import *
from utils.search import *
from utils.indexinit import *
g_search = Search(config['initav']['datapath'],config)
g_init = IndexInit(config['initav']['da... | null | script/py3init/main.py | main.py | py | 4,945 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "click.echo",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "click.group",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "click.echo",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "click.echo",
"line_number": 46,... |
331938635 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
producer
This script will be run at command line to produce message to a topic
See the usage method for more information and examples.
"""
# Imports: native Python
import argparse
import sys
import socket
import json
import time
import tempfile
import os
import logging... | null | kafkaProducer.py | kafkaProducer.py | py | 6,251 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "logging.getLogger",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "logging.WARNING",
"line_number": 44,
"usage_type": "attribute"
},
{
"api_name": "logging.FileHandler",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "os.path.jo... |
402698455 | """
Copyright © 2019 ground0state. All rights reserved.
"""
import numpy as np
class DensityRatioEstimation():
def __init__(self, band_width=1.0, learning_rate=0.1, num_iterations=100):
self.band_width = band_width
self.theta = None
self.learning_rate = learning_rate
self.num_itera... | null | source/density_ratio_estimation.py | density_ratio_estimation.py | py | 3,738 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "numpy.ones",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.asarray",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.asarray",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "numpy.dot",
"line_number":... |
303161926 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.core.urlresolvers import reverse
from django.contrib.sitemaps import views as sitemaps_views
from django.contrib import admin
from django.conf.urls import patterns, url, include
from blog.sitemaps import BlogViewSitemap
from blog.models import Post
admin.autodis... | null | mark42/urls.py | urls.py | py | 868 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.contrib.admin.autodiscover",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.contrib.admin",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "django.conf.urls.patterns",
"line_number": 11,
"usage_type": "call"
},
{
"ap... |
222982366 | """This Django management command updates Figures EnrollmentData records
Running this will trigger figures.tasks.update_enrollment_data for every site
unless the '--site' option is used. Then it will update just that site
"""
from __future__ import print_function
from __future__ import absolute_import
from textwrap im... | null | figures/management/commands/update_figures_enrollment_data.py | update_figures_enrollment_data.py | py | 1,931 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.contrib.sites.models.Site.objects.get",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "django.contrib.sites.models.Site.objects",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.sites.models.Site",
"line_number": ... |
277320997 | import matplotlib.pyplot as plt
from Logistic_Regression import *
# Reading the data sets
train = numpy.array(pandas.read_csv('Train_Data.csv'), dtype='float64')
test = numpy.array(pandas.read_csv('Test_Data.csv'), dtype='float64')
# Preprocessings
train_data, train_labels, test_data, test_labels, w =... | null | HW3/Python Codes/LR1.py | LR1.py | py | 1,157 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.show",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "matpl... |
96184868 | #!/bin/python3
import re
import os
import sys
import socket
import readline
import importlib.machinery
from tabulate import tabulate
class bcolors:
HEADER = "\033[95m"
OKBLUE = "\033[94m"
OKGREEN = "\033[92m"
WARNING = "\033[93m"
FAIL = "\033[91m"
ENDC = "\033[0m"
BOLD = "\033[1m"
UNDE... | null | spoofy.py | spoofy.py | py | 9,982 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.listdir",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "readline.set_completer",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "readline.set_completer_d... |
311970234 | #------------------------------
"""
Class :py:class:`H5VConfigParameters` supports configuration parameters for application
======================================================================================
This software was developed for the SIT project.
If you use all or part of it, please give an appropriate ac... | null | psana/psana/graphqt/H5VConfigParameters.py | H5VConfigParameters.py | py | 4,078 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "logging.getLogger",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "psana.pyalgos.generic.PSConfigParameters.PSConfigParameters",
"line_number": 34,
"usage_type": "name"
},
{
"api_name": "psana.pyalgos.generic.PSConfigParameters.PSConfigParameters.__init_... |
650858392 |
import pymysql.cursors
import pandas as pd
import os
import re
# csv_list_tmp = os.listdir('../csv_data/')
# csv_list = [csv_file for csv_file in csv_list_tmp if re.search(
# '\.csv$', csv_file) != None]
csv_list = ['filtered_notext_review.csv']
for csv_filename in csv_list:
csv_data = pd.read_csv(f'../csv_d... | null | csv_to_mysql/csv_to_mysql.py | csv_to_mysql.py | py | 2,527 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pandas.read_csv",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pymysql.cursors.connect",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pymysql.cursors",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "pymysql.curso... |
220172198 | from django import forms
GENDER_CHOICES = (
('Male', 'Male'),
('Female', 'Female'),
('Other', 'Other')
)
RACES = (
("declined",'Decline'),
('indian','Indian'),
('asian','Asian'),
('black','Black'),
('hawaiian','Hawaiian'),
('white', 'White'),
('','N/A')
)
class PatientForm(forms.Form):
first_name = forms... | null | drchrono/forms.py | forms.py | py | 946 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.forms.Form",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "django.forms.CharField",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "django.for... |
121071991 | from django.conf.urls import url
from django.urls import path, include
from .views import *
# SET THE NAMESPACE!
app_name = 'pages'
# Be careful setting the name to just /login use userlogin instead!
urlpatterns=[
path('home', HomePageView.as_view(), name='home'),
path('index/', index, name='index'),
... | null | pages/urls.py | urls.py | py | 711 | python | en | code | null | code-starcoder2 | 83 | [
{
"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",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
239905767 | import base64
def main(*args):
args = list(*args)
if args[0] == "a":
arg2 = args[2:]
arg2 = " ".join(arg2)
if 'enc' in args:
mes = base64.b64encode(arg2.encode('utf-8')).decode()
return '```' + mes + '```'
elif 'decode' in args:
mes = base64.... | null | b64.py | b64.py | py | 1,125 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "base64.b64encode",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "base64.b64decode",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "base64.b64decode",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "base64.b64encode",
... |
384549130 | import requests
from client.office365.runtime.client_runtime_context import ClientRuntimeContext
from client.office365.runtime.context_web_information import ContextWebInformation
from client.office365.runtime.odata.json_light_format import JsonLightFormat
from client.office365.runtime.odata.odata_metadata_level impor... | null | client/office365/sharepoint/client_context.py | client_context.py | py | 2,130 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "client.office365.runtime.client_runtime_context.ClientRuntimeContext",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "client.office365.runtime.odata.json_light_format.JsonLightFormat",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "client.offi... |
517009886 | import tornado.httpserver
import tornado.websocket
import tornado.ioloop
import tornado.web
import socket
import json
clients = []
messages = [];
def protocol(client, message):
message = json.loads(message)
print(message['data'], message['command'])
if message['command']=='auth':
clien... | null | chatserver.py | chatserver.py | py | 1,408 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "json.loads",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "tornado.httpserver.websocket",
"line_number": 36,
"usage_type": "attribute"
},
{
"api_name": "tornado.httpserver",
"line_number": 36,
"usage_type": "name"
},
{
"api_name": "torna... |
9548892 | #coding:utf8
#coding:utf8
try:
import urllib.request as urllib2
except ImportError:
import urllib2
url = "http://www.baidu.com"
print ('method 1')
response1 = urllib2.urlopen(url)
print (response1.getcode())
print (len(response1.read()))
print ('method 2')
request = urllib2.Request(url)
... | null | test.urlib2.py | test.urlib2.py | py | 744 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "urllib2.urlopen",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "urllib2.Request",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "urllib2.urlopen",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "http.cookiejar.cookie... |
300249331 | from contextlib import contextmanager
from fabric.api import env, run, cd, prefix, task
WEBFACTION_HOST = 'newemage.webfactional.com'
WEBFACTION_USER = 'newemage'
WEBFACTION_PROJECT_NAME_DEV = 'access'
WEBFACTION_PROJECT_NAME_PROD = 'access_produccion'
REPO_NAME = 'access'
STATIC_DEV = 'static_server'
STATIC_PROD = ... | null | fabfile/deploy.py | deploy.py | py | 2,595 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "fabric.api.task",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "fabric.api.cd",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "fabric.api.env.project_dir",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "fabric.... |
169081790 | import os
import yaml
import path
import argparse
import mxnet as mx
import network.config
from network import get_pipeline
from reader import sintel, kitti
parser = argparse.ArgumentParser()
parser.add_argument('--batch', type=int, default=8, help='minibatch size of samples per device')
parser.add_argument('config'... | null | evaluate.py | evaluate.py | py | 3,582 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "path.find_log",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "path.find_checkpoints",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "mxnet.cpu... |
177051857 | #! /usr/bin/env python
import json
import os
import time
from datetime import datetime
import requests
import sys
# locate the root folder
root_folder_project = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# add the root folder to sys path, this way the different modules can be imported by Unix!
sys.pat... | null | src/collect_crypto_compare.py | collect_crypto_compare.py | py | 4,597 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.path.dirname",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sys.path.insert",
"l... |
591824542 | import sys
sys.path.append('./ model / model')
sys.path.append('./ model / utils')
from keras.models import load_model
import os
import scipy.io.wavfile as wavfile
import numpy as np
#import utils
import tensorflow as tf
from model.utils import utils
import time
#parameters
people = 2
num_gpu=1
#path
model_path = '.... | null | test_my.py | test_my.py | py | 2,280 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sys.path.append",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 2,
"usage_type": "attribute"
},
{
"api_name": "sys.path.append",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_numbe... |
359611159 | from django import forms
from django.conf import settings
from django.forms.widgets import HiddenInput
from django.core.mail import EmailMessage
from hackerhouses.core import models
from hackerhouses.global_utils.misc import get_lat_long
class HouseSpiritForm(forms.ModelForm):
class Meta:
model = models.H... | null | trunk/hackerhouses/core/forms.py | forms.py | py | 2,797 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.forms.ModelForm",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "hackerhouses.core.models.HouseSpirit",
"line_number": 11,
"usage_type": "attribute"
},
{
"... |
337304372 | import csv
import collections
class CSVManager():
def __init__(self, application):
self.application = application
def readCSV(self, file, delimiter=' '):
reader = csv.reader(file, delimiter=delimiter, quotechar='|')
# table data format
tableData = collecti... | null | rankingcalculator/csvUtils/csvManager.py | csvManager.py | py | 2,205 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "csv.reader",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "collections.OrderedDict",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "collections.OrderedDict",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "csv.DictWr... |
462645991 | # -*- coding: utf-8 -*-
"""
Created on Wed Jul 17 13:10:30 2013
@author: dashamstyr
"""
import MPLtools as mtools
import os
import numpy as np
import matplotlib.pyplot as plt
import matplotlib as plib
import slowhist as h2d
from matplotlib import cm
def main():
olddir = os.getcwd()
#os.chdir('C:\SigmaMP... | null | 2d-histplot-mid.py | 2d-histplot-mid.py | py | 5,687 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.getcwd",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.chdir",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "MPLtools.get_files",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "MPLtools.MPL",
"line_number... |
103858770 | # Copyright 2019 NEC Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... | null | oase-root/tests/libs/middleware/test_simple_middleware.py | test_simple_middleware.py | py | 2,708 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "mock.Mock",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "libs.middleware.simple_middleware.SimpleMiddleware",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "mock.Mock",
"line_number": 46,
"usage_type": "call"
},
{
"api_name":... |
340721046 | import sys
import collections
queue = collections.deque()
n, k, m = map(int, sys.stdin.readline().split())
#n 의 도착 할꺼야 1번 부터 시작해서
matrix = [[i] for i in range(n + m + 1)]
vistied = [True for i in range(n + m + 1)]
last_start = n + 1
for i in range(m):
temp = list(map(int, sys.stdin.readline().split()))
for ... | null | BFS/5214.py | 5214.py | py | 894 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "collections.deque",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "sys.stdin.readline",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sys.stdin",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "sys.stdin.readline",... |
510327533 | # uncompyle6 version 3.7.4
# Python bytecode 2.7 (62211)
# Decompiled from: Python 3.6.9 (default, Apr 18 2020, 01:56:04)
# [GCC 8.4.0]
# Embedded file name: redrum/redrum.py
# Compiled at: 2017-11-05 03:38:20
from __future__ import print_function
import sys, requests
from requests.exceptions import ConnectionError
im... | null | pycfiles/redrum-1.5.2.tar/redrum.py | redrum.py | py | 8,580 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.path.dirname",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "os.path.realpath",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "logging.basicConfig",
... |
9336937 | import math
import numpy as np
from scipy import linalg
from channel import channel
from channel_imp import channel_imp
from I_beam import I_beam
from RHS import RHS
from stress_from_strain import stress_from_strain
import time
import matplotlib.pyplot as plt
import pandas as pd
#C:\Users\saulg\Documents\year 4\IIB_Pr... | null | finite_strip_moment_res.py | finite_strip_moment_res.py | py | 15,858 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "numpy.asarray",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.abs",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": ... |
40603773 | """
Module for leveled of mesh group drawer
"""
import logging
from typing import Callable, List
from bmesh.types import BMEdge, BMFace, BMesh, BMVert
import config
import mappings
import utils
from model import CartographyCategory, CartographyGroup, CartographyPoint
from utils.blender.bmesh import Geometry
from .co... | null | drawing/drawer/mesh/group/leveled.py | leveled.py | py | 10,586 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "common.CartographyMeshGroupDrawer",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "logging.getLogger",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "common.CartographyMeshGroupDrawer.__init__",
"line_number": 28,
"usage_type": "call"
... |
250060629 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @author: 'orleven'
import re
import os
import sys
import glob
from lib.utils.output import print_dic
from lib.core.common import unserialize_object
from lib.core.database import TaskDataDB
from lib.core.database import TaskDB
from lib.core.data import logger
from lib.cor... | null | lib/core/options.py | options.py | py | 9,832 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "lib.core.data.conf.VERBOSE",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "lib.core.data.conf",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "lib.core.data.conf.OUT",
"line_number": 21,
"usage_type": "attribute"
},
{
"ap... |
176675105 | from configparser import ConfigParser
from ecgpandas.loader import Loader
from ecgpandas.preprocessing import Preprocessor
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import os.path
from config import PlotConfig
def plotBoxPlot(df : pd.DataFrame, xLabel, yLabel, outputPath =""):
flierpr... | null | plot/plotBoxPlot.py | plotBoxPlot.py | py | 4,169 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pandas.DataFrame",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot.tight_layout",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 20,
"usage_type": "name"
},
{
"api_name":... |
322126453 | import functools
import logging
import time
private_log = logging.getLogger('private')
class TimedContextManagerDecorator(object):
"""A context manager and a decorator which will report the elapsed time in
the context OR in a function call.
ported from:
https://github.com/DataDog/datadogpy/blob/mast... | null | stage/builder/metrics.py | metrics.py | py | 3,264 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "logging.getLogger",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "functools.wraps",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_numb... |
623004521 | from flask_sqlalchemy import SQLAlchemy
import datetime
db = SQLAlchemy()
def connect_db(app):
"""Connect to database."""
db.app = app
db.init_app(app)
class User(db.Model):
"""User."""
__tablename__ = "users"
def __repr__(self):
e = self
return f"<User {e.first_name} {e.l... | null | models.py | models.py | py | 1,824 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "flask_sqlalchemy.SQLAlchemy",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 51,
"usage_type": "attribute"
}
] |
337309348 | from yolo import YOLO
from PIL import Image
import pandas as pd
dat = open('subset_train_nuro.txt').read().split('\n')
for line in dat:
img_name = line.split()[0]
img = Image.open(img_name)
model = YOLO()
predictions_list = model.detect_image(img)
pred_str = ' '.join((predictions_list))
print(... | null | run_inference.py | run_inference.py | py | 330 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "PIL.Image.open",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "yolo.YOLO",
"line_number": 9,
"usage_type": "call"
}
] |
244183329 | # global parameters
from collections import namedtuple
# named tuples
WordArea = namedtuple('WordArea', 'left, top, right, bottom, content, idx')
TrainingParameters = namedtuple("TrainingParameters", "dataset model learning_rate epochs hidden1 num_hidden_layers dropout weight_decay early_stopping max_degree data_spl... | null | python/global_parameters.py | global_parameters.py | py | 1,280 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "collections.namedtuple",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "collections.namedtuple",
"line_number": 8,
"usage_type": "call"
}
] |
166993003 | #!/usr/bin/python
#coding=utf-8
# 多选框(多元素)定位问题
from selenium import webdriver
import os, time
driver = webdriver.Chrome()
filePath = 'file:///' + os.path.abspath('checkbox.html')
driver.get(filePath)
inputs = driver.find_elements_by_tag_name('input')
for ipt in inputs:
if ipt.get_attribute('type') == 'checkbox':
... | null | selenium/single_example/checkbox/webdriver_checkbox.py | webdriver_checkbox.py | py | 483 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "os.path.abspath",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path",
... |
330478511 | import torch
import torch.distributed as dist
dist.init_process_group('mpi')
rank = dist.get_rank()
size = dist.get_world_size()
from dist_stat import distmat
from dist_stat import distmm
from dist_stat.application.nmf_pg_ridge import NMF
import argparse
import os
num_gpu = torch.cuda.device_count()
if __name__=='__m... | null | examples/test_nmf_pg_ridge.py | test_nmf_pg_ridge.py | py | 2,553 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "torch.distributed.init_process_group",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "torch.distributed",
"line_number": 3,
"usage_type": "name"
},
{
"api_name": "torch.distributed.get_rank",
"line_number": 4,
"usage_type": "call"
},
{
"ap... |
121899083 | import argparse
def get_default_params(model_name):
# Params from paper (https://arxiv.org/pdf/2103.00020.pdf)
model_name = model_name.lower()
if "vit" in model_name:
return {"lr": 5.0e-4, "beta1": 0.9, "beta2": 0.98, "eps": 1.0e-6}
else:
return {"lr": 5.0e-4, "beta1": 0.9, "beta2": 0.... | null | kosmos-2/open_clip/src/training/params.py | params.py | py | 9,079 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 14,
"usage_type": "call"
}
] |
119373852 | # -*- coding: utf-8 -*-
# processing_window.py
# Gtk.Window
#
# Copyright (C) 2014 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later versi... | null | blivetgui/processing_window.py | processing_window.py | py | 3,522 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.path.split",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 36,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "gettext.bindtextdomain",
... |
268629965 | import os
import sys
import logging
import yaml
def read_yaml_input(yaml_input):
"""Reading configuration file."""
if isinstance(yaml_input, str):
with open(yaml_input, 'r', newline='') as f:
try:
yaml_config = yaml.safe_load(f)
except yaml.YAMLError as ymlexcp... | null | utilities/utils.py | utils.py | py | 1,279 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "yaml.safe_load",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "yaml.YAMLError",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
... |
485742995 | # This Python file uses the following encoding: utf-8
#******************************************************************************************************
# Created: polygon.by
# Last Updated: 8 may 2020
# Version: 2021.0.0
#
# Authors:
#"Mango Team"
# Dzmitry Ivanou
# Dzmitry Dzrynou
#
# Much th... | null | polygontools/pt_modules/pt_check_func.py | pt_check_func.py | py | 77,143 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "importlib.reload",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "importlib.reload",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "importlib.reload",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "importlib.reload",... |
113247395 | from gtts import gTTS
import RPi.GPIO as GPIO
import os
from random import randrange
import digitalio
import board
from PIL import Image, ImageDraw, ImageFont
import busio
import time
from adafruit_apds9960.apds9960 import APDS9960
import adafruit_rgb_display.st7789 as st7789
from threading import Thread
cwd = os.getc... | null | Lab 4/honest_mirror.py | honest_mirror.py | py | 4,561 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.getcwd",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "busio.I2C",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "board.SCL",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "board.SDA",
"line_number": 15,... |
141728747 | import argparse
import pandas as pd
import tensorflow as tf
from src.Predict import NN_Runner, XGBoost_Runner
from src.Utils.Dictionaries import team_index_current
from src.Utils.tools import get_json_data, to_data_frame, get_todays_games_json, create_todays_games
todays_games_url = 'https://data.nba.com/data/10s/v201... | null | main.py | main.py | py | 3,714 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "src.Utils.Dictionaries.team_index_current.get",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "src.Utils.Dictionaries.team_index_current",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "src.Utils.Dictionaries.team_index_current.get",
"line... |
13354644 | from __future__ import absolute_import, division, print_function
import argparse
import os
import shutil
from datetime import datetime
import numpy as np
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers
import pdb
from tensorflow.contrib import eager as tfe
# from tensorflow.co... | null | 03_pascal_caffenet.py | 03_pascal_caffenet.py | py | 12,742 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "tensorflow.keras.Model",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.keras",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "tensorflow.keras.layers.Conv2D",
"line_number": 26,
"usage_type": "call"
},
{
"api_n... |
653384885 | import discord
import importlib
from discord.ext import commands
import modules.sql_manager
import modules.string_manager
strings = modules.string_manager
class StickyCog(commands.Cog):
def __init__(self, bot):
self.bot = bot
def unload(self):
importlib.reload(modules.sql_manager)
im... | null | cogs/sticky.py | sticky.py | py | 2,488 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "modules.sql_manager.string_manager",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "modules.sql_manager",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "discord.ext.commands.Cog",
"line_number": 10,
"usage_type": "attribute"
},
... |
482051196 | from __future__ import print_function
from contextlib import contextmanager
from flask import Flask, request
from multiprocessing import Process, Queue
import os
import time
import subprocess
import json
from boxsdk import OAuth2
from boxsdk import Client
import logging
from StringIO import StringIO
# Remove logging f... | null | scripts/box_client.py | box_client.py | py | 8,219 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "logging.getLogger",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "logging.ERROR",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "multiprocessing.Queue",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "multiproce... |
56636543 | from django.dispatch import Signal
from django.dispatch import receiver
from django.template.loader import render_to_string
from . import utils
navratri_signup = Signal(
providing_args = ["email" , "url" , "lang"]
)
#Signal to use when user registers through mobile
mobile_signup = Signal(
providing_args = [
... | null | testing/authentication/signals.py | signals.py | py | 2,387 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.dispatch.Signal",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.dispatch.Signal",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "django.dispatch.Signal",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "d... |
474485084 | from __future__ import division
import copy
import errno
import os
import signal
import subprocess
import sys
import tempfile
import threading
import time
import unittest
import numpy
import six
from chainer import iterators
from chainer import serializer
from chainer import testing
class DummySerializer(serializer... | null | tests/chainer_tests/iterators_tests/test_multiprocess_iterator.py | test_multiprocess_iterator.py | py | 21,227 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "chainer.serializer.Serializer",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "chainer.serializer",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "chainer.serializer.Deserializer",
"line_number": 35,
"usage_type": "attribute"
},... |
647637347 | '''
The layer library contains the base Layer object and helpers used for
cortex construction.
'''
import os
import logging
import synapse.exc as s_exc
import synapse.common as s_common
import synapse.lib.cache as s_cache
import synapse.lib.const as s_const
import synapse.lib.lmdbslab as s_lmdbslab
import synapse.lib... | null | synapse/lib/lmdblayer.py | lmdblayer.py | py | 25,156 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "logging.getLogger",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "synapse.lib.const.mebibyte",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "synapse.lib.const",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "s... |
156814858 | from hwp5_table import HwpFile
import time
import json
import csv
import os
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
def cli(path):
hwp = HwpFile(path)
tables = []
section_idx = 0
while hwp.ole.exists('BodyText/Section%d' % section_idx):
tables.extend(hwp.get_tables(section_idx))
... | null | cli.py | cli.py | py | 2,183 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.path.dirname",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "hwp5_table.HwpFile",
"l... |
52469678 | # -*- coding: utf-8 -*-
from django.shortcuts import render, redirect
from django.core.urlresolvers import reverse_lazy
from django.http import HttpResponse
from students.models import Student
from courses.models import Course, Lesson
from students.forms import StudentModelForm
from django.contrib import messages
from ... | null | students/views.py | views.py | py | 3,075 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.views.generic.list.ListView",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "students.models.Student",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "students.models.Student.objects.filter",
"line_number": 21,
"usage_type": "cal... |
545543118 | from io import BytesIO
import sys
import requests
from PIL import Image
from pos import object_pos
search_api_server = "https://search-maps.yandex.ru/v1/"
geocoder_api_server = "http://geocode-maps.yandex.ru/1.x/"
api_key = "dda3ddba-c9ea-4ead-9010-f43fbc15c6e3"
toponym_to_find = " ".join(sys.argv[1:])
geocoder_par... | null | main.py | main.py | py | 2,609 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sys.argv",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "requests.get",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "pos.object_pos",
"line_nu... |
221601087 | #!/usr/bin/env python3
# This Script functions as a basic gatway it checks for input from a RFID reader and then change the status of the object that is linked to the recieved uid
import json
import requests
import serial
# A function that takes a uid from an RFID Chip (INT) and maps it to an URL (String)
def mapToUr... | null | raspberrypi/gateway.py | gateway.py | py | 3,148 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "json.load",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 62,
... |
574753320 | #!/usr/bin/python
import sys
from optparse import OptionParser
from lxml import etree as et
def parseNorsOutput(infile):
#####################################################################
# Preprocessing and stuff
#####################################################################
# define constants
NR = "h... | null | norsnet/norsexml.py | norsexml.py | py | 6,561 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "lxml.etree.QName",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "lxml.etree",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "lxml.etree.Element",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "lxml.etree",
"line... |
538123031 | import os
import sys
import copy
import Queue as Q
# from sets import Set
import datetime
from itertools import chain
# To print the puzzle in 2d matrix
def print_state(state):
for i in range(len(state)):
print(state[i])
if i == len(state) - 1:
print("")
# To print the items(state and... | null | CS3243_P1_30_1.py | CS3243_P1_30_1.py | py | 10,687 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "copy.deepcopy",
"line_number": 65,
"usage_type": "call"
},
{
"api_name": "copy.deepcopy",
"line_number": 71,
"usage_type": "call"
},
{
"api_name": "itertools.chain.from_iterable",
"line_number": 120,
"usage_type": "call"
},
{
"api_name": "itertools.... |
486467648 | from functools import reduce
from PIL import Image
import numpy as np
# Class to get images from some folder and hash them with simple pHash algorithm
class HashBuilder:
def __init__(self, path):
self.images_path = path
"""
Compresses image object into 8x8 square array to be used in saving as a ... | null | raw_algorithms_python/HashAlgorithms.py | HashAlgorithms.py | py | 4,577 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "numpy.array",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "numpy.uint8",
"line_number": ... |
227771575 | from selenium import webdriver
from selenium.webdriver import PhantomJS
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
import numpy
import datetime
import time
# open phantomjs and hide it from the host site
dcap = dict(DesiredCapabilities.PHANTOMJS)
dcap["phantomjs.page.settin... | null | v1.2.0.py | v1.2.0.py | py | 9,005 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "selenium.webdriver.common.desired_capabilities.DesiredCapabilities.PHANTOMJS",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "selenium.webdriver.common.desired_capabilities.DesiredCapabilities",
"line_number": 9,
"usage_type": "name"
},
{
"api_name":... |
385753835 | from bs4 import BeautifulSoup
import json
import requests
import re
source_code = requests.get(
'https://en.wikipedia.org/wiki/List_of_National_Basketball_Association_arenas')
soup = BeautifulSoup(source_code.content, "html.parser")
table = soup.find(
'span', id='Current_arenas').parent.find_next_sibling('tab... | null | idb_data/wikie_api_venue.py | wikie_api_venue.py | py | 2,069 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "requests.get",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_numbe... |
266510053 | class CommandError(Exception): pass
class NotEnoughArguments(Exception): pass
# Execute a blocking command with a subprocess, raise errors if any
# are encountered, otherwiser print standard output and return. This
# should work across both Python2.7 and Python3.x as well as cross-platform.
# INPUT:
# command -- A ... | null | push_update.py | push_update.py | py | 5,851 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sys.version_info",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "subprocess.Popen",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "subprocess.PIPE",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "subproces... |
628965390 | #!/usr/bin/env python
# coding: utf-8
# In[2]:
from audio2numpy import open_audio
import numpy as np
import matplotlib.pyplot as plt
# In[3]:
signal, signal_rate = open_audio("lisergic.mp3")
# In[137]:
orig = signal[:, 0]
L = len(orig)
orig_rms = np.sqrt(np.correlate(orig, orig))
noisies = []
for i in range(... | null | audio/audio.py | audio.py | py | 1,834 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "audio2numpy.open_audio",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.sqrt",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "numpy.correlate",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"... |
309285106 | #!/usr/bin/env python3
"""
File: racecar_agent.py
Author: Binit Shah
Last Modified: Binit on 10/30
"""
import pybullet as p
from simulator.utilities import Utilities
class RacecarAgent:
"""The RacecarAgent class maintains the demo racecar agent"""
def __init__(self, motion_delta=1):
... | null | simulator/racecar_agent.py | racecar_agent.py | py | 6,549 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pybullet.loadURDF",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "simulator.utilities.Utilities.gen_urdf_path",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "simulator.utilities.Utilities",
"line_number": 32,
"usage_type": "name"
}... |
72111919 | """This file is provided as a starting template for writing your own unit
tests to run and debug your minimax and alphabeta agents locally. The test
cases used by the project assistant are not public.
"""
import unittest
import isolation
import game_agent
from game_agent import custom_score, custom_score_2
from sam... | null | tests/test_game_agent.py | test_game_agent.py | py | 1,457 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "unittest.TestCase",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "importlib.reload",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "game_agent.AlphaBetaPlayer",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "ga... |
174315021 | from django.shortcuts import render
from django.http import HttpResponse
from django.template import loader
from .forms import EquipmentEntryForm, AssignmentForm, RequestForm
from .models import Equipment, StaffRequest
# Create your views here.
def index(request):
if request.method == 'POST':
form = Equip... | null | inventory/views.py | views.py | py | 1,785 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "forms.EquipmentEntryForm",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "forms.EquipmentEntryForm",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 21,
"usage_type": "call"
},
{
"api_nam... |
285433733 | import json
import time
import os.path
webhooks_file = "webhooks.json"
class bcolors:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
ENDC = '\033[0m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m'
def log(code, message):
if code == 0:
print(bcolors.OKGREEN + bc... | null | misc.py | misc.py | py | 1,125 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "time.strftime",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "time.strftime",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "time.strftime",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "os.path.path.exists",
"... |
117606406 | # coding=utf-8
from tornado import gen
from service.data.base import DataService
from util.common.decorator import cache
from util.common import ObjectDict
from util.common.decorator import log_coro
class UserWxUserDataService(DataService):
@gen.coroutine
def get_wxuser(self, id=None):
if not id:
... | null | service/data/user/user_wx_user.py | user_wx_user.py | py | 1,815 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "service.data.base.DataService",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "tornado.gen.Return",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "tornado.gen",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "util.com... |
70107815 | import logging
from pathlib import Path
from typing import List
import click
import click_log
from xsdata.logger import logger
from xsdata.transformer import SchemaTransformer
from xsdata.writer import writer
@click.command("generate")
@click.argument("sources", required=True, nargs=-1)
@click.option("--package", r... | null | xsdata/cli.py | cli.py | py | 1,228 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "typing.List",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "xsdata.logger.logger.setLevel",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "xsdata.logger.logger",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "loggin... |
354704512 | """Some fixtures for collective tests."""
import pytest
import ray
from ray.util.collective.const import get_nccl_store_name
def clean_up():
group_names = ["default", "test", "123?34!", "default2", "random"]
group_names.extend([str(i) for i in range(10)])
for group_name in group_names:
try:
... | null | python/ray/util/collective/tests/conftest.py | conftest.py | py | 975 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "ray.util.collective.const.get_nccl_store_name",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "ray.get_actor",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "ray.kill",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "... |
450593719 | import clr
clr.AddReference("System.Core")
clr.AddReference("OpenCV.Net")
clr.AddReference("Bonsai.Vision")
from System import Tuple, Math, Single, Array
import math
from System.Linq import Enumerable
from OpenCV.Net import Point, Point2f
from Bonsai.Vision import ConnectedComponentCollection
base = None
NaNPoint = Po... | null | DLC/track whiskers code.py | track whiskers code.py | py | 3,050 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "clr.AddReference",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "clr.AddReference",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "clr.AddReference",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "OpenCV.Net.Point2f",
... |
163139032 | """----------------------------------------------------------------------------
Name: config_import_publish_incidents.py
Purpose: Builds a .cfg file containing the parameters for the
import_publish_incidents.py script
Author: ArcGIS for Local Government
Created: 28/04/201... | null | scripts/config_incident_import.py | config_incident_import.py | py | 5,005 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "ConfigParser.RawConfigParser",
"line_number": 75,
"usage_type": "call"
},
{
"api_name": "arcpy.AddMessage",
"line_number": 76,
"usage_type": "call"
},
{
"api_name": "collections.OrderedDict",
"line_number": 86,
"usage_type": "call"
},
{
"api_name": ... |
499613966 | import os
import cv2
import json
import requests
import datetime
import urllib.request
from bs4 import *
from colour import Color
from PIL import Image, ImageDraw, ImageChops
def recuperation_donnée_température(lieu):
clé = '5a72ceae1feda40543d5844b2e04a205'
localisation = "ht... | null | admin_pollu/polution/a_la_main/climat.py | climat.py | py | 1,508 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "requests.get",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 47,
"usage_type": "attribute"
}
] |
503303268 | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
# -*- coding: utf-8 -*-
import json
import os
import requests
# if "pip3 install dotenv" doesn't work try "pip3 install python-dotenv"
from dotenv import load_dotenv
load_dotenv()
'''
This sample makes a call to the Bing Imag... | null | app/irsystem/models/BingImageSearchv7.py | BingImageSearchv7.py | py | 1,298 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "dotenv.load_dotenv",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "requests.get",
... |
641963496 | import matplotlib.pyplot as plt
# from functions import parsing
from math import pi
import numpy as np
plt.rc('text', usetex=True)
# plt.rc('text.latex', unicode=True)
plt.rc('text.latex', preamble=[r'\usepackage[utf8x]{inputenc}',
r'\usepackage[russian]{babel}',
... | null | fig/curve.py | curve.py | py | 839 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "matplotlib.pyplot.rc",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.rc",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "matplotlib.p... |
436804984 | import os
import re
import time
from parsel import Selector
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from libs import DOWNLOAD_DIR, URL_FILE
from libs.polish import polish_content, polish_title
from selenium_spider.sto import credentials
class StoSeleniumSpider:
def _... | null | selenium_spider/sto/sto_selenium.py | sto_selenium.py | py | 3,424 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "selenium.webdriver.chrome.options.Options",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 19,
"usage_type": "name"
},
{... |
347731451 | import pandas as pd
from sklearn.model_selection import GroupTimeSeriesSplit
from zgtools.data_tool import *
from xgboost import XGBClassifier, XGBRegressor
from sklearn.metrics import confusion_matrix
def get_qcut_ret(df_test, cut_num=10):
seri_date = df_test.index.get_level_values('date').drop_duplicates()
d... | null | backtest.py | backtest.py | py | 12,580 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pandas.qcut",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "xgboost.XGBClassifier",
... |
219953374 | from collections import OrderedDict
class Item(object):
def __init__(self, rule, i):
self.rule = rule
self.i = i
@classmethod
def Complete(cls, item):
yield item
i = item.i
rule = item.rule
while i < len(rule):
if rule[i].rep in ('1', '+'):
break
i += 1
yield cls(item.... | null | cheech/algos.py | algos.py | py | 3,217 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "collections.OrderedDict",
"line_number": 44,
"usage_type": "call"
}
] |
211504069 | import numpy as np
from PIL import Image
# https://www.runoob.com/numpy/numpy-io.html
im = np.array(Image.open('../IMG/data/1.bmp'))
# 保存为浮点数
np.savetxt('out.txt', im)
b = np.loadtxt('out.txt')
# 保存为整数
np.savetxt("out1.txt", im, fmt="%d", delimiter=",") # 改为保存为整数,以逗号分隔
b1 = np.loadtxt("out1.txt", delimiter=",") # ... | null | Learn/保存数组2.py | 保存数组2.py | py | 423 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "numpy.array",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "PIL.Image.open",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "numpy.savetxt",
"line_number": ... |
614575413 | import os
import sys
from bokeh.io import curdoc
from bokeh.models import ColumnDataSource, HoverTool, TapTool, OpenURL
from bokeh.models.widgets import Select, Slider
from bokeh.layouts import row, column, widgetbox, gridplot
from bokeh.models.widgets import PreText, Div
from bokeh.models import PrintfTickFormatter
... | null | backend/framework/qlf/dashboard/bokeh/qasnr/main.py | main.py | py | 7,384 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.environ.get",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "dashboard.bokeh.helper.get_url_args",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "bo... |
647948759 | import csv
import numpy as np
import matplotlib.pyplot as plt
t = list()
measurement = list()
with open('wave-data.csv', 'rb') as csvfile:
reader = csv.DictReader(csvfile)
for row in reader:
t.append(float(row['Seconds']))
measurement.append(float(row['Measurement']))
timestep = t[1] - t[0]
... | null | read_waves.py | read_waves.py | py | 625 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "csv.DictReader",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.fft.fft",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.fft",
"line_number"... |
610192867 | import time
import discord
import psutil
import os
from datetime import datetime
from discord.ext import commands
from evs import default
class Information_ko(commands.Cog):
def __init__(self, bot):
self.bot = bot
self.config = default.get("config.json")
self.process = psutil.Process(os.ge... | null | cogs/info_ko.py | info_ko.py | py | 3,002 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "discord.ext.commands.Cog",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "discord.ext.commands",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "evs.default.get",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "ev... |
278030311 | from unittest import TestCase, main
from os import path
from io import StringIO
from perseuspy import pd
TEST_DIR = path.dirname(__file__)
def to_string(df, **kwargs):
out = StringIO()
df.to_perseus(out, **kwargs)
out.seek(0)
return '\n'.join(out.readlines())
def type_row(df, **kwargs):
lines = t... | null | perseuspy/test/test_io.py | test_io.py | py | 1,547 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.path.dirname",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "io.StringIO",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "unittest.TestCase",
"line_number... |
257927113 | import copy
import warnings
import numpy as np
import pandas as pd
import colorcet
import bokeh.models
import bokeh.plotting
from . import utils
def strip(
data=None,
q=None,
cats=None,
q_axis="x",
palette=None,
order=None,
p=None,
show_legend=False,
color_column=None,
parc... | null | iqplot/cat.py | cat.py | py | 32,838 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "copy.copy",
"line_number": 111,
"usage_type": "call"
},
{
"api_name": "copy.copy",
"line_number": 112,
"usage_type": "call"
},
{
"api_name": "colorcet.b_glasbey_category10",
"line_number": 117,
"usage_type": "attribute"
},
{
"api_name": "bokeh.model... |
648363484 | from bs4 import BeautifulSoup
import re
import urllib.parse
class HtmlParser(object):
def parse(self, url, content):
if url is None or content is None:
return
soup = BeautifulSoup(content, "html.parser", from_encoding="utf-8")
new_urls = self.get_new_urls(url,soup)
ne... | null | html_parser.py | html_parser.py | py | 1,345 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "bs4.BeautifulSoup",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "urllib.parse.parse.urljoin",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "urllib.parse.... |
203333865 | import logging
from rssfeeder.core.consolidator import Consolidator
from rssfeeder.core.recorder import ReadableRecorder
class AllConsolidator(Consolidator):
def consolidate_and_record(self, recorder, job_name, results):
recorder.record(results)
class LastNConsolidator(Consolidator):
def __init__... | null | rssfeeder/lib/consolidator/simpleconsolidator.py | simpleconsolidator.py | py | 2,204 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "rssfeeder.core.consolidator.Consolidator",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "rssfeeder.core.consolidator.Consolidator",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "logging.debug",
"line_number": 20,
"usage_type": "call"
... |
146170756 | from routes import api
from flask import Blueprint, request, jsonify
from models import regression as rg
calibrate_bp = Blueprint('calibrate_bp', __name__)
@calibrate_bp.route(api.route['calibrate'], methods=['POST', 'GET'])
def calibrate():
if request.method == 'POST':
data = request.get_json()
... | null | src/calibrate/controllers/calibrate.py | calibrate.py | py | 1,760 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "flask.Blueprint",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "flask.request.method",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "flask.request.... |
372753767 | # coding=utf-8
from tornado import gen
from handler.base import BaseHandler
from util.common.decorator import handle_response, authenticated
import conf.common as const
from util.common import ObjectDict
from util.tool.url_tool import make_url
import conf.path as path
import conf.message as msg
class CaptchaHandler(... | null | handler/help/captcha.py | captcha.py | py | 3,286 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "handler.base.BaseHandler",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "util.common.ObjectDict",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "conf.message.CAPTCHA_SUCCESS",
"line_number": 26,
"usage_type": "attribute"
},
{
... |
7993965 | import random
import requests
import time
class Youdao():
def __init__(self,content):
self.content=content
self.url="http://fanyi.youdao.com/translate_o?smartresult=dict&smartresult=rule"
self.ts=self.get_ts()
self.salt=self.get_salt()
self.sign=self.get_sign()
d... | null | yun/Cloud/venv/post_youdao.py | post_youdao.py | py | 2,203 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "random.randint",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "hashlib.md5",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number... |
492900524 | import os
import uuid
import pytest
from weakref import WeakKeyDictionary
from nameko.testing.services import entrypoint_hook, dummy
from nameko.testing.utils import get_extension
from mock import Mock
import rethinkdb as r
from rethinkdb.errors import RqlRuntimeError
from nameko_rethinkdb import RDB, RDB_KEY
RDB_... | null | test/test_nameko_rethinkdb.py | test_nameko_rethinkdb.py | py | 3,632 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.environ.get",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "os.environ.get",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_... |
149038980 | import torch
import torch.nn as nn
import torch.nn.functional as F
class BasicBlock(nn.Module):
"""A Basic ResNet Block"""
def __init__(self, inplanes, planes, stride=1, downsample = None):
super(BasicBlock, self).__init__()
self.conv1 = nn.Conv2d(inplanes, planes, kernel_size=3, stride=stride,... | null | center-net/models.py | models.py | py | 3,125 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "torch.nn.Module",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "torch.nn.Conv2d",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_numbe... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.