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
152207515
import numpy as np import pickle from functools import partial from model_module import model import load_format_data import plot_model ## ## The foolowing classes are considered LIST_B classes: ## seq_to_x_model , assay_to_x_model , control_to_x_model , sequence_embedding _to_x_model class seq_to_x_model(): ...
null
submodels_module.py
submodels_module.py
py
40,875
python
en
code
null
code-starcoder2
76
[ { "api_name": "load_format_data.get_ordinal", "line_number": 18, "usage_type": "attribute" }, { "api_name": "load_format_data.get_onehot", "line_number": 20, "usage_type": "attribute" }, { "api_name": "functools.partial", "line_number": 29, "usage_type": "call" }, { ...
605954504
__all__ = ['LoggingLevel', 'Logger', 'nlStatus', 'resetNlStatus'] from RingerCore.Configure import EnumStringification import logging #from RingerCore import os_environ_get # TODO With the Configure method it is possible to create a singleton to # retrieve all loggers using the global configured message level class L...
null
python/Logger.py
Logger.py
py
11,311
python
en
code
null
code-starcoder2
76
[ { "api_name": "RingerCore.Configure.EnumStringification", "line_number": 9, "usage_type": "name" }, { "api_name": "logging.DEBUG", "line_number": 14, "usage_type": "attribute" }, { "api_name": "logging.DEBUG", "line_number": 15, "usage_type": "attribute" }, { "api...
424542880
import torch import numpy as np import tensorflow as tf from tqdm import tqdm from tensorflow.keras.models import Model from tensorflow.keras.layers import Input, Dense, Dropout, Embedding, LSTM, Bidirectional, concatenate, Flatten, Lambda, Reshape, Attention from stog.utils.string import START_SYMBOL, END_SYMBOL, fin...
null
model/text_to_amr.py
text_to_amr.py
py
24,521
python
en
code
null
code-starcoder2
76
[ { "api_name": "stog.data.vocabulary.DEFAULT_OOV_TOKEN", "line_number": 38, "usage_type": "argument" }, { "api_name": "encoder.Encoder", "line_number": 46, "usage_type": "call" }, { "api_name": "decoder.Decoder", "line_number": 47, "usage_type": "call" }, { "api_na...
539304021
# -*- coding: utf-8 -*- """ Created on Tue Apr 6 13:13:34 2021 @author: sense """ import os import sys import numpy as np import scipy.io.wavfile as wav from speechpy.feature import mfcc mean_signal_length = 32000 # Empirically calculated for the given data set def get_feature_vector_from_mfcc(...
null
utils.py
utils.py
py
2,016
python
en
code
null
code-starcoder2
76
[ { "api_name": "scipy.io.wavfile.read", "line_number": 19, "usage_type": "call" }, { "api_name": "scipy.io.wavfile", "line_number": 19, "usage_type": "name" }, { "api_name": "numpy.pad", "line_number": 26, "usage_type": "call" }, { "api_name": "speechpy.feature.mfc...
625000511
#!/usr/bin/python # # v1.2.3 Copyright 2013 ProfitBricks GmbH # # 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 applic...
null
src/pbcli.py
pbcli.py
py
13,004
python
en
code
null
code-starcoder2
76
[ { "api_name": "pb.api.argsparser.ArgsParser", "line_number": 37, "usage_type": "call" }, { "api_name": "pb.api.argsparser", "line_number": 37, "usage_type": "attribute" }, { "api_name": "pb.api", "line_number": 37, "usage_type": "name" }, { "api_name": "pb.api.err...
10806369
import jwt import requests, time #from . import config def gbal(id): payload: dict = { "uid": id, "timeIssued": round(time.time() * 1000) } token = jwt.encode(payload, config["ecokey"]) resp = requests.get("http://192.241.218.152:3000/getbal/" + token.decode("utf-8")) respcontent = resp.json() ret...
null
plugins/lol/eco.py
eco.py
py
694
python
en
code
null
code-starcoder2
76
[ { "api_name": "time.time", "line_number": 9, "usage_type": "call" }, { "api_name": "jwt.encode", "line_number": 11, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 12, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 17, ...
393279980
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
null
azure-mgmt-batchai/azure/mgmt/batchai/models/file_server_status.py
file_server_status.py
py
2,351
python
en
code
null
code-starcoder2
76
[ { "api_name": "msrest.serialization.Model", "line_number": 15, "usage_type": "name" } ]
204755586
############################################## ## Custom DPS Module. ## Name: Logging Module. ## Description: All log-related methods go here. ## Author: RackünSec ## Author URL: https://github.com/RackunSec/ ## ## ## REQUIREMENTS: import datetime from os import getcwd import re ## Method: log the entered command: de...
null
modules/dps_log.py
dps_log.py
py
760
python
en
code
null
code-starcoder2
76
[ { "api_name": "re.sub", "line_number": 17, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 20, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 20, "usage_type": "attribute" }, { "api_name": "os.getcwd", "...
344669695
from sklearn.datasets import load_svmlight_file import matplotlib.pyplot as plt import numpy as np from sklearn import linear_model from sklearn.metrics import mean_squared_error from time import time def get_data(name): data = load_svmlight_file(name) return data[0], data[1] X, y = get_data("abalone.txt") ...
null
lab1/lab1.py
lab1.py
py
2,787
python
en
code
null
code-starcoder2
76
[ { "api_name": "sklearn.datasets.load_svmlight_file", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.newaxis", "line_number": 16, "usage_type": "attribute" }, { "api_name": "sklearn.linear_model.LinearRegression", "line_number": 34, "usage_type": "call" ...
173170201
from django import forms from lib import customform from lib import widgets from django.conf import settings from django_mako_plus.controller import view_function from .. import dmp_render, dmp_render_to_response from homepage import models as hmod from datetime import datetime @view_function def process_request(requ...
null
homepage/views/form.py
form.py
py
2,399
python
en
code
null
code-starcoder2
76
[ { "api_name": "homepage.models.Note.objects.all", "line_number": 26, "usage_type": "call" }, { "api_name": "homepage.models.Note", "line_number": 26, "usage_type": "attribute" }, { "api_name": "homepage.models", "line_number": 26, "usage_type": "name" }, { "api_na...
92359857
# coding:utf-8 from libnmap.parser import NmapParser path = "F:\\workspace\\xx-scan\\apps\\scan\\datas\\nmap_results\\sV.xml" FilterByIp = True def get_current_host(_host, workspace): _ip = _host.id _mac = _host.mac _vendor = _host.vendor host = Host(name=_ip, ip=_ip, type="自发现设备", os="-", mac=_ma...
null
core/portscan/xxscan.py
xxscan.py
py
3,863
python
en
code
null
code-starcoder2
76
[ { "api_name": "scan.models.Workspace.objects.get", "line_number": 24, "usage_type": "call" }, { "api_name": "scan.models.Workspace.objects", "line_number": 24, "usage_type": "attribute" }, { "api_name": "scan.models.Workspace", "line_number": 24, "usage_type": "name" },...
33505743
import hashlib import json import time import requests import xmltodict as xmltodict from flask import request, make_response, jsonify from flask_login import login_user, login_required, current_user from . import wxfwh from main import db, nowdates from .sendnotification import send_exam_notification from .. import a...
null
flasks/main/wxfwh/views.py
views.py
py
7,675
python
en
code
null
code-starcoder2
76
[ { "api_name": "models.WXUser.query.filter", "line_number": 20, "usage_type": "call" }, { "api_name": "models.WXUser.query", "line_number": 20, "usage_type": "attribute" }, { "api_name": "models.WXUser", "line_number": 20, "usage_type": "name" }, { "api_name": "mod...
604008015
# class assisting in finding / indentifying a device import urllib3, certifi, json import usb.core, sys http = urllib3.PoolManager(cert_reqs='CERT_REQUIRED', ca_certs=certifi.where()) # http(s) pool class DeviceFinder(): DEVICE_ARRAY = None """DeviceFinder - methods to help identify a device by Apples, many, device ...
null
devicefinder.py
devicefinder.py
py
4,121
python
en
code
null
code-starcoder2
76
[ { "api_name": "urllib3.PoolManager", "line_number": 4, "usage_type": "call" }, { "api_name": "certifi.where", "line_number": 4, "usage_type": "call" }, { "api_name": "json.load", "line_number": 16, "usage_type": "call" }, { "api_name": "usb.core.core.find", "l...
336537006
# # BSD 3-Clause License # # Copyright (c) 2017-2018, plures # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, # this...
null
python/test_gumath.py
test_gumath.py
py
19,402
python
en
code
null
code-starcoder2
76
[ { "api_name": "unittest.TestCase", "line_number": 67, "usage_type": "attribute" }, { "api_name": "xnd.xnd", "line_number": 71, "usage_type": "call" }, { "api_name": "gumath.functions.sin", "line_number": 72, "usage_type": "call" }, { "api_name": "gumath.functions"...
260164770
import numpy as np import librosa from utils import feature_extraction, compute_distance_matrix from teacher import Expert from eval import p_r_f, idx2time class Env(): def __init__(self, audio_name, window_width=12): _, self.gt, self.m_h_p = feature_extraction(audio_name) # m_h_p.shape = (n, 80, 3) ...
null
env.py
env.py
py
3,880
python
en
code
null
code-starcoder2
76
[ { "api_name": "utils.feature_extraction", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.mean", "line_number": 15, "usage_type": "call" }, { "api_name": "utils.compute_distance_matrix", "line_number": 16, "usage_type": "call" }, { "api_name": "tea...
440318759
# UQpy is distributed under the MIT license. # # Copyright (C) 2018 -- Michael D. Shields # # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated # documentation files (the "Software"), to deal in the Software without restriction, including without limitation th...
null
src/UQpy/RunModel.py
RunModel.py
py
58,445
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.ndarray", "line_number": 152, "usage_type": "attribute" }, { "api_name": "os.getcwd", "line_number": 179, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 184, "usage_type": "call" }, { "api_name": "os.path.join", "line_n...
487995984
import time import argparse from utilities import * from models import * import models as lib from data_loader import * import wandb # FIX THE RANDOM SEED FOR REPRODUCIBILITY SEED = 1234 torch.manual_seed(SEED) np.random.seed(SEED) torch.backends.cudnn.benchmark = False # reduces the performance parser = argparse.Arg...
null
mondrian_sequential.py
mondrian_sequential.py
py
10,503
python
en
code
null
code-starcoder2
76
[ { "api_name": "argparse.ArgumentParser", "line_number": 15, "usage_type": "call" }, { "api_name": "wandb.init", "line_number": 46, "usage_type": "call" }, { "api_name": "wandb.init", "line_number": 48, "usage_type": "call" }, { "api_name": "wandb.watch", "line...
247146982
import random import numpy as np import os from collections import deque from keras.models import Sequential, clone_model from keras.layers import Dense from keras.optimizers import Adam from keras.initializers import Orthogonal, Zeros from keras.callbacks import History from tqdm import trange import time import argpa...
null
rl_package/dqn_vanilla/dqn_keras.py
dqn_keras.py
py
19,081
python
en
code
null
code-starcoder2
76
[ { "api_name": "collections.deque", "line_number": 55, "usage_type": "call" }, { "api_name": "keras.models.Sequential", "line_number": 62, "usage_type": "call" }, { "api_name": "keras.layers.Dense", "line_number": 66, "usage_type": "call" }, { "api_name": "keras.in...
227479610
from django.contrib import admin from django.utils.translation import ugettext_noop as _ from transurlvania.defaults import * admin.autodiscover() urlpatterns = patterns('garfield.views', url(r'^$', 'home'), url(r'^admin/', include(admin.site.urls)), url(r'^garfield/', include('garfield.urls')), url(...
null
tests/urls_without_lang_prefix.py
urls_without_lang_prefix.py
py
371
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.contrib.admin.autodiscover", "line_number": 6, "usage_type": "call" }, { "api_name": "django.contrib.admin", "line_number": 6, "usage_type": "name" }, { "api_name": "django.contrib.admin.site", "line_number": 10, "usage_type": "attribute" }, { ...
296356157
from pandac.PandaModules import * from direct.task import Task from math import pi, sin, cos from direct.showbase.ShowBase import ShowBase from direct.actor.Actor import Actor from pandac.PandaModules import * from direct.interval.IntervalGlobal import Sequence from pandac.PandaModules import Point3 from pandac...
null
Doomsday_BossbotHQScene.py
Doomsday_BossbotHQScene.py
py
14,396
python
en
code
null
code-starcoder2
76
[ { "api_name": "direct.showbase.ShowBase.ShowBase", "line_number": 35, "usage_type": "name" }, { "api_name": "direct.showbase.ShowBase.ShowBase.__init__", "line_number": 37, "usage_type": "call" }, { "api_name": "direct.showbase.ShowBase.ShowBase", "line_number": 37, "usag...
228751462
from rest_framework import serializers from article.serializers import ArticleSerializer from interest.serializers import InterestSerializer from user.serializers import UserSerializer from .models import Comment class ReplySerializer(serializers.ModelSerializer): class Meta: model = Comment fie...
null
Moisha_Back/comment/serializers.py
serializers.py
py
1,437
python
en
code
null
code-starcoder2
76
[ { "api_name": "rest_framework.serializers.ModelSerializer", "line_number": 10, "usage_type": "attribute" }, { "api_name": "rest_framework.serializers", "line_number": 10, "usage_type": "name" }, { "api_name": "models.Comment", "line_number": 12, "usage_type": "name" }, ...
129875351
import dash_core_components as dcc import dash_html_components as html from dash.dependencies import Input, Output, State from dash_utils import row # from data_loader import * from df_summary_multi import * # from template_app import * # from phik_frontend import * from data_loader import layout as dt_layout from df...
null
demos/index.py
index.py
py
3,578
python
en
code
null
code-starcoder2
76
[ { "api_name": "dash_utils.row", "line_number": 22, "usage_type": "call" }, { "api_name": "dash_html_components.A", "line_number": 23, "usage_type": "call" }, { "api_name": "dash_html_components.Button", "line_number": 23, "usage_type": "call" }, { "api_name": "das...
5017799
import os import time import pytest from page.login_page import Login from selenium import webdriver from page.policy_input_page import PolicyInputPage from page.menu_page import MenuPage from page.authorization_page import AuthorizationPage from page.search_policy_page import SearchPage import allure from te...
null
MetLife/testcase/test_mdes.py
test_mdes.py
py
4,199
python
en
code
null
code-starcoder2
76
[ { "api_name": "testcase.mdes_base_case.MdesBaseCase.write_dictinlist_into_sheet", "line_number": 23, "usage_type": "call" }, { "api_name": "testcase.mdes_base_case.MdesBaseCase", "line_number": 23, "usage_type": "name" }, { "api_name": "pytest.fixture", "line_number": 18, ...
323597093
# Copyright 2012 OpenStack Foundation # All Rights Reserved. # # 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 requ...
null
vmware_nsx/plugins/dvs/dhcp.py
dhcp.py
py
2,840
python
en
code
null
code-starcoder2
76
[ { "api_name": "oslo_log.log.getLogger", "line_number": 22, "usage_type": "call" }, { "api_name": "oslo_log.log", "line_number": 22, "usage_type": "name" }, { "api_name": "oslo_config.cfg.StrOpt", "line_number": 25, "usage_type": "call" }, { "api_name": "oslo_confi...
646636309
from os import listdir from os.path import isfile, join from PIL import Image import numpy as np import deep_nn_step_by_step as dnn from sklearn.neural_network import MLPClassifier from sklearn.externals import joblib def flatten_image(img, is_car=True, flat_image_size=3072): flat = list(img.getdata()) label ...
null
scripts/car_detection.py
car_detection.py
py
7,008
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.array", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 18, "usage_type": "call" }, { "api_name": "PIL.Image.open", "line_number": 23, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number":...
64785979
import torch import torch.nn as nn from torch.autograd import Variable import math from rlpytorch import ArgsProvider, add_err class MultiplePrediction: def __init__(self, args=None): self.args = ArgsProvider( call_from = self, define_args = [ ], fixed_args ...
null
go/multiple_prediction.py
multiple_prediction.py
py
1,738
python
en
code
null
code-starcoder2
76
[ { "api_name": "rlpytorch.ArgsProvider", "line_number": 10, "usage_type": "call" }, { "api_name": "torch.nn.NLLLoss", "line_number": 17, "usage_type": "call" }, { "api_name": "torch.nn", "line_number": 17, "usage_type": "name" }, { "api_name": "torch.nn.MSELoss", ...
321008623
from mesa_geo.geoagent import GeoAgent from mesa_geo.shapes import as_shape, Point import pyproj from rtree import index from shapely.ops import transform as s_transform from functools import partial class GeoSpace: def __init__(self, bbox=None, crs=None): """Base class for GIS enabled mesa modeling. ...
null
mesa_geo/geospace.py
geospace.py
py
10,111
python
en
code
null
code-starcoder2
76
[ { "api_name": "pyproj.Proj", "line_number": 50, "usage_type": "call" }, { "api_name": "pyproj.Proj", "line_number": 51, "usage_type": "call" }, { "api_name": "rtree.index.Index", "line_number": 52, "usage_type": "call" }, { "api_name": "rtree.index", "line_num...
468607412
#!/usr/bin/env python # -*- coding: UTF-8 -*- '''================================================= @Project -> File :Test_two -> department @IDE :PyCharm @Author :hang.zhao @Date :2020/8/23 13:46 @Desc : ==================================================''' from selenium.webdriver.common.by import By from time...
null
zuoye_weixin/page1/department.py
department.py
py
1,218
python
en
code
null
code-starcoder2
76
[ { "api_name": "zuoye_weixin.page1.base_page.BasePage", "line_number": 16, "usage_type": "name" }, { "api_name": "selenium.webdriver.common.by.By.XPATH", "line_number": 19, "usage_type": "attribute" }, { "api_name": "selenium.webdriver.common.by.By", "line_number": 19, "us...
146417446
import numpy as np import matplotlib.pyplot as plt fig, ax = plt.subplots(1,2) plt.ion() plt.show(block = False) v = 0.8 C0 = lambda x: 2.0*(-x**3 -(x-1)*v/2.0 + x)/(x + 1) x = np.linspace(-0.97,1.5,100) h = 0.005 T = 200000 e = 0.01 alpha = 1.0 sigma_c = 0.1 eta = lambda rho: np.exp(-(rho)**2/(2*sigma_c**2))/np.s...
null
models/python/dynamical/fast_slow/critical.py
critical.py
py
999
python
en
code
null
code-starcoder2
76
[ { "api_name": "matplotlib.pyplot.subplots", "line_number": 4, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 4, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.ion", "line_number": 5, "usage_type": "call" }, { "api_name": "matpl...
556491814
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import librosa import numpy as np import tensorflow as tf path = '/Users/janghyeonan/flask/tmp/sound.wav' save_path = '/Users/janghyeonan/flask/model/emotion_model' ## 훈련데이터, 테스트데이터 세팅하는 함수 def dataMake(path): # input : 음성파일이 담겨있는 파일경로 ex. "/Users/.../sori.wav" # 음...
null
etc/JH/windows/emotionPre.py
emotionPre.py
py
1,992
python
en
code
null
code-starcoder2
76
[ { "api_name": "librosa.load", "line_number": 15, "usage_type": "call" }, { "api_name": "librosa.feature.mfcc", "line_number": 16, "usage_type": "call" }, { "api_name": "librosa.feature", "line_number": 16, "usage_type": "attribute" }, { "api_name": "numpy.mean", ...
386927497
# -*- coding: utf-8 -*- import xlrd import os def read_excel(path, file): result = [] file_path = os.path.abspath(os.path.dirname(__file__)) file_path = os.path.join(file_path, 'SV71_VDS.xlsx') if not file: excel_file = xlrd.open_workbook(file_path) else: excel_file = xlrd.open_wor...
null
console/read_las_config.py
read_las_config.py
py
699
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.abspath", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path.join", "line_nu...
237393200
import argparse import numpy as np import tensorflow as tf from config import Config from dataset import DataProvider from madelight.evaluate import EvalHelper from madelight.utils.nlp import WordVecDict from model import Seq2SeqBasicModel def main(): # Parse arguments parser = argparse.ArgumentParser() ...
null
model/seq2seq.lstm.attention.pretrained_vec.vanilla/eval_val.py
eval_val.py
py
1,769
python
en
code
null
code-starcoder2
76
[ { "api_name": "argparse.ArgumentParser", "line_number": 15, "usage_type": "call" }, { "api_name": "config.Config", "line_number": 22, "usage_type": "call" }, { "api_name": "config.dict_path", "line_number": 23, "usage_type": "attribute" }, { "api_name": "madelight...
317225731
import numpy as np import tensorflow as tf from config import cfg from utils import get_batch_data, quantize class ConvNet(object): def __init__(self, is_training=True): self.graph = tf.Graph() with self.graph.as_default(): if is_training: self.X, self.labels = get_bat...
null
convNet.py
convNet.py
py
5,121
python
en
code
null
code-starcoder2
76
[ { "api_name": "tensorflow.Graph", "line_number": 10, "usage_type": "call" }, { "api_name": "utils.get_batch_data", "line_number": 13, "usage_type": "call" }, { "api_name": "config.cfg.dataset", "line_number": 13, "usage_type": "attribute" }, { "api_name": "config....
264477741
from argparse import ArgumentParser import torch import os import common import constants import copy import network_utils as networkUtils import data_loader as dataLoader import numpy as np import datetime import functools import random ''' Launched by `master.py` Simplify a certain block of models and...
null
worker_fl.py
worker_fl.py
py
11,283
python
en
code
null
code-starcoder2
76
[ { "api_name": "network_utils.__dict__", "line_number": 22, "usage_type": "attribute" }, { "api_name": "network_utils.__dict__", "line_number": 24, "usage_type": "attribute" }, { "api_name": "data_loader.__dict__", "line_number": 27, "usage_type": "attribute" }, { ...
463467414
#!/bin/env python # -*- coding: utf-8 -*- """ send_recv """ import argparse import time import yaml import paddle import paddle.distributed as dist parser = argparse.ArgumentParser() parser.add_argument("--case_name", default="send_recv_legacy_sync") args = parser.parse_args() case_name = args.case_name f = open("c...
null
distributed/benchmarks_API/paddle/send_recv.py
send_recv.py
py
3,964
python
en
code
null
code-starcoder2
76
[ { "api_name": "argparse.ArgumentParser", "line_number": 14, "usage_type": "call" }, { "api_name": "yaml.load", "line_number": 20, "usage_type": "call" }, { "api_name": "yaml.FullLoader", "line_number": 20, "usage_type": "attribute" }, { "api_name": "paddle.distrib...
435369243
import sys from .c512sdcc import C512SDCC import argparse def main(): parser = argparse.ArgumentParser( prog='keil2sdcc', description='convert keil program to sdcc', epilog="project at: https://www.github.ywaby.keil2sdcc" ) parser.add_argument('-v', "--version", ...
null
keil2sdcc/__main__.py
__main__.py
py
682
python
en
code
null
code-starcoder2
76
[ { "api_name": "argparse.ArgumentParser", "line_number": 7, "usage_type": "call" }, { "api_name": "c512sdcc.C512SDCC", "line_number": 20, "usage_type": "call" } ]
161528529
import asyncio import signal import websockets from websockets.legacy.server import WebSocketServerProtocol from settings import CURRENT_CONFIG class Server: clients = set() async def handler(self, ws: WebSocketServerProtocol, uri: str) -> None: print('Starting') self.clients.add(ws) ...
null
server.py
server.py
py
1,008
python
en
code
null
code-starcoder2
76
[ { "api_name": "websockets.legacy.server.WebSocketServerProtocol", "line_number": 13, "usage_type": "name" }, { "api_name": "websockets.legacy.server.WebSocketServerProtocol", "line_number": 22, "usage_type": "name" }, { "api_name": "websockets.broadcast", "line_number": 24, ...
94384962
import datetime import os import json import uuid from PIL import Image from flask import Blueprint, render_template, request, redirect, url_for, flash, session, jsonify, current_app from models import User, db, Article, ArticleGroup, Comment, Favorite, Star from utils import login_check from werkzeug.utils import secu...
null
article/article.py
article.py
py
15,918
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.Blueprint", "line_number": 11, "usage_type": "call" }, { "api_name": "flask.request.args.get", "line_number": 23, "usage_type": "call" }, { "api_name": "flask.request.args", "line_number": 23, "usage_type": "attribute" }, { "api_name": "flask....
412553015
from flask import Flask, request from flask.templating import render_template from src.machine import Machine app = Flask(__name__) machine = Machine() coin_slot = { 'PENNY': {'weight': 2.5, 'diameter': .75, 'thickness': 1.52}, 'NICKEL': {'weight': 5.0, 'diameter': .835, 'thickness': 1.95}, 'DIME': {'weig...
null
src/app.py
app.py
py
1,317
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.Flask", "line_number": 5, "usage_type": "call" }, { "api_name": "src.machine.Machine", "line_number": 6, "usage_type": "call" }, { "api_name": "flask.request.form.get", "line_number": 23, "usage_type": "call" }, { "api_name": "flask.request.fo...
294679463
from flask import Flask from flask import request from flask import Response app = Flask(__name__) @app.route("/") def hello(): # name = request.form["name"] return "Hello World!" map = {} user_id = '1' @app.route('/users', methods = ['POST']) def user(): """modify/update the information for <user_id>"""...
null
quizz2/hello.py
hello.py
py
889
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.Flask", "line_number": 4, "usage_type": "call" }, { "api_name": "flask.request.form", "line_number": 18, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 18, "usage_type": "name" }, { "api_name": "flask.Response", ...
138863309
from requests import HTTPError from mycroft.api import DeviceApi from oauth2client import client class MycroftTokenCredentials(client.AccessTokenCredentials): def __init__(self, cred_id): self.cred_id = cred_id d = self.get_credentials() super().__init__(d['access_token'], d['user_agent']) ...
null
myft_token_cred.py
myft_token_cred.py
py
701
python
en
code
null
code-starcoder2
76
[ { "api_name": "oauth2client.client.AccessTokenCredentials", "line_number": 5, "usage_type": "attribute" }, { "api_name": "oauth2client.client", "line_number": 5, "usage_type": "name" }, { "api_name": "mycroft.api.DeviceApi", "line_number": 14, "usage_type": "call" }, ...
393231681
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. """ If your test has a subvolume or a sendstream, these helpers here make it easy to make assertions against its conten...
null
fs_image/btrfs_diff/tests/render_subvols.py
render_subvols.py
py
5,333
python
en
code
null
code-starcoder2
76
[ { "api_name": "copy.deepcopy", "line_number": 41, "usage_type": "call" }, { "api_name": "rendered_tree.emit_non_unique_traversal_ids", "line_number": 112, "usage_type": "call" }, { "api_name": "subvolume_utils.expected_subvol_add_traversal_ids", "line_number": 113, "usage...
404339447
from django.db import models from django.conf import settings class Connection(models.Model): user = models.ForeignKey('users.User', on_delete=models.CASCADE, related_name='connections',verbose_name="Кто связывается") target_user = models.ForeignKey('users.User', on_delete=models.CASCADE, related_name='target...
null
connections/models.py
models.py
py
2,944
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.db.models.Model", "line_number": 5, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 5, "usage_type": "name" }, { "api_name": "django.db.models.ForeignKey", "line_number": 6, "usage_type": "call" }, { "api_name": ...
567468833
import pysftp import glob import os # Module to handle the sending of files to the SFTP server def FileDBwrite(): try: # setup the connections etc logger.info('Starting function to move files to database') sftp = pysftp.Connection('sftp.momentum.co.za', username = 'fifthdim',password = 'z...
null
MSTI_File_Send.py
MSTI_File_Send.py
py
1,952
python
en
code
null
code-starcoder2
76
[ { "api_name": "pysftp.Connection", "line_number": 12, "usage_type": "call" }, { "api_name": "glob.glob", "line_number": 16, "usage_type": "call" }, { "api_name": "os.remove", "line_number": 23, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_n...
223085100
# el usuario abre el programa # ingresa los datos # da click en guardar # mensaje con los datos a guardar, # se guarda los datos # se abre la webcam, para tomar imagenes # se toma imagenes, se guarda en una carpeta # se muestra ok images # se cierra import tkinter as tk from tkinter import ttk from tkinter import mess...
null
register_gui_2.py
register_gui_2.py
py
3,789
python
en
code
null
code-starcoder2
76
[ { "api_name": "caso_de_uso_registrar_persona.Student", "line_number": 38, "usage_type": "call" }, { "api_name": "uuid.uuid4", "line_number": 44, "usage_type": "call" }, { "api_name": "uuid.uuid4", "line_number": 45, "usage_type": "call" }, { "api_name": "uuid.uuid...
234258144
__author__ = 'reubin' #practice with http requests as well as Beautiful Soup import requests from bs4 import BeautifulSoup request = requests.get("https://www.johnlewis.com/john-lewis-partners-penny-office-chair/p1193212") content = request.content soup = BeautifulSoup(content, "html.parser") element = soup.find("p",...
null
price_of_chair/src/app.py
app.py
py
433
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.get", "line_number": 7, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 9, "usage_type": "call" } ]
236477614
#!/usr/bin/env python3 # ____________developed by paco andres_15/04/2020___________________ from argparse import ArgumentParser,RawTextHelpFormatter from PYRobot.botlogging.coloramadefs import P_Log,C_Err import PYRobot.run.command_control as run desc=''' This utility allow control robot models usage with...
null
bin/robot.py
robot.py
py
1,663
python
en
code
null
code-starcoder2
76
[ { "api_name": "argparse.ArgumentParser", "line_number": 33, "usage_type": "call" }, { "api_name": "argparse.RawTextHelpFormatter", "line_number": 33, "usage_type": "name" }, { "api_name": "PYRobot.run.command_control.get_robot_init", "line_number": 44, "usage_type": "call...
257582719
# coding=utf-8 import matplotlib.pyplot as plt import numpy as np def get_data(): Q = [ [1, 1], [1.5, 1.5], [2, 2], [2.5, 2.5], [3, 3], [5, 3], [7, 3], ] R = [ [0.8, 1.8], [2, 3], [3, 4], [4, 4], [5, 4], ...
null
util/drawer_package/chapter2/Fig2-11.py
Fig2-11.py
py
1,892
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.array", "line_number": 25, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 29, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 29, "usage_type": "name" }, { "api_name": "matplotlib.pyplo...
535887585
#!/usr/bin/env python # -*- encoding: utf-8 -*- ''' @FileName: hist_equalization.py @Abstract: @Time: 2021/04/02 15:49:06 @Requirements: @Author: WangZy ntu.wangzy@gmail.com @Version: - ''' import cv2 import numpy as np import matplotlib.pyplot as plt # Load the image img = cv2.imread(r'C:\Users\wangz...
null
histogram_algorithms/hist_equalization.py
hist_equalization.py
py
900
python
en
code
null
code-starcoder2
76
[ { "api_name": "cv2.imread", "line_number": 16, "usage_type": "call" }, { "api_name": "cv2.IMREAD_GRAYSCALE", "line_number": 16, "usage_type": "attribute" }, { "api_name": "cv2.equalizeHist", "line_number": 18, "usage_type": "call" }, { "api_name": "cv2.imshow", ...
30103688
# coding: utf-8 import utils import os import tensorflow as tf import argparse import model os.chdir('.') def parse_args(): parser = argparse.ArgumentParser() parser.add_argument('-m', '--model_file', help='the path to the model file') parser.add_argument('-n', '--model_name', default='transfer', help='t...
null
Python/fast-style-model/convertToPB.py
convertToPB.py
py
4,481
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.chdir", "line_number": 8, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 12, "usage_type": "call" }, { "api_name": "tensorflow.Graph", "line_number": 19, "usage_type": "call" }, { "api_name": "tensorflow.Session",...
413364463
# Copyright (c) 2020, Fabio Muratore, Honda Research Institute Europe GmbH, and # Technical University of Darmstadt. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions of source ...
null
Pyrado/pyrado/algorithms/meta/epopt.py
epopt.py
py
5,758
python
en
code
null
code-starcoder2
76
[ { "api_name": "pyrado.algorithms.base.Algorithm", "line_number": 41, "usage_type": "name" }, { "api_name": "pyrado.environment_wrappers.base.EnvWrapper", "line_number": 55, "usage_type": "name" }, { "api_name": "pyrado.algorithms.base.Algorithm", "line_number": 55, "usage...
447041920
import subprocess import winreg import sys import os from modules import config from modules.utils import print_error from modules.interfaces import perforce def has_visual_studio_version(version_string): try: registry = winreg.ConnectRegistry(None, winreg.HKEY_LOCAL_MACHINE) vs_key = winreg.OpenK...
null
modules/requirements.py
requirements.py
py
3,056
python
en
code
null
code-starcoder2
76
[ { "api_name": "winreg.ConnectRegistry", "line_number": 12, "usage_type": "call" }, { "api_name": "winreg.HKEY_LOCAL_MACHINE", "line_number": 12, "usage_type": "attribute" }, { "api_name": "winreg.OpenKey", "line_number": 13, "usage_type": "call" }, { "api_name": "...
565285084
# =========================== # -*- coding:utf-8 -*- # Time :2021/4/11 18:31 # Author :A0025-江苏-小丹 # QQ:915155536 # File :demo1.py # =========================== from appium import webdriver info={ "platformName": "Android", "platformVersion": "7.1.2", "deviceName": "127.0.0.1:62001", #包名 "appPack...
null
sss/my_app/demo1.py
demo1.py
py
1,159
python
en
code
null
code-starcoder2
76
[ { "api_name": "appium.webdriver.Remote", "line_number": 22, "usage_type": "call" }, { "api_name": "appium.webdriver", "line_number": 22, "usage_type": "name" } ]
517596741
#!/usr/bin/env python3 import sys import os import multiprocessing as mp from time import sleep def copy(source, destination): os.system("cp "+source+" "+destination) if len(sys.argv) < 3: print("Usage: "+sys.argv[0]+" <source> <destination>") print("Copies files from one location to the other. Prints the...
null
cpStatus.py
cpStatus.py
py
1,084
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.system", "line_number": 8, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 10, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 11, "usage_type": "attribute" }, { "api_name": "sys.exit", "line_number": 13...
299081403
import os import setuptools def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() install_requires = [ 'Abjad >= 2.0', ] #packages=['abjad-midi'], setuptools.setup( name = "abjad-ipython-midi", version = "1.0", author = "Griffin Moe", author_email = "me@...
null
setup.py
setup.py
py
937
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.join", "line_number": 5, "usage_type": "call" }, { "api_name": "os.path", "line_number": 5, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 5, "usage_type": "call" }, { "api_name": "setuptools.setup", "line_n...
117972518
import pygame class PlayerRenderer(object): def __init__(self, spriteManager): self.spriteManager = spriteManager self.playerRect = pygame.Rect(0, 0, 0, 0) self.previousPlayerRect = pygame.Rect(0, 0, 0, 0) def render(self, screenWrapper, camera): playerSurfaceWrapper = self...
null
app/player/player_renderer.py
player_renderer.py
py
623
python
en
code
null
code-starcoder2
76
[ { "api_name": "pygame.Rect", "line_number": 9, "usage_type": "call" }, { "api_name": "pygame.Rect", "line_number": 10, "usage_type": "call" } ]
253393729
from django.shortcuts import render, redirect from django.http import HttpResponse, HttpResponseRedirect, JsonResponse from django.contrib import messages from django.core.files.storage import FileSystemStorage #To upload Profile Picture from django.urls import reverse from django.views.decorators.csrf import csrf_exem...
null
Student_Management_System/student_mangement_app/StaffViews.py
StaffViews.py
py
5,299
python
en
code
null
code-starcoder2
76
[ { "api_name": "student_management_app.models.Subjects.objects.filter", "line_number": 17, "usage_type": "call" }, { "api_name": "student_management_app.models.Subjects.objects", "line_number": 17, "usage_type": "attribute" }, { "api_name": "student_management_app.models.Subjects"...
306305066
import sys import os import sqlite3 sys.path.append(os.path.dirname(sys.argv[0])+'//lib') import serial #from bottle.ext import beaker from bottle import route, run ,template ,static_file,view,request, response ,redirect from os.path import dirname, realpath, sep, pardir import sys import bottle from bottle_l...
null
auth.py
auth.py
py
6,286
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.path.append", "line_number": 4, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 4, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 4, "usage_type": "call" }, { "api_name": "os.path", "line_number...
339653456
import random import asyncio from aiohttp import ClientSession import time #Admin panel finder tool created by TheFuzzyRabbit and Lulzsecurity Universal crew print(""" \33[1;33m✯ \33[1;36mAdmin Login Finder Tool\33[1;33m ✯ \33[1;33m ✧ ☆ ✧ ☆ ✧ ☆ ✧ ✧ ✧☆ ✧ ☆ ✧ ✧ ☆ ✧ ☆ ☆ ✧ ☆ ✧ ☆ ✧ ☆ ✧ ...
null
astradm.py
astradm.py
py
2,999
python
en
code
null
code-starcoder2
76
[ { "api_name": "time.time", "line_number": 26, "usage_type": "call" }, { "api_name": "aiohttp.ClientSession", "line_number": 51, "usage_type": "call" }, { "api_name": "asyncio.ensure_future", "line_number": 53, "usage_type": "call" }, { "api_name": "asyncio.gather"...
351816255
from django.db import models from django.contrib.postgres.fields import ArrayField from django.contrib.auth import get_user_model from apps.departments.models import Position from django.db.models import BooleanField from apps.requests.models import Request User = get_user_model() HH_TIER_TYPE = (('PR', 'premium'),...
null
python/apps/vacancies/models.py
models.py
py
3,056
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.contrib.auth.get_user_model", "line_number": 10, "usage_type": "call" }, { "api_name": "django.db.models.Model", "line_number": 34, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 34, "usage_type": "name" }, { "a...
472327183
import os import sys import random import math import numpy as np import pandas as pd import matplotlib.pyplot as plt from keras import optimizers, callbacks, initializers from keras.models import Sequential, Model, load_model from keras.layers import Input, Activation, Dropout, Flatten, Dense, LSTM # 隠れ層の数 N_HIDDEN...
null
3sin5_5cos3.py
3sin5_5cos3.py
py
2,987
python
en
code
null
code-starcoder2
76
[ { "api_name": "keras.layers.Input", "line_number": 39, "usage_type": "call" }, { "api_name": "keras.layers.LSTM", "line_number": 40, "usage_type": "call" }, { "api_name": "keras.initializers.Constant", "line_number": 40, "usage_type": "call" }, { "api_name": "kera...
653693669
# -*- coding: utf-8 -*- # Copyright (c) 2011, National Film Board of Canada - Office National du Film du Canada from django.test import TestCase from django.core.exceptions import ObjectDoesNotExist from django.contrib.auth.models import User from django.test.client import Client from django.conf import settings from...
null
tokit/tests/tests_middleware.py
tests_middleware.py
py
3,375
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.test.TestCase", "line_number": 12, "usage_type": "name" }, { "api_name": "django.test.client.Client", "line_number": 15, "usage_type": "call" }, { "api_name": "django.contrib.auth.models.User", "line_number": 16, "usage_type": "call" }, { "ap...
589088240
""" Created on 4 de jun de 2016 @author: dcblera """ import enum from flask_restful import fields from sqlalchemy import Column, String, TIMESTAMP from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.sql import functions Base = declarative_base() class Solicitacao(Base): """ Classe para...
null
FlaskWebServer/src/cloftstill/restfulapi/orm/entity/solicitacao.py
solicitacao.py
py
4,500
python
en
code
null
code-starcoder2
76
[ { "api_name": "sqlalchemy.ext.declarative.declarative_base", "line_number": 15, "usage_type": "call" }, { "api_name": "flask_restful.fields.String", "line_number": 45, "usage_type": "attribute" }, { "api_name": "flask_restful.fields", "line_number": 45, "usage_type": "nam...
466229907
import os import sys try: from urllib.request import urlretrieve except ImportError: from urllib import urlretrieve try: from StringIO import StringIO except ImportError: from io import StringIO from requests import HTTPError import tempfile import time from _utils import * import tmdb_api as tmdb from...
null
tmdb_mp4.py
tmdb_mp4.py
py
16,256
python
en
code
null
code-starcoder2
76
[ { "api_name": "readSettings.settingsProvider", "line_number": 33, "usage_type": "call" }, { "api_name": "tmdb_api.API_KEY", "line_number": 63, "usage_type": "attribute" }, { "api_name": "extensions.tmdb_api_key", "line_number": 63, "usage_type": "name" }, { "api_n...
550712861
#!/usr/bin/env python3 # # Copyright (C) 2018-2021 Intel Corporation # # SPDX-License-Identifier: MIT # """Usage: ./scripts/lint/set_copyright.py <files>""" import re import sys import os import datetime import stat import argparse def is_banned(path): """Check if path is banned.""" banned_paths = [ ...
null
scripts/lint/set_copyright.py
set_copyright.py
py
7,151
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.normpath", "line_number": 34, "usage_type": "call" }, { "api_name": "os.path", "line_number": 34, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 39, "usage_type": "call" }, { "api_name": "os.path", "line_num...
500575171
from django.urls import path from django.conf import settings from django.conf.urls.static import static from . import views urlpatterns = [ # path('', TweetListView.as_view(), name='home'), path('', views.home, name='home'), path('create/', views.PostCreateView.as_view(), name='create'), path('post/<...
null
main/urls.py
urls.py
py
1,312
python
en
code
null
code-starcoder2
76
[ { "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", "line_number": 11, "usage_type": "call" }, { "api_name": "django.urls.path", ...
613254895
from PyQt4 import QtGui, QtCore from Lib.settings import cellSizeInPixel, cellOutInColor, lifeCellOutInColor, sceneSizeInCells, cellHiglightedOutColor import enum class State(enum.Enum): LIVED = 'LIVED' DIED = 'DIED' class SceneCellSingalSlotSupportable(QtGui.QGraphicsObject): dropped = QtCore.pyqtSignal(...
null
GameOfLife/Lib/SceneCell.py
SceneCell.py
py
4,345
python
en
code
null
code-starcoder2
76
[ { "api_name": "enum.Enum", "line_number": 5, "usage_type": "attribute" }, { "api_name": "PyQt4.QtGui.QGraphicsObject", "line_number": 9, "usage_type": "attribute" }, { "api_name": "PyQt4.QtGui", "line_number": 9, "usage_type": "name" }, { "api_name": "PyQt4.QtCore...
409176438
from django.contrib import messages from django.http import HttpResponseNotAllowed, HttpResponseRedirect from django.shortcuts import render, get_object_or_404, redirect from django.urls import reverse from django.views.generic import ListView from .forms import CreateCategoryForm, TaskForm, FileForm from .models impo...
null
assistant/todo/views.py
views.py
py
5,959
python
en
code
null
code-starcoder2
76
[ { "api_name": "models.Category.objects.filter", "line_number": 19, "usage_type": "call" }, { "api_name": "models.Category.objects", "line_number": 19, "usage_type": "attribute" }, { "api_name": "models.Category", "line_number": 19, "usage_type": "name" }, { "api_n...
605877885
import cv2 import numpy as np from matplotlib import pyplot as plt #roi is the object or region of object we need to find roi = cv2.imread('SkinSamples.JPG') hsv = cv2.cvtColor(roi,cv2.COLOR_BGR2HSV) #target is the image we search in target = cv2.imread('People2.jpg') hsvt = cv2.cvtColor(target,cv2.COLOR_BGR2HSV) A =...
null
codes_images/skinsample.py
skinsample.py
py
927
python
en
code
null
code-starcoder2
76
[ { "api_name": "cv2.imread", "line_number": 6, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 7, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2HSV", "line_number": 7, "usage_type": "attribute" }, { "api_name": "cv2.imread", "line_nu...
303550085
#!/usr/bin/env python3 import unittest from emails import find_email class EmailsTest(unittest.TestCase): def test_basic(self): testcase = [None, "Bree", "Campbell"] expected = "breee@abc.edu" self.assertEqual(find_email(testcase), expected) def test_one_name(self): testcase = [None, "John"] ...
null
devops/scripting/emails_test.py
emails_test.py
py
1,043
python
en
code
null
code-starcoder2
76
[ { "api_name": "unittest.TestCase", "line_number": 7, "usage_type": "attribute" }, { "api_name": "emails.find_email", "line_number": 11, "usage_type": "call" }, { "api_name": "emails.find_email", "line_number": 16, "usage_type": "call" }, { "api_name": "emails.find...
302620677
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Nov 29 12:13:52 2018 Code to look at ensemble variability of objects @author: ppxee """ import time start = time.time() #print(start) ### Import required libraries ### import matplotlib.pyplot as plt #for plotting from astropy.io import fits #for han...
null
z_ensemble_properties_allapers.py
z_ensemble_properties_allapers.py
py
7,460
python
en
code
null
code-starcoder2
76
[ { "api_name": "time.time", "line_number": 12, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.close", "line_number": 25, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 25, "usage_type": "name" }, { "api_name": "astropy.cosmology...
311475161
import re import json from vital.cache import memoize from vital.tools import strings as string_tools __all__ = ( 'to_js_keys', 'transform_keys', 'to_js_shape', 'get_class_attrs', 'to_js_key', 'to_python_key' ) js_keys_re = re.compile(r"""([^\\])"([A-Za-z]+[A-Za-z0-9_]*?)":""") js_records_re...
null
radar_server_legacy/utils.py
utils.py
py
1,540
python
en
code
null
code-starcoder2
76
[ { "api_name": "re.compile", "line_number": 17, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 18, "usage_type": "call" }, { "api_name": "vital.tools.strings.underscore_to_camel", "line_number": 27, "usage_type": "call" }, { "api_name": "vital.t...
117094867
import time from itertools import product from util.primes import * def all_locations(num_spots): # For example: for num_spots = 3, we have ###. So we can have *##, **#, *#*, #*#, #**, ##* # Return set of tuples of len = num_spots with T/F values locs = [] for i in product([True, False], re...
null
PE51.py
PE51.py
py
1,511
python
en
code
null
code-starcoder2
76
[ { "api_name": "itertools.product", "line_number": 11, "usage_type": "call" }, { "api_name": "time.time", "line_number": 51, "usage_type": "call" }, { "api_name": "time.time", "line_number": 53, "usage_type": "call" } ]
565925158
import numpy as np import scipy as sp import numpy.linalg as LA import operator from cachetools import LRUCache, cachedmethod from numpy_sugar.linalg import sum2diag, solve, trace2 from anna_exp.prepare_model import mapPhi from scipy import stats class LML(object): """ defines a class of Log Marginal Likelihoo...
null
varqtl/LML_class.py
LML_class.py
py
11,666
python
en
code
null
code-starcoder2
76
[ { "api_name": "cachetools.LRUCache", "line_number": 25, "usage_type": "call" }, { "api_name": "cachetools.LRUCache", "line_number": 26, "usage_type": "call" }, { "api_name": "cachetools.LRUCache", "line_number": 27, "usage_type": "call" }, { "api_name": "cachetool...
527740567
#!/usr/bin/env python """ Setup.py for xraylarch """ from __future__ import print_function from setuptools import setup import time import os import sys import site import platform from glob import glob DEBUG = False cmdline_args = sys.argv[1:] INSTALL = len(cmdline_args)> 0 and (cmdline_args[0] == 'install') _ver...
null
setup.py
setup.py
py
9,709
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.argv", "line_number": 16, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 21, "usage_type": "call" }, { "api_name": "os.path", "line_number": 21, "usage_type": "attribute" }, { "api_name": "matplotlib.use", "line_nu...
617710983
import tensorflow as tf import numpy as np import matplotlib.pyplot as plt import h5py as h5py LOGDIR = "/home/vishnu/Dropbox/intel_works/nn_files/tf_tests/modular_py/log_com_gesture_cnn" ######################################################################################## def load_dataset(): train_dataset ...
null
modular_py/others/comete1_gesture_cnn1.py
comete1_gesture_cnn1.py
py
12,047
python
en
code
null
code-starcoder2
76
[ { "api_name": "h5py.File", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 15, "usage_type": "call" }, { "api_name": "h5py.File", "line_number": 17, ...
652060555
from pyspark import SparkConf, SparkContext from operator import add import sys #select sum(salary) from employees where salary > 1000 group by deptname APP_NAME = "sql_like" def main(sc, filename): textRDD = sc.textFile(filename) filtered_rdd = textRDD.filter(lambda l: l['salary'] > 1000).map(lambda : (l['departme...
null
spark/sandbox/sql_like.py
sql_like.py
py
587
python
en
code
null
code-starcoder2
76
[ { "api_name": "operator.add", "line_number": 11, "usage_type": "argument" }, { "api_name": "pyspark.SparkConf", "line_number": 14, "usage_type": "call" }, { "api_name": "pyspark.SparkContext", "line_number": 15, "usage_type": "call" } ]
369111446
############################################################################## # # Copyright (c) 2009 Zope Corporation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SO...
null
Sandbox/shane/republish/zope.pipeline/src/zope/pipeline/autotemp.py
autotemp.py
py
2,205
python
en
code
null
code-starcoder2
76
[ { "api_name": "cStringIO.StringIO", "line_number": 24, "usage_type": "call" }, { "api_name": "tempfile.TemporaryFile", "line_number": 43, "usage_type": "call" } ]
624612092
import os os.environ["CUDA_VISIBLE_DEVICES"] = "0" import shutil import argparse import numpy as np import torch from core.models.model_factory import Model from core.utils import preprocess import core.trainer as trainer from data_provider.CIKM.data_iterator import * import math # ------------------------------------...
null
cikm_sst_predrnn_run.py
cikm_sst_predrnn_run.py
py
9,659
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.environ", "line_number": 2, "usage_type": "attribute" }, { "api_name": "argparse.ArgumentParser", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 64, "usage_type": "call" }, { "api_name": "numpy.zeros", ...
613880783
# -*- coding: utf-8 -*- from plone.formwidget.recaptcha.interfaces import IReCaptchaSettings from plone.formwidget.recaptcha.norecaptcha import displayhtml from plone.formwidget.recaptcha.norecaptcha import submit from plone.registry.interfaces import IRegistry from Products.Five import BrowserView from zope import sch...
null
src/plone/formwidget/recaptcha/view.py
view.py
py
2,697
python
en
code
null
code-starcoder2
76
[ { "api_name": "zope.interface.Interface", "line_number": 17, "usage_type": "name" }, { "api_name": "zope.schema.TextLine", "line_number": 18, "usage_type": "call" }, { "api_name": "zope.schema", "line_number": 18, "usage_type": "name" }, { "api_name": "zope.schema...
549105558
import reedsolo import numpy as np import pprint def dec_to_bin(lst): bin_matrix = [] # kazda wartosc ma nowy wiersz w macierzy for i in lst: bin_matrix.append(list(bin(i)[2:])) bin_matrix_int = [list(map(int, x)) for x in bin_matrix] return bin_matrix_int def bin_to_dec(bin_matrix): ...
null
reed_solomon.py
reed_solomon.py
py
808
python
en
code
null
code-starcoder2
76
[ { "api_name": "reedsolo.RSCodec", "line_number": 28, "usage_type": "call" }, { "api_name": "pprint.pprint", "line_number": 33, "usage_type": "call" }, { "api_name": "pprint.pprint", "line_number": 34, "usage_type": "call" } ]
470819981
# -*- coding: utf-8 -*- import logging import click from src.models.train_model_azure import train_model @click.command() @click.argument('data_filepath', type=click.Path(), default='data') @click.argument('trained_model_filepath', type=click.Path(), default='models/trained_model.pth') @click.argume...
null
src/models/train_model_command_line_azure.py
train_model_command_line_azure.py
py
1,452
python
en
code
null
code-starcoder2
76
[ { "api_name": "src.models.train_model_azure.train_model", "line_number": 27, "usage_type": "call" }, { "api_name": "click.command", "line_number": 9, "usage_type": "call" }, { "api_name": "click.argument", "line_number": 10, "usage_type": "call" }, { "api_name": "...
438052015
import os import sys import glob import numpy import numpy as np from six.moves import cPickle as pickle from scipy import linalg from skimage.color import rgb2luv from skimage import img_as_float dirname = os.path.dirname(os.path.realpath(__file__)) def unpickle(file): fp = open(file, 'rb') if sys.version_in...
null
datasets/cifar100gcn.py
cifar100gcn.py
py
5,584
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.dirname", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path", "line_number": 11, "usage_type": "attribute" }, { "api_name": "os.path.realpath", "line_number": 11, "usage_type": "call" }, { "api_name": "sys.version_info", ...
255918818
import pygame from sprites import * from learner import * from helpers import * import os def main() -> None: """This is the main loop responsible for rendering a pygame window. This loop also carries out all major game logic. Many learner functions are called in this loop. See if you can see some of the o...
null
GUI.py
GUI.py
py
4,398
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.dirname", "line_number": 26, "usage_type": "call" }, { "api_name": "os.path", "line_number": 26, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 34, "usage_type": "call" }, { "api_name": "os.path", "line_number"...
70635154
import jsonpatch import re from cedar.utils import general_utils as utils class AddBiboStatusPatch(object): def __init__(self): self.description = "Add bibo:status in templates and elements" self.from_version = "1.1.0" self.to_version = "1.4.0" def is_applied(self, error_message, doc...
null
scripts/python/cedar/patch/collection/AddBiboStatusPatch.py
AddBiboStatusPatch.py
py
1,109
python
en
code
null
code-starcoder2
76
[ { "api_name": "cedar.utils.general_utils.is_compatible", "line_number": 14, "usage_type": "call" }, { "api_name": "cedar.utils.general_utils", "line_number": 14, "usage_type": "name" }, { "api_name": "re.compile", "line_number": 16, "usage_type": "call" }, { "api_...
634509185
from selenium import webdriver from selenium.webdriver.remote.webelement import WebElement from selenium.webdriver import ActionChains import unittest class TestAddition(unittest.TestCase): driver = None def setUp(self): global driver driver = webdriver.PhantomJS(executable_path='<Path to Phant...
null
Python Example/python-scraping-master/chapter13/6-combinedTest.py
6-combinedTest.py
py
896
python
en
code
null
code-starcoder2
76
[ { "api_name": "unittest.TestCase", "line_number": 6, "usage_type": "attribute" }, { "api_name": "selenium.webdriver.PhantomJS", "line_number": 10, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 10, "usage_type": "name" }, { "api_name": ...
591891045
from numpy import * import numpy as np import matplotlib.pyplot as plt from qutip import * from scipy import integrate from scipy.integrate import quad,dblquad,nquad import math import matplotlib as mpl from matplotlib import cm import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D from mat...
null
experiment_study_log/two-qubit-gate/CZ_2D.py
CZ_2D.py
py
3,967
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.pi", "line_number": 28, "usage_type": "attribute" }, { "api_name": "numpy.pi", "line_number": 29, "usage_type": "attribute" }, { "api_name": "numpy.pi", "line_number": 38, "usage_type": "attribute" }, { "api_name": "numpy.pi", "line_number...
182656223
# -*- coding: utf-8 -*- from datetime import datetime, timedelta from uuid import uuid1 as new_uuid from seantis.reservation.tests import IntegrationTestCase from seantis.reservation.error import ( OverlappingAllocationError, AffectedReservationError, AlreadyReservedError, ReservationTooLong, Inval...
null
seantis/reservation/tests/test_db.py
test_db.py
py
65,818
python
en
code
null
code-starcoder2
76
[ { "api_name": "seantis.reservation.db.Scheduler", "line_number": 29, "usage_type": "attribute" }, { "api_name": "seantis.reservation.db", "line_number": 29, "usage_type": "name" }, { "api_name": "seantis.reservation.tests.IntegrationTestCase", "line_number": 34, "usage_ty...
403337054
# pandas 数据源下载地址:https://video.mugglecode.com/data_pd.zip,下载压缩包后解压即可(数据源与上节课相同) # -*- coding: utf-8 -*- """ 明确任务: 按年度、地区分析全球幸福报告 """ import os import pandas as pd import matplotlib.pyplot as plt # 年度全球幸福报告数据文件 report_datafile_path = './data_pd/happiness_report.csv' # 结果保存路径 output_path = './output' if n...
null
实用主义学习文档/05数据分析/11. 按年度和地区分析全球幸福报告.py
11. 按年度和地区分析全球幸福报告.py
py
2,333
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.exists", "line_number": 18, "usage_type": "call" }, { "api_name": "os.path", "line_number": 18, "usage_type": "attribute" }, { "api_name": "os.makedirs", "line_number": 19, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_n...
207823708
from pymodbus.client.sync import ModbusTcpClient as ModbusClient def main(): print("Connecting...") client = ModbusClient('111.220.27.216',5020) client. connect print("\r Connected!") print("DDOSing modbus...") try: while True: client.write_register(0,0,unit=1) ...
null
prototype1/Red Team Demonstrations & Tutorials/modbus_ddos.py
modbus_ddos.py
py
430
python
en
code
null
code-starcoder2
76
[ { "api_name": "pymodbus.client.sync.ModbusTcpClient", "line_number": 6, "usage_type": "call" } ]
426809386
""" Options For X!Tandem Scripts """ import json import os.path class Tandem_Options: def __init__(self): config_path = os.path.join(os.path.dirname(__file__), "config.tandem-options") #Read options files self.options = {} try: with open(config_path, 'r') as config_file...
null
tandem_options.py
tandem_options.py
py
409
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.path.join", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "os.path", "line_number": 10, "usage_type": "name" }, { "api_name": "os.path.path.dirname", ...
49884940
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('authorities', '0006_auto_20160122_2313'), ] operations = [ migrations.CreateModel( name='AuthorityServices', ...
null
democracy_club/apps/authorities/migrations/0007_authorityservices.py
0007_authorityservices.py
py
613
python
en
code
null
code-starcoder2
76
[ { "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" }, ...
409224813
import json import numpy as np import matplotlib.pyplot as plt def plot_losses(netNum, filename='history_0.json', model_dir='/home/sexy/source/deep-visual-odometry/models/'): #Load all data from json with open(model_dir+"alexNet_"+str(netNum)+"/"+filename) as data_file: data = json.load(data_file) ...
null
python/tools/plot_losses.py
plot_losses.py
py
703
python
en
code
null
code-starcoder2
76
[ { "api_name": "json.load", "line_number": 8, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 15, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 15, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.p...
347485283
from django.contrib import admin from project_ticket.models import Project, Ticket, Comment, ActionReport # Register your models here. class TicketInline(admin.TabularInline): model = Ticket extra = 0 class TicketComment(admin.ModelAdmin): fieldsets = [ ('None', {'fields':['recent_user']}), ('Ticket', {'f...
null
project_ticket/admin.py
admin.py
py
1,188
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.contrib.admin.TabularInline", "line_number": 6, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 6, "usage_type": "name" }, { "api_name": "project_ticket.models.Ticket", "line_number": 7, "usage_type": "name" }, {...
214359293
import io import time import threading import picamera from PIL import Image import numpy as np import cv2 import RPi.GPIO as GPIO MARGIN_LEFT = 260 MARGIN_RIGHT = 380 '''---------------GPIO SECTION ----------''' GPIO.setmode(GPIO.BCM) TRIGR = 23 ECHOR = 24 TRIGL = 25 ECHOL = 8 ENA = 26 ENB = 11 IN1 = 19 IN2 = 13 I...
null
autonomous/piCamClient3.py
piCamClient3.py
py
7,826
python
en
code
null
code-starcoder2
76
[ { "api_name": "RPi.GPIO.setmode", "line_number": 14, "usage_type": "call" }, { "api_name": "RPi.GPIO", "line_number": 14, "usage_type": "name" }, { "api_name": "RPi.GPIO.BCM", "line_number": 14, "usage_type": "attribute" }, { "api_name": "RPi.GPIO.setup", "lin...
172286805
""" This module serves as the web interface for Tangerine. The webpage is served at the default port 8080. Access control is provided through GitHub oauth. """ import os from urllib.request import Request, urlopen import json import cherrypy from cherrypy.lib.static import serve_file from hashlib import sha256 from...
null
web_interface.py
web_interface.py
py
26,118
python
en
code
null
code-starcoder2
76
[ { "api_name": "mako.lookup.TemplateLookup", "line_number": 18, "usage_type": "call" }, { "api_name": "settings.settings", "line_number": 27, "usage_type": "name" }, { "api_name": "cherrypy.session", "line_number": 29, "usage_type": "attribute" }, { "api_name": "ch...
450400220
from django.shortcuts import render, get_object_or_404, redirect from .forms import CaptchaForm from .models import Topic, Group def index(request): topic_list = Topic.objects.order_by('title') context = {'topic_list': topic_list} return render(request, 'Chemicals/index.html', context) def detail(reque...
null
Chemicals/views.py
views.py
py
749
python
en
code
null
code-starcoder2
76
[ { "api_name": "models.Topic.objects.order_by", "line_number": 8, "usage_type": "call" }, { "api_name": "models.Topic.objects", "line_number": 8, "usage_type": "attribute" }, { "api_name": "models.Topic", "line_number": 8, "usage_type": "name" }, { "api_name": "dja...
29940706
import json from classes import * def setupCacheHeirarchy(fileName = "config.json"): with open("fileName", 'r') as configFile: cacheConfig = json.load(configFile) configFile.close() cacheHeirarchy = [] for cache in cacheConfig: tempCache = Cache(cache.level, cache.size, cache.sets, cache.associativity) cach...
null
run.py
run.py
py
920
python
en
code
null
code-starcoder2
76
[ { "api_name": "json.load", "line_number": 6, "usage_type": "call" } ]
62648472
# -*- coding:utf-8 -*- ''' author: "caihua" date: 2019/5/11 Email: hanscalcai@163.com ''' """ Write tfrecords tools """ import argparse import os import tensorflow as tf import cv2 import time import tqdm import json import glog as log import sys sys.path.append('../') import os.path as ops from config import global...
null
tools/write_tfrecords_cn.py
write_tfrecords_cn.py
py
8,161
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.path.append", "line_number": 21, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 21, "usage_type": "attribute" }, { "api_name": "config.global_config.cfg", "line_number": 25, "usage_type": "attribute" }, { "api_name": "config.gl...
268196400
import os import sys import traceback from getpass import getpass import click import urllib3 from prettytable import PrettyTable path = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) sys.path.insert(0, path) from jnujwxt import log from jnujwxt.config import config from jnujwxt.engine import Jwxt from ...
null
jnujwxt/cli.py
cli.py
py
8,561
python
en
code
null
code-starcoder2
76
[ { "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...