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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
134712575 | #!/usr/bin/python
import matplotlib.pyplot as plt
from prep_terrain_data import makeTerrainData
from class_vis import prettyPicture
from sklearn import neighbors
from time import time
from sklearn import ensemble
features_train, labels_train, features_test, labels_test = makeTerrainData()
### the training data (fea... | null | choose_your_own/your_algorithm.py | your_algorithm.py | py | 2,522 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "prep_terrain_data.makeTerrainData",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.xlim",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 23,
"usage_type": "name"
},
{
"api_na... |
380338506 | import numpy as np
import pandas as pd
from matplotlib.pyplot import figure, plot, title, xlabel, ylabel, show, legend, subplots, tight_layout, savefig, boxplot
from scipy.linalg import svd
from scipy import stats
pimaData=pd.read_csv('pima-indians-diabetes.data.csv',header=None).rename(
columns = {0:'pregnant... | null | Projekt 1/Pima1.py | Pima1.py | py | 3,731 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pandas.read_csv",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pandas.value_counts",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pandas.value_counts",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.mat",
... |
334366140 | """
This is the machinnery that runs your agent in an environment.
"""
import matplotlib.pyplot as plt
import numpy as np
import agent
import pathlib
import time
class Runner:
def __init__(self, environment, agent, folder_path, verbose=False, hide_opt=False, n_valid=50):
self.environment = environment
... | null | COLGE/runner.py | runner.py | py | 9,686 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pathlib.Path",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.random.shuffle",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 43,
"usage_type": "attribute"
},
{
"api_name": "time.time",
"... |
508290592 | #!/usr/bin/env python
from __future__ import division
from glob import glob
import os
import h5py
import numpy as np
import pandas as pd
from tqdm import tqdm
from pummeler.reader import VERSIONS
from pummeler.stats import load_stats, save_stats
def merge_12to14_15(dir_12to14, dir_15, out_dir):
os.makedirs(out_... | null | make_12to15.py | make_12to15.py | py | 3,982 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.makedirs",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pummeler.reader.VERSIONS",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "pummeler.reader.VERSIONS",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "pummele... |
302969932 | #!/usr/bin/env python
import rospy
from std_msgs.msg import String
from itertools import cycle
import os
import time
import subprocess
import signal
global child
global file
files_to_run =[]
count=0
blocked_ip = []
def runfile(file):
global child
# child = subprocess.Popen(["rosrun","beginner_tutorials",file])
... | null | LaptopCode/pibot/scripts/old/listener1.py | listener1.py | py | 2,038 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "subprocess.Popen",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "subprocess.check_output",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "rospy.loginfo",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "rospy.get_call... |
596110980 | import os
import torch
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
from commons.utils import run_lstm
from commons.embeddings.graph_utils import *
from commons.embeddings.bert_container import BertContainer
from commons.embeddings.word_embedding import WordEmbedding
class FromPredictor(nn.... | null | models/frompredictor/from_predictor.py | from_predictor.py | py | 8,334 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "torch.nn.Module",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "commons.embeddings.bert_container.BertContainer",
"line_number": 26,
"usage_type": "call"
},
{
"api... |
318373078 | from pytest import mark
from submissions.models import Submission
def _update_submission(
graphql_client,
*,
submission,
new_topic,
new_audience,
new_type,
new_tag,
new_duration,
new_previous_talk_video="",
new_speaker_level=Submission.SPEAKER_LEVELS.new,
new_languages=["en... | null | backend/api/submissions/tests/test_edit_submission.py | test_edit_submission.py | py | 9,806 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "submissions.models.Submission.SPEAKER_LEVELS",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "submissions.models.Submission",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "submissions.models.Submission.SPEAKER_LEVELS",
"line_number":... |
598967625 | #!/usr/bin/env python
#===========================================================================
#
# Produce plots for monitored variables in PECAN
#
#===========================================================================
from __future__ import print_function
import os
import sys
import subprocess
from optpar... | null | projDir/qc/scripts/PlotMonitoring.pecan.py | PlotMonitoring.pecan.py | py | 10,787 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "optparse.OptionParser",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "sys.stderr",
"line_number": 84,
"usage_type": "attribute"
},
{
"api_name": "sys.stderr",
"line_number": 85,
"usage_type": "attribute"
},
{
"api_name": "sys.exit",
... |
336784169 | from translators.benchmark import *
from translators.crate import CrateTranslator
from translators.influx import InfluxTranslator
from translators.rethink import RethinkTranslator
import json
import matplotlib.pyplot as plt
import numpy as np
import os
PLOTS_DIR = "."
def plot_results(results, title, labels, metrics... | null | translators/plots/plot_benchmark.py | plot_benchmark.py | py | 2,586 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "numpy.arange",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "matplotlib.... |
435815633 | ## @Sitabja Pal, 20/9/2018, Simple Linear Regression by Least Square Method ##
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
def minSquare(x,y,x_mean,y_mean,n):
num,denom=0,0
for i in range(n):
num+=(x[i]-x_mean)*(y[i]-y_mean)
denom+=(x[i]-x_mean)**2
m=num/d... | null | leastSquare.py | leastSquare.py | py | 951 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pandas.read_csv",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.scatter",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 38,
"usage_type": "name"
},
{
"api_name": "matplotli... |
560830451 | from MDSplus import mdsExceptions, Device, Data, Float32, Float32Array, version
if version.ispy3:
import http as httplib
else:
import httplib
import json
from time import sleep
class REDPYTADC(Device):
parts=[{'path':':IP_ADDR', 'type':'text'},{'path':':COMMENT', 'type':'text'},
{'path':':TRIG_SOURCE', 't... | null | tdi/RfxDevices/REDPYTADC.py | REDPYTADC.py | py | 4,666 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "MDSplus.version.ispy3",
"line_number": 2,
"usage_type": "attribute"
},
{
"api_name": "MDSplus.version",
"line_number": 2,
"usage_type": "name"
},
{
"api_name": "MDSplus.Device",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "httplib.HTTPCo... |
61014874 | from PIL import Image
import os,pickle,re,configparser
from os.path import join,exists
from collections import defaultdict,Counter
import tensorflow as tf
import numpy as np
from konlpy.tag import Okt
from tqdm import tqdm
import json
from gensim.models import Word2Vec
# 20.10.08. modify it for path
from dataset.data.o... | null | dataset/data/oxfordflower/data_utils.py | data_utils.py | py | 6,541 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "configparser.ConfigParser",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "konlpy.tag.Okt",
"line_number": 59,
"usage_type": "call"
},
{
"api_name": "collections.Counter",
"line_number": 66,
"usage_type": "call"
},
{
"api_name": "os.path.... |
362001179 | from django.db import models
from accounts.models import User
from datetime import datetime
from accounts.models import User
from django.core.mail import send_mail
import requests
import os
import xmltodict
BASE_URL = 'https://e-commerce.kapitalbank.az'
PORT='5443'
def postPay(data):
headers = {'Content-Type': ... | null | core/models.py | models.py | py | 8,746 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "requests.post",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "django.db.models.Model",
"line_... |
599693776 | # -*- coding: utf-8 -*-
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
from pandas.tseries.offsets import MonthEnd
grafico = {
'Ninos': ['Nino1+2', 'Nino3', 'Nino4', 'Nino3.4'],
'Anoms': ['ANOM12', 'ANOM3', 'ANOM4', 'ANOM34'],
'Color': ['b', 'r', 'k', 'g']
}
# seleci... | null | NinoGrab/plot_Nino.py | plot_Nino.py | py | 7,977 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pandas.to_datetime",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pandas.DateOffset",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "pandas.tseries.offsets.MonthEnd",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "... |
645361078 | from baselines import HER2, SAC_SIR
from stable_baselines.sac.policies import FeedForwardPolicy as SACPolicy
from stable_baselines.common.policies import register_policy
from utils.parallel_subproc_vec_env import ParallelSubprocVecEnv
from gym.wrappers import FlattenDictWrapper
from stable_baselines.common import set_g... | null | run_her_augment.py | run_her_augment.py | py | 7,910 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "mpi4py.MPI",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentDefaultsHelpFormatter",
"line_number": 21,
"usage_type": "attribute"
},
{
"ap... |
244964 | # -*- coding: utf-8 -*-
"""
这是一个子模块的Demo
每一个Blueprint相当于一个controller
开发指导:
1,修改或添加route规则(如果需要的话)
2,开发处理逻辑(建议按照“add your code here”)
3,修改config.py,将controller名字加入到blueprints列表中
"""
from flask import Blueprint, render_template, abort, request, current_app, make_response
from . import *
import bucketV3 as bucket
im... | null | demoV1/controller/demo.py | demo.py | py | 2,656 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.path.basename",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "flask.Blueprint",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "bucketV3._controller",
... |
555908762 | from __future__ import print_function
import argparse
import os
import time
import pickle
import glob
import torch
import torch.utils.data
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
import cv2
import csv
from model.model import *
from utils import seg_hand_depth
import rospy
import moveit... | null | shadow_demo_unsafe.py | shadow_demo_unsafe.py | py | 8,671 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 35,
"usage_type": "attribute"
},
{
"api_name": "torch.cuda.manual_seed",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "torch.... |
607058126 | from django.conf.urls import url, patterns
from student import views
from student.views import ContactFormView, StudentView, StudentAdd, GroupFormView
from studentsdb.settings import MEDIA_ROOT, DEBUG
urlpatterns = [
# students
url(r'^$', StudentView.as_view(), name='student'),
url(r'^student/add/$', StudentAdd.as... | null | student/urls.py | urls.py | py | 1,154 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.conf.urls.url",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "student.views.StudentView.as_view",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "student.views.StudentView",
"line_number": 9,
"usage_type": "name"
},
{
"api... |
50481935 | # Copyright 2019 Atalaya Tech, 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 applicable law or agreed to in writing, ... | null | bentoml/server/prediction_logger.py | prediction_logger.py | py | 3,820 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pythonjsonlogger.jsonlogger.JsonFormatter",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "pythonjsonlogger.jsonlogger",
"line_number": 41,
"usage_type": "name"
},
{
"api_name": "logging.getLogger",
"line_number": 45,
"usage_type": "call"
},
... |
622054929 | from .models import *
from django.shortcuts import render, get_object_or_404, redirect
from .forms import *
from django.db.models import Sum, Max
import math
from django.conf import settings
import os
# Create your views here.
def lot_list(request):
all_lot = Lot.objects.all().order_by('lot_number')
# ! War... | null | wfa/views.py | views.py | py | 6,494 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.db.models.Sum",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.get_object_or_404",
"line_number": 40,
"usage_type": "call"
},
{
"a... |
74888022 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Mar 9 22:51:10 2020
@author: lizeth
"""
import numpy as np
import cv2
#Load an color image in grayscale
img= cv2.imread('cameraman.jpg',0)
#Obtain image dimensions
rows,cols=img.shape
#Initialize variables
imgResult=np.zeros((rows,cols),dtype="uint8"... | null | Class Activity 1/thresholding.py | thresholding.py | py | 656 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "cv2.imread",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "cv2.hconcat",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "cv2.imshow",
"line_number": 30... |
26952181 | """Run all (or a subset of) Aluminum benchmarks."""
import argparse
import subprocess
import math
import os.path
from collections import namedtuple
parser = argparse.ArgumentParser(
description='Run all Aluminum benchmarks')
parser.add_argument('--out-dir', type=str, required=True,
help='Direc... | null | benchmark/run_benchmarks.py | run_benchmarks.py | py | 10,708 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "collections.namedtuple",
"line_number": 67,
"usage_type": "call"
},
{
"api_name": "os.path.path.join",
"line_number": 166,
"usage_type": "call"
},
{
"api_name": "os.p... |
463458171 | # -*- coding: utf-8 -*-
import configparser
from libs.dotdict import DotDict
class ConfHelper(object):
"""Load sender (and/or sms) configurations from conf file and
provide them as global variables.
"""
# prevent for multiple loads
_HAVE_LOADED = False
@classmethod
def loaded(cls):
... | null | libs/confhelper.py | confhelper.py | py | 843 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "configparser.RawConfigParser",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "libs.dotdict.DotDict",
"line_number": 29,
"usage_type": "call"
}
] |
529460013 | # -*- coding: utf-8 -*-
import os
import bcrypt
from datetime import timedelta, datetime
from sqlalchemy import desc
from app import db, app, login_manager
import models
from tools import MovieScraper
@login_manager.user_loader
def load_user(userid):
return models.User.query.get(userid)
def save_movie(movie_d... | null | api.py | api.py | py | 3,207 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "models.User.query.get",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "models.User",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "app.login_manager.user_loader",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_nam... |
339195181 | """ Module contains logic for YES worker - one that marks any units_of_work as complete """
__author__ = 'Bohdan Mushkevych'
from datetime import datetime
from db.model import unit_of_work
from db.model.worker_mq_request import WorkerMqRequest
from db.dao.unit_of_work_dao import UnitOfWorkDao
from workers.abstract_mq... | null | workers/identity_worker.py | identity_worker.py | py | 2,875 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "workers.abstract_mq_worker.AbstractMqWorker",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "db.dao.unit_of_work_dao.UnitOfWorkDao",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "system.performance_tracker.AggregatorPerformanceTicker",
"l... |
605781550 | # Copyright 2014 Facebook, Inc.
# You are hereby granted a non-exclusive, worldwide, royalty-free license to
# use, copy, modify, and distribute this software in source code or binary
# form for use in connection with the web services and APIs provided by
# Facebook.
# As with any software that integrates with the Fa... | null | python/pytest-labs/.venv/lib/python3.6/site-packages/facebook_business/adobjects/extendedcredit.py | extendedcredit.py | py | 8,664 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "facebook_business.adobjects.abstractcrudobject.AbstractCrudObject",
"line_number": 36,
"usage_type": "name"
},
{
"api_name": "facebook_business.adobjects.abstractobject.AbstractObject.Field",
"line_number": 43,
"usage_type": "attribute"
},
{
"api_name": "facebook_b... |
437470528 | #coding=utf-8
###########################################################################
#
#
#此软件版权为深圳商之杰科技有限公司所有,更多信息请访问www.netbase.asia
#
#
###########################################################################
__doc__ = """python性能数据收集客户端
"""
from products.dataCollector.baseClient import BaseClient
from twist... | null | products/dataCollector/pythonClient.py | pythonClient.py | py | 2,801 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "logging.getLogger",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "products.dataCollector.baseClient.BaseClient",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "products.dataCollector.baseClient.BaseClient.__init__",
"line_number": 29,
... |
306656254 | from sqlalchemy import create_engine
import os
import sys
# a setting to determine whether we are running on OpenShift
ON_OPENSHIFT = False
if os.environ.has_key('OPENSHIFT_REPO_DIR'):
ON_OPENSHIFT = True
if os.environ.has_key('OPENSHIFT_APP_NAME'):
DB_NAME = os.environ['OPENSHIFT_APP_NAME']
if os.environ.has... | null | app/models.py | models.py | py | 1,637 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.environ.has_key",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "os.environ.has_key",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.environ",
... |
532784112 | import numpy as np
from dataset import date
from model import AttentionSeq2Seq
from trainer import MiniBatchTrainer
from optimizer import Adam
from common import pickler
import demo
def test(model, x_test, t_test, is_x_reversed=False):
colors = {'green' : '\033[92m' , 'red' : '\033[91m', 'white' : '\033... | null | attention_train.py | attention_train.py | py | 2,842 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "model.generate",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "dataset.date.load_data",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "dataset.date",
"line_number": 42,
"usage_type": "name"
},
{
"api_name": "dataset.date.load_... |
586428467 | """
@author: jtahstu
@contact: root@jtahstu.com
@site: http://blog.jtahstu.com
@time: 2018/4/24 14:45
"""
# from selenium import webdriver
# from selenium.webdriver.firefox.options import Options
#
# chrome_options = Options()
# chrome_options.add_argument('--headless')
# chrome_options.add_argument('--disable-gpu')
#... | null | 2018/2018_45/screen.py | screen.py | py | 1,607 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "selenium.webdriver.FirefoxOptions",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 35,
"usage_type": "name"
},
{
"api_name": "selenium.webdriver.Firefox",
"line_number": 39,
"usage_type": "call"
},
{
"a... |
423974353 | ####
# Loads data that is more or less ready for ML (read, not from SQL, etc)
####
import os
from typing import List
import pandas as pd
import pickle
data_dir_default = '/var/opt/pcsml/data'
exclude_columns = [
'ProcessedLayerUid', 'YearId', 'Year', 'ImportBatchId', 'ProcessedLayerLastUpdated',
'Area', 'Cos... | null | _archived_versions/20180107_invalidated_archives/20171015_full_df_exploration/data_scripts/pcsml_data_loader.py | pcsml_data_loader.py | py | 1,001 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "typing.List",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "pickle.load",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 34,... |
592178339 | import sys
import cv2
from PIL import Image
import pytesseract
import numpy as np
outputFile = "ayy2.png"
inputFile = "data/img0090.jpg"
im = cv2.imread(inputFile)
imR = im[:,:,2]
ret, imR = cv2.threshold(imR, 220, 255, cv2.THRESH_BINARY)
invImR = 255-imR
invImRSlice = invImR[:200, :]
cv2.imwrite(outputFile, invIm... | null | dataHarvester.py | dataHarvester.py | py | 657 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "cv2.imread",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "cv2.threshold",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "cv2.THRESH_BINARY",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "cv2.imwrite",
"li... |
202351064 | from django.contrib import admin
from .models.categories import Category
from .models.comments import Comments
from .models.genres import Genre
from .models.review import Review
from .models.titles import Title
from .models.users import MyUser
class MyUserAdmin(admin.ModelAdmin):
list_display = ("first_name", "l... | null | api/admin.py | admin.py | py | 1,572 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.contrib.admin.ModelAdmin",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "django.contrib.admin.ModelAdmin",
"line_number": 18,
"usage_type": "attribute"
... |
543443004 | from django.shortcuts import render
from django.http import HttpResponse
from django.http.response import JsonResponse
from django.views.decorators.csrf import csrf_exempt
from rest_framework.parsers import JSONParser
from rest_framework import status
from taxreductionapp.models import Properties
from taxreductionapp.... | null | taxreductionapp/views.py | views.py | py | 1,494 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "taxreductionapp.serializers.PropertySerializer",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "taxreductionapp.models.Properties.objects",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "taxreductionapp.models.Properties",
"line_number": 1... |
335160887 | from skimage import io, feature, color, transform
from get_histogram import get_histogram
import matplotlib.pyplot as plt
import pickle
import sys
WIDTH, HEIGHT = (64, 64) # 検出窓サイズ、学習画像の大きさと同じ
CELL_SIZE = 4
THRESHOLD = 3.0
HEIGHT_SIZE = int(HEIGHT / CELL_SIZE)
WIDTH_SIZE = int(WIDTH / CELL_SIZE)
svm = pickle.load(op... | null | sousk333/sample/neko/search_neko.py | search_neko.py | py | 2,475 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pickle.load",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "skimage.color.rgb2gray",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "skimage.color",
... |
197299066 | import uuid
from tinydb import TinyDB
from tinydb import where
from posts import posts
class Customer:
def __init__(self):
self.customer = TinyDB('customer.json')
self.customer.purge()
def create(self, name):
seller = {'name': name,
'subscribed': [],
... | null | customer.py | customer.py | py | 2,054 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "tinydb.TinyDB",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "uuid.uuid4",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "tinydb.where",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "tinydb.where",
"line_number"... |
397702265 | import random
from PIL import Image, ImageDraw
def encodePixel(i, j, letter):
r = pix[i, j][0]
g = pix[i, j][1]
b = pix[i, j][2]
bletter = letter % 10
gletter = (letter % 100) // 10
rletter = letter // 100
r = r - r % 10 + rletter
if r > 255: r = r - 10
g = g - g % 10 + gletter
... | null | PictureEncoder.py | PictureEncoder.py | py | 1,160 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "PIL.Image.open",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "PIL.ImageDraw.Draw",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "PIL.ImageDraw",
"line... |
218485591 | """Creates a forensic VM and copies a GCP disk to it for analysis."""
from __future__ import print_function
from __future__ import unicode_literals
from googleapiclient.errors import HttpError
from oauth2client.client import AccessTokenRefreshError
from oauth2client.client import ApplicationDefaultCredentialsError
fro... | null | dftimewolf/lib/collectors/gcloud.py | gcloud.py | py | 6,948 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "dftimewolf.lib.module.BaseModule",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "dftimewolf.lib.module",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "turbinia.lib.libcloudforensics.GoogleCloudProject",
"line_number": 96,
"usage... |
647943656 | # -*- coding: utf-8 -*-
"""
Created on Tue Nov 26 15:15:15 2019
@author: jankos
"""
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
# import .biman_helpers as bm
sns.set(font_scale=2)
#%%Load data
similarities = pd.read_csv(r"C:\Users\jankos\Desktop\Tyokansio\P... | null | helpers/plot_data.py | plot_data.py | py | 7,020 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "seaborn.set",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyp... |
146699796 | #encoding:utf-8
#修改默认编码,python默认是编码是ascii,出现中文会出错
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
#Import the Flask Framework
import os
from flask import Flask,request,render_template,url_for
from werkzeug import secure_filename
#Constant Variables, Never change
Seprate_Character = os.sep#pass to page
DocPath =... | null | main.py | main.py | py | 6,721 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sys.setdefaultencoding",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.sep",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "flask.Flask",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "flask.url_for",
"li... |
134517913 | import socketio
import numpy as np
import random
from AI import *
from board import *
sio = socketio.Client()
class infoGame:
def __init__(self):
self.Match = Tiros()
self.username = ""
self.tournament_id = ""
self.game_id = ""
self.board = []
self.... | null | proto.py | proto.py | py | 2,594 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "socketio.Client",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.ones",
"line_number": 75,
"usage_type": "call"
},
{
"api_name": "numpy.ndarray.tolist",
"line_number": 76,
"usage_type": "call"
},
{
"api_name": "numpy.ndarray",
"l... |
86752414 | # -*- coding: latin-1 -*-
from django import template
from django.core.urlresolvers import reverse
from django.utils.html import format_html
from moneyed import Money
register = template.Library()
@register.simple_tag
def nav_active(request, urls):
if request.path in (reverse(url) for url in urls.split()):
... | null | templatetags/tuna_extras.py | tuna_extras.py | py | 798 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.template.Library",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.template",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.core.urlresolvers.reverse",
"line_number": 11,
"usage_type": "call"
},
{
"api_name":... |
650308742 | import enum
import collections
class Party(enum.Enum):
LIB = enum.auto(),
NDP = enum.auto(),
CON = enum.auto(),
GRN = enum.auto(),
BQ = enum.auto(),
PPC = enum.auto()
OTH = enum.auto()
@classmethod
def from_string(cls, str):
party = party_str_table.get(str)
if party... | null | common_defs.py | common_defs.py | py | 1,269 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "enum.Enum",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "enum.auto",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "enum.auto",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "enum.auto",
"line_number": 7,
... |
470585954 | import urllib2
from bs4 import BeautifulSoup
from pandas import DataFrame
from string import ascii_lowercase
url = 'http://www.hockey-reference.com/players/a/'
# store the raw data here
data = []
# iterate from a->z
for i in ascii_lowercase:
if i != 'x':
print("Getting information on players -- " + i)
... | null | python/parse_player_info.py | parse_player_info.py | py | 1,295 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "string.ascii_lowercase",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "urllib2.urlopen",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "pandas.DataF... |
399819683 | """
plot_utils.py
Functions for plotting data
@author: David Van Valen
"""
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
import matplotlib.pyplot as plt
from tensorflow.python.keras import backend as K
def cf(x_coord, y_coord, sample_image):
numrows... | null | resources/deepcell_snapshot/deepcell/utils/plot_utils.py | plot_utils.py | py | 2,738 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "tensorflow.python.keras.backend.image_data_format",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "tensorflow.python.keras.backend",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "tensorflow.python.keras.backend.image_data_format",
"line_n... |
71290598 | """
Created on Mon Nov 12 11:12:00 2018
@author: jercas
"""
import pandas as pd
import datetime
"""
1.No 行数
2.year 年
3.month 月
4.day 日
5.hour 小时
6.pm2.5 PM2.5浓度
7.DEWP 露点
8.TEMP 温度
9.PRES 大气压
10.cbwd 风向
11.lws 风速
12.ls 累积雪量
13.lr 累积雨量
"""
def parser(x):
"""parse separate four dimension date time to a s... | null | experiment/multivariateTimeSeriesForecasting/preprocess.py | preprocess.py | py | 1,049 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "datetime.datetime.strptime",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "pandas.read_csv",
"line_number": 31,
"usage_type": "call"
}
] |
260866641 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('homebrew', '0003_auto_20150117_1853'),
]
operations = [
migrations.CreateModel(
name='FermentableType',
... | null | homebrew_proj/homebrew/migrations/0004_auto_20150117_1858.py | 0004_auto_20150117_1858.py | py | 1,128 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.CreateModel",
"line_number": 14,
"usage_type": "call"
},
... |
583017454 | from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from ouroboros.schemas.src.auth import User
from ouroboros.schemas.dst.personas import Persona
from ouroboros.converters.users import UserConverter
if __name__ == '__main__':
src_engine = create_engine('sqlite:///kawaz.db')
dst_engin... | null | converter.py | converter.py | py | 778 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sqlalchemy.create_engine",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.create_engine",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.orm.sessionmaker",
"line_number": 11,
"usage_type": "call"
},
{
"api_... |
489621917 | from __future__ import absolute_import
from rest_framework import serializers
from sentry.models import Project
ValidationError = serializers.ValidationError
class ProjectField(serializers.WritableField):
def to_native(self, obj):
return obj
def from_native(self, data):
try:
pr... | null | src/sentry/api/serializers/rest_framework/project.py | project.py | py | 773 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "rest_framework.serializers.ValidationError",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.serializers",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "rest_framework.serializers.WritableField",
"line_number": 10,
"u... |
574720083 | """ train tracks. conatains monsters. """
import pygame
from pygame.rect import Rect
from pygame.locals import *
import os
from level import LevelBase
import sys; sys.path.insert(0, "..")
from pgu import tilevid, timer
from character import Character
from inventory import Inventory
from enemies.bird import Bird
from en... | null | src/level6.py | level6.py | py | 3,923 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sys.path.insert",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "level.LevelBase",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "pgu.timer",
"line_num... |
82771604 | import datetime
#from sqlalchemy import Boolean, Column, ForeignKey, Integer, String, Numeric, DateTime
from database import Base
from sqlalchemy import Column, DECIMAL, DateTime, Float, ForeignKey, String, Table, text,Boolean,Integer,Numeric
from sqlalchemy.dialects.mysql import BIT, INTEGER, LONGBLOB, MEDIUMTEXT, SMA... | null | models4.py | models4.py | py | 12,193 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "database.Base",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.ext.declarative.declarative_base",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "database.Base.metadata",
"line_number": 11,
"usage_type": "attribute"
},
{
... |
465608831 | # -*- coding: utf-8 -*-
###############################################################################
#
# Copyright (C) 2019-TODAY OPeru.
# Author : Grupo Odoo S.A.C. (<http://www.operu.pe>)
#
# This program is copyright property of the author mentioned above.
# You can`t redistribute it and/or modi... | null | l10n_pe_edi_odoofact-14.0.0.5/l10n_pe_edi_odoofact/models/res_company.py | res_company.py | py | 4,026 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "logging.getLogger",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "odoo.models.Model",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "odoo.models",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "odoo.fields.Char... |
626655777 | import os
from decimal import Decimal
from cryptofeed.backends.gcppubsub import GCPPubSubCallback
from gcloud.aio.pubsub import PublisherClient, PubsubMessage
from yapic import json
from ..constants import PROJECT_ID
from ..utils import is_local, set_environment
from .utils import normalize_symbol
class GCPPubSubTr... | null | cryptoblotter/trades/gcppubsub.py | gcppubsub.py | py | 1,804 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "cryptofeed.backends.gcppubsub.GCPPubSubCallback",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "utils.is_local",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "utils.set_environment",
"line_number": 21,
"usage_type": "call"
},
{
... |
266223317 | from django.conf.urls import patterns, include, url
from django.conf import settings
from django.conf.urls.static import static
from django.contrib import admin
admin.autodiscover()
from apprest.viewsets import *
from rest_framework.routers import DefaultRouter
#from apprest import viewsets
router = DefaultRouter()... | null | visor/urls.py | urls.py | py | 1,067 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.contrib.admin.autodiscover",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.contrib.admin",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "rest_framework.routers.DefaultRouter",
"line_number": 13,
"usage_type": "call"
},
... |
354323698 | # # Enter your code here. Read input from STDIN. Print output to STDOUT
# from collections import Counter
from collections import OrderedDict
_ = int(input())
unique_words = list()
unique_counts = OrderedDict()
for i in range(_):
unique_words.append(input())
for j in unique_words:
unique_counts[j] = unique_... | null | Python/Word Order.py | Word Order.py | py | 404 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "collections.OrderedDict",
"line_number": 8,
"usage_type": "call"
}
] |
11074261 | import zmq
import time
import cv2
import room_pb2
camera = cv2.VideoCapture(0)
addr = 'tcp://192.168.1.342:5555'
ctx = zmq.Context()
s2 = ctx.socket(zmq.PAIR)
s2.connect(addr)
# time.sleep(1.0)
return_value, image = camera.read()
print("got image")
_, img_encoded = cv2.imencode('.jpg', image)
room_update = room_pb2.R... | null | grpc-tests/test_send.py | test_send.py | py | 659 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "zmq.Context",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "zmq.PAIR",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "cv2.imencode",
"line_numb... |
459362907 | from PIL import Image, ImageDraw, ImageFont
import matplotlib.pyplot as plt
import random
import string
def get_randcolor():
c1=random.randint(0,255)
c2=random.randint(0,255)
c3=random.randint(0,255)
return (c1,c2,c3)
def get_randstr():
str=''
char_set=string.ascii_letters + string.digits
for i in ... | null | 0010code_img.py | 0010code_img.py | py | 1,134 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "random.randint",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "string.ascii_letters",
... |
295553411 | #
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# ... | null | mogan/db/sqlalchemy/alembic/versions/cf73c09d3ff2_add_server_tags.py | cf73c09d3ff2_add_server_tags.py | py | 1,420 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "alembic.op.create_table",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.DateT... |
190892556 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# -----------------------------------------------------------
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.
# This product includes software developed at Datadog (https://www.datadoghq.com/).
# Copyrig... | null | tools/dogfooding/dogfood.py | dogfood.py | py | 4,780 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.getcwd",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.chdir",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "contextlib.contextmanager",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "src.dogfooded_commi... |
624207575 | import pandas as pd
from sklearn.naive_bayes import GaussianNB
from sklearn import metrics
import csv
import new_Professional as prof
def encoding(x):
if ( x == 'Unemployed'):
return 0
elif(x == 'Farming/Agriculture'):
return 1
elif(x == 'Government Service'):
return 2
... | null | Regression/professional/Professional_Naive.py | Professional_Naive.py | py | 1,364 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pandas.read_csv",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "sklearn.naive_bayes.GaussianNB",
"line_number": 43,
"usage_type": "call"
}
] |
337335723 | #!/usr/bin/env python
# Find horizontal grid lines in a random sample of RR images
import os
import sys
import cv2
import numpy as np
import random
import jenkspy
import matplotlib
from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas
from matplotlib.figure import Figure
from matplotlib.lines... | null | image_filtering/openCV_polygons/multi_opti_y.py | multi_opti_y.py | py | 2,085 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sys.path.append",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_num... |
76304615 | from pathlib import Path
import pandas as pd
from target_extraction.data_types import TargetTextCollection
from target_extraction.analysis.sentiment_error_analysis import (ERROR_SPLIT_SUBSET_NAMES,
error_split_df, PLOT_SUBSET_ABBREVIATION,
... | null | create_nt_error_subset_results.py | create_nt_error_subset_results.py | py | 4,623 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pathlib.Path",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "target_extraction.a... |
48685693 | from typing import List, Union, Tuple
import numpy as np
import torch
import math
from torch import Tensor, nn
class ConvBlock(nn.Module):
def __init__(self,
in_channels: int=17,
out_channels: int=256):
super().__init__()
self.extractor = nn.Sequential(
... | null | go/go_nn.py | go_nn.py | py | 6,189 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "torch.nn.Module",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "torch.nn.Sequential",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_... |
563499147 | from __future__ import with_statement
from time import strftime
import wx, sys, os
import wx.lib.scrolledpanel as scrolled
import Ft.Lib.Uri as uri
#===These are mine: =====
from fsrStuff.Labels import *
from fsrStuff.ConfigFile import *
from fsrStuff.SortCheck import *
from fsrStuff.umFuncs import *
from win32com.she... | null | FSR-Labels/refLabels.pyw | refLabels.pyw | pyw | 9,765 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.getcwd",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.sep",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "os.getcwd",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "os.sep",
"line_number": 31,
"... |
582667005 | import numpy as np
import matplotlib.pyplot as plt
from tensorflow import keras
import matplotlib.pyplot as plt
import tensorflow as tf
from tensorflow import keras
import pathlib
import tensorflow_datasets as tfds
from tensorflow.keras import layers
import os
import SSIM_utils
###Constants
SSIM_max = 0.9
batch_size ... | null | Semester_project_2_code/SSIM and Shadow attack/local_global_attack.py | local_global_attack.py | py | 4,831 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "numpy.ones",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.sqrt",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "numpy.sqrt",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "tensorflow.keras.optimizers.SGD",
... |
559495545 | import numpy as np
import matplotlib.pyplot as plt
lambda_ = 1000000.0
lambda_ = 1.0
# lambda_ = 0.000001
def beta_ridge(y):
return y / (1.0 + lambda_)
def beta_lasso(y):
if type(y) is not np.ndarray:
if y < (-lambda_ / 2.0):
return y + lambda_ / 2.0
elif y <= (lambda_ / 2.0):
... | null | ridge_lasso.py | ridge_lasso.py | py | 949 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "numpy.ndarray",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "numpy.arange",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.xlabel",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "matplotlib.p... |
353984797 | import pytesseract
import cv2
pytesseract.pytesseract.tesseract_cmd = r'C:\Program Files\Tesseract-OCR\tesseract.exe'
image = cv2.imread('preview.png')
image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
result = image.copy()
# boxes = pytesseract.pytesseract.image_to_boxes(image, config='-c tessedit_char_whitelist=01234... | null | ocr.py | ocr.py | py | 1,083 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pytesseract.pytesseract",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "cv2.imread",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2RGB",... |
299274262 | #!/bin/python
# -*- coding: utf-8 -*-
import pycurl
# 書き出すファイルを指定する
op_file = open('/home/foxtrot0304/pycurl_output','wb')
# pycurlの処理を記述
c = pycurl.Curl()
c.setopt(c.URL, 'http://pycurl.io/')
# 返り値をファイルに書き出すよう記述
c.setopt(c.WRITEDATA, op_file)
c.perform()
| null | python/test/pycurl2.py | pycurl2.py | py | 331 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pycurl.Curl",
"line_number": 9,
"usage_type": "call"
}
] |
226220038 | '''
Created on Feb 13, 2021
@author: boogie
'''
import xbmcaddon
import os
import urlparse
import sys
from xml.dom import minidom
rootpath = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "..", "..")
class Addon(xbmcaddon.Addon):
def __init__(self, id=None):
if id is None:
ur... | null | script.module.tinyxbmc/lib/tinyxbmc/stubmod.py | stubmod.py | py | 1,307 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.path.join",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path.abspath",
"line... |
41659965 | import os,sys
import torch
import torch.nn as nn
import torch.optim as optim
import torch.backends.cudnn as cudnn
import torch.nn.init as init
import argparse
from torch.autograd import Variable
import torch.utils.data as data
from data import v2, v1, AnnotationTransform, VOCDetection, detection_collate, VOCroot, VOC_C... | null | train_priming.py | train_priming.py | py | 17,691 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.path.expanduser",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "sys.path.append",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"... |
215821178 | from dlib import get_frontal_face_detector
import numpy as np
import cv2
import os
from tqdm import tqdm
face_detector = get_frontal_face_detector()
faces = 0
no_faces = 0
too_many_faces = 0
fcs = len(os.listdir('images/'))
for img in tqdm(os.listdir('images')):
im = cv2.imread('images/' + img)
im = cv2... | null | dlib_check.py | dlib_check.py | py | 1,039 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "dlib.get_frontal_face_detector",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "tqdm.tqdm",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"... |
639857503 | from epics import PV, caget
from jupy4syn.commands.ICommand import ICommand
class putCommand(ICommand):
def __init__(self, config):
self.config = config
def exec(self, parameters):
self.pv.put(parameters, wait=False)
def args(self, initial_args):
# Parameter checking
if n... | null | jupy4syn/commands/putCommand.py | putCommand.py | py | 1,955 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "jupy4syn.commands.ICommand.ICommand",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "epics.PV",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "epics.PV",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "epics.PV",
"... |
272156201 | # -*- coding: utf-8 -*-
from django.utils import timezone
from django.db import models
from django.contrib.auth.models import User
from decimal import Decimal
import numpy as np
# Create your models here.
from .utils import decorate_formula
from annoying.fields import AutoOneToOneField
# Атом
class Dict_atom(models... | null | chemcloud/chemical/chemical_models.py | chemical_models.py | py | 51,763 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.db.models.Model",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "django.db.models.IntegerField",
"line_number": 16,
"usage_type": "call"
},
{
"api_na... |
226907943 | import vtk
import cv2
from fit_plane import fit_plane
colors = vtk.vtkNamedColors()
# Create the RenderWindow, Renderer and Interactor.
ren1 = vtk.vtkRenderer()
renWin = vtk.vtkRenderWindow()
renWin.AddRenderer(ren1)
iren = vtk.vtkRenderWindowInteractor()
iren.SetRenderWindow(renWin)
reader=vtk.vtkSTLReader()
reader.... | null | system/example/VTK_GUIDE/crack_coordinate.py | crack_coordinate.py | py | 6,779 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "vtk.vtkNamedColors",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "vtk.vtkRenderer",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "vtk.vtkRenderWindow",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "vtk.vtkRenderWind... |
514664417 | # -*- coding: utf-8 -*-
"""
Created on 18-5-30 下午4:55
@author: ronghuaiyang
"""
from __future__ import print_function
import torch
import numpy as np
from config.config import Config as opt
from PIL import Image
import os
import cv2
import torchvision
def load_image(img):
images = []
img = cv2.imread(img, 1)... | null | rec_test.py | rec_test.py | py | 6,397 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "cv2.imread",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.float32",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "cv2.resize",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.ascontiguousarray",
"li... |
393417988 | import pytest
import tasks
from tasks import Task
@pytest.fixture(autouse=True)
def initialized_tasks_db(tmpdir):
"""Connect to db before testing, disconnect after."""
tasks.start_tasks_db(str(tmpdir), 'tiny')
yield # this is where the testing happens
# Teardown : stop db
tasks.stop_tasks_db()
d... | null | python/pytest/ch2/tasks_proj/tests/func/test_unique_id_2.py | test_unique_id_2.py | py | 604 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "tasks.start_tasks_db",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "tasks.stop_tasks_db",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pytest.fixture",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "tasks.add",
... |
366079833 | from sklearn import datasets
from sklearn.svm import SVC
from scipy import misc
import numpy as np
digits = datasets.load_digits()
features = digits.data
labels = digits.target
clf = SVC(gamma = 0.001)
clf.fit(features, labels)
img = misc.imread("number.jpg")
img = misc.imresize(img, (8,8))
img = img.astype(digits.... | null | nevronska-mreza/testni_mnest.py | testni_mnest.py | py | 514 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sklearn.datasets.load_digits",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sklearn.datasets",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "sklearn.svm.SVC",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "scipy.mis... |
189883544 | from AccessControl.SecurityInfo import ClassSecurityInformation
from ftw.upgrade import ProgressLogger
from opengever.base.model import create_session
from opengever.contact.models import Address
from opengever.contact.models import MailAddress
from opengever.contact.models import Organization
from opengever.contact.mo... | null | opengever/contact/syncer/object_syncer.py | object_syncer.py | py | 14,109 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "logging.getLogger",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "ftw.upgrade.ProgressLogger",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "Access... |
96552042 | """
ykval.db
~~~~~~~~
Database Handler
"""
import logging
from .config import settings
logger = logging.getLogger(__name__)
class DBHandler(object):
""" Database handler wrapper """
def __init__(self, db):
self.settings = settings['DATABASES'][db]
# This is not nice, but works well.
... | null | yubistack/db.py | db.py | py | 3,064 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "logging.getLogger",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "config.settings",
"line_number": 17,
"usage_type": "name"
}
] |
96524144 | import os
import json
import cv2
import numpy as np
import argparse
import pandas as pd
from tqdm import tqdm
parser = argparse.ArgumentParser()
parser.add_argument("-f", "--file", required = True)
args = parser.parse_args()
def get_clutter(path):
# read image
img = cv2.imread(path)
# convert to graysca... | null | opencv_examples/get_image_clutter.py | get_image_clutter.py | py | 1,809 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2GRAY",
... |
184918977 | #!/usr/bin/python3 -u
# -*- coding: utf-8 -*-
class Log:
def __init__(self):
self.fg_none = '\033[0m'
self.fg_bold = '\033[1m'
self.fg_lightgrey = '\033[37m'
self.fg_red = '\033[91m'
self.fg_green = '\033[92m'
self.fg_yellow = '\033[93m'
self.fg_set = self.... | null | design/dcos_tool/setup/lib/log.py | log.py | py | 7,382 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "datetime.datetime.now",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 20,
"usage_type": "attribute"
}
] |
592550910 | # -*- coding: utf-8 -*-
import codecs
import re
import os
from time import time
from reportportal_client import ReportPortalService
from robot.libraries.BuiltIn import BuiltIn
from robot.utils import PY2
from urllib3.exceptions import ResponseError
from .variables import Variables
# https://stackoverflow.com/a/2451... | null | reportportal_listener/service.py | service.py | py | 8,004 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "re.compile",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "re.UNICODE",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "re.VERBOSE",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "codecs.decode",
"line_... |
97246515 | """Module containing integration tests for the refund form."""
from datetime import datetime, timezone
import os
import tempfile
import pytest
from bs4 import BeautifulSoup
from django.contrib.auth.models import User
from pat import settings
from refund.models import Refund, Project, CostCentre
from tests.conftest im... | null | tests/integration/refund/test_refund_form.py | test_refund_form.py | py | 10,195 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.path.join",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path.abspath",
"line... |
564013651 | # -*- coding: utf-8 -*-
from telegram.ext import Updater, CommandHandler, MessageHandler, Filters, CallbackQueryHandler
from telegram import InlineKeyboardButton, InlineKeyboardMarkup, ParseMode
from tokens import test_token, restador_token
import json
import logging
class Seccio():
def __init__(self, nom, id):
... | null | interseccio_bot.py | interseccio_bot.py | py | 4,116 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "json.load",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "logging.info",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "logging.warning",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "telegram.InlineKeyboardButton"... |
584753739 | from _datetime import datetime
from datetime import timedelta
from parse import get_configuration_section
import traceback
from login import request_login, session, header1
input_deatils = get_configuration_section('smoke_details','configuration.ini',"'")
p = request_login()
time_list = timedelta(minutes=5)
start_ti... | null | scripts/new_discover_service_check.py | new_discover_service_check.py | py | 1,788 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "parse.get_configuration_section",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "login.request_login",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "datetime.timedelta",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": ... |
281905838 | from pathlib import Path
import numpy as np
import scipy.optimize as opt
from tremulator import Interpolator
from tqdm import tqdm
import lensing_haloes.settings as settings
import lensing_haloes.cosmo.cosmo as cosmo
import lensing_haloes.data.observational_data as obs_data
import lensing_haloes.halo.profiles as prof... | null | lensing_haloes/halo/model.py | model.py | py | 28,688 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "lensing_haloes.settings.TABLE_DIR",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "lensing_haloes.settings",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "numpy.tanh",
"line_number": 45,
"usage_type": "call"
},
{
"api_nam... |
321339774 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
# append tinyfacerec to module search path
sys.path.append("..")
# import numpy and matplotlib colormaps
import numpy as np
# import tinyfacerec modules
import os
from subspace import fisherfaces, project, reconstruct, LBP
from face_detection.study_test.util i... | null | face_detection/study_test/scripts/exmple_LBP.py | exmple_LBP.py | py | 1,497 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sys.path.append",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "os.getcwd",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "face_detection.study_test.util.... |
269733533 | # -*- coding: utf-8 -*-
#
# Usage: Download all stock code info from TWSE
#
# TWSE equities = 上市證券
# TPEx equities = 上櫃證券
#
import csv
from collections import namedtuple
from pymongo import MongoClient
import requests
from lxml import etree
TWSE_EQUITIES_URL = 'http://isin.twse.com.tw/isin/C_public.jsp?strMode=2'
TP... | null | fetchs/fetch.py | fetch.py | py | 1,554 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "collections.namedtuple",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "lxml.etree.HTML",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "lxml.etree",
... |
295641996 | import unittest
from datetime import date
import month
class TestMonth(unittest.TestCase):
def setUp(self):
self.m1 = month.Month(2014, 1)
self.m2 = month.Month(2015, 3)
# Tested in sql server:
# DECLARE @d1 date = '2014-1-25'
# DECLARE @d2 date = '2015-3-20'
# DE... | null | test_month.py | test_month.py | py | 2,552 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "unittest.TestCase",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "month.Month",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "month.Month",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"lin... |
13576352 | import argparse
import os
import tarfile
from rdt.hyper_transformer import HyperTransformer
def download_airbnb_dataset(bucket, dirname):
if not os.path.exists(dirname):
os.makedirs(dirname)
sessions_KEY = 'sdv-demo/sessions_demo.csv'
users_KEY = 'sdv-demo/users_demo.csv'
meta_KEY = 'sdv-de... | null | examples/airbnb.py | airbnb.py | py | 1,674 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.path.exists",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "os.makedirs",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_numb... |
540366027 | import sys
import json
import csv
from datetime import datetime
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
import pandas as pd
import numpy as np
import pickle
if __name__ == '__main__':
fname = sys.argv[1]
with open(fname, 'r') as f:
all_dates = []
reader = csv.reader(f)
for row in read... | null | Basic Sentiment Analysis/timeseries.py | timeseries.py | py | 1,225 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sys.argv",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "csv.reader",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pandas.DatetimeIndex",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.ones",
"line_... |
415882060 | #!/usr/bin/env python
import os
import subprocess
import shlex
import argparse
parser = argparse.ArgumentParser(
description="""Save a file or directory in git and upload it.
It leaves behind a file with the name of the saved file plus ".hash". This hash
file is what you commit into git and share with yo... | null | click_project/commands/git_record/git-record_save.py | git-record_save.py | py | 1,876 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "subprocess.check_output",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "shlex.split",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "os.path.ab... |
488731978 | # Importing the Keras libraries and packages
from keras.models import Sequential
from keras.layers import Conv2D
from keras.layers import MaxPooling2D
from keras.layers import Flatten
from keras.layers import Dense
# Initialising the CNN
classifier = Sequential()
# Step 1 - Convolution
classifier.add(Conv2D(32, (3, 3... | null | Spectacular.py | Spectacular.py | py | 3,168 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "keras.models.Sequential",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "keras.layers.Conv2D",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "keras.layers.MaxPooling2D",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "... |
631733661 | import tsrc
import pytest
def test_happy_grouping() -> None:
group_list = tsrc.GroupList(elements={"a", "b", "b", "c"})
group_list.add("default", {"a", "b"})
group_list.add("other", {"c"}, includes=["default"])
actual = group_list.get_elements(groups=["other"])
assert actual == {"a", "b", "c"}
... | null | tsrc/test/test_groups.py | test_groups.py | py | 2,517 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "tsrc.GroupList",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "tsrc.GroupList",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "tsrc.GroupList",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "pytest.raises",
"line... |
346278939 | import os
from argparse import ArgumentParser
import drone_racer
os.chdir(os.path.dirname(os.path.abspath(__file__)))
parser = ArgumentParser(description='Interface graphique "Drone Racer"')
parser.add_argument('--fancy-title', dest='fancy', action='store_true',
help='Utilise une barre de titre ... | null | main.py | main.py | py | 1,164 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.chdir",
"line_number": 7,
"usage_type": "call"
},
{
"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... |
512338008 | '''
ADL Final - News Standpoint Style Transfer
Reference:
https://github.com/Nrgeup/controllable-text-attribute-transfer
author = {Ke Wang and Hang Hua and Xiaojun Wan},
title = {Controllable Unsupervised Text Attribute Transfer via Editing Entangled Latent Representation},
booktitle = {NeurIPS},
year = {2... | null | BERT/data.py | data.py | py | 7,566 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "torch.utils.data.Dataset",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "torch.LongTensor",
"line_number": 75,
"usage_type": "call"
},
{
"api_name": "torch.stack",
"line_number": 88,
"usage_type": "call"
},
{
"api_name": "torch.stack",
... |
551325516 | __author__ = 'alex'
#Programme Cron pour lancer différentes commande à un temps t donné
# t se trouve dans la table interval , variable time
#from crontab import CronTab
import subprocess
import sqlite3
import arbiter
import time
import poller
#On crée le ficher crontab
def init():
subprocess.call(['touch', 'f... | null | bin/scheduler.py | scheduler.py | py | 2,274 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "subprocess.call",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "subprocess.call",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "subprocess.call",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "time.time",
"line... |
505476905 | # -*- coding: utf-8 -*-
# 计算 哈姆雷特 中 单词的词频 就是具体单词出现的次数
from nltk.corpus import gutenberg
from nltk.probability import *
'''
FreqDist
这个函数是来创建一个所给数据的频率分布 那这里的数据是什么呢 首先是所有的单词
也就是 每个单词 使用了多少次。
isalpha
测试所有 字符是否都是字母,也就是说他是一个单词,而不是标点符号之类的
'''
allwords = gutenberg.words('shakespeare-hamlet.txt') # 把书中所有 单词 和标点 放入列表
fd2 = ... | null | Data Processing/4.2/freqG20.py | freqG20.py | py | 912 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "nltk.corpus.gutenberg.words",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "nltk.corpus.gutenberg",
"line_number": 14,
"usage_type": "name"
}
] |
314243441 | #python code: BEACON
import matplotlib.pyplot as plt
import matplotlib.pyplot as plt1
import time
import math
from random import randint
import numpy as nr
import math
from decimal import *
r=0
y10 = []
starttime=time.time()
visited=0
times=0
mfile=open("mobile_node_data.txt","w")
mfile.write("\t\tData collected by Mo... | null | 1537368885244_without charge_20.py | 1537368885244_without charge_20.py | py | 22,767 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "time.time",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "time.asctime",
"line_number": 303,
"usage_type": "call"
},
{
"api_name": "time.localtime",
"line_number"... |
126812737 | from django.contrib.auth import get_user_model
from django.urls import reverse
from django.test import TestCase
from rest_framework import status
from rest_framework.test import APIClient
from core.models import Domain
from dictionary.serializers import DomainSerializer
DOMAIN_URL = reverse('dictionary:domain-list'... | null | app/dictionary/tests/test_domain.py | test_domain.py | py | 3,175 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.urls.reverse",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "django.urls.reverse",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "core.models.Domain.objects.create",
"line_number": 22,
"usage_type": "call"
},
{
"api_nam... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.