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
516642055
r"""Test `lmp.tokenizer.CharListTokenizer.detokenize`. Usage: python -m unittest \ test/lmp/tokenizer/_char_list_tokenizer/test_detokenize.py """ # built-in modules from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_...
null
test/lmp/tokenizer/_char_list_tokenizer/test_detokenize.py
test_detokenize.py
py
3,951
python
en
code
null
code-starcoder2
83
[ { "api_name": "unittest.TestCase", "line_number": 27, "usage_type": "attribute" }, { "api_name": "lmp.tokenizer.CharListTokenizer", "line_number": 32, "usage_type": "call" }, { "api_name": "lmp.tokenizer.CharListTokenizer", "line_number": 33, "usage_type": "call" }, {...
307704489
import string from hashlib import sha1 from re import compile from json import dump from csv import reader from unicodedata import normalize from model import restaurant_types, remove_from_place from utils import calculate_distance class ItemParser(): def __init__(self, filename, item_types): self.f...
null
xtras/poc.py
poc.py
py
4,565
python
en
code
null
code-starcoder2
83
[ { "api_name": "csv.reader", "line_number": 23, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 50, "usage_type": "call" }, { "api_name": "model.remove_from_place", "line_number": 50, "usage_type": "argument" }, { "api_name": "re.compile", "l...
301590972
""" This module contains the implementations of all three SniffNet models """ from keras.layers import Conv2D from keras.models import Sequential from keras.layers import AveragePooling2D from keras.layers import MaxPooling2D from keras.layers import BatchNormalization from keras.layers import Flatten, Dropout, Add...
null
models.py
models.py
py
4,694
python
en
code
null
code-starcoder2
83
[ { "api_name": "keras.models.Sequential", "line_number": 23, "usage_type": "call" }, { "api_name": "keras.layers.Conv2D", "line_number": 24, "usage_type": "call" }, { "api_name": "keras.layers.BatchNormalization", "line_number": 26, "usage_type": "call" }, { "api_n...
143130756
# -*- coding: utf-8 -*- """ Created on Sun Apr 5 18:09:10 2020 イベントランキング """ from bs4 import BeautifulSoup import AbsHtmlPage import ProfilePage from datetime import datetime import csv import pandas as pd import json class EventPage(AbsHtmlPage.AbsHtmlPage): eventPageName = 'event' pageDatetime = 'a' c...
null
getsrdata/EventPage.py
EventPage.py
py
7,432
python
en
code
null
code-starcoder2
83
[ { "api_name": "AbsHtmlPage.AbsHtmlPage", "line_number": 16, "usage_type": "attribute" }, { "api_name": "pandas.DataFrame", "line_number": 19, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 36, "usage_type": "call" }, { "api_name": "d...
173670654
# Class for serial port open/read/write import re, logging, sys, time, os, signal, platform import pexpect from framework.globalconfig.gc import * from framework.connection import ConnectionInterface DEFAULT_LOGIN_PATTERN = ".*login:.*" DEFAULT_PWD_PATTERN = "Password:" class SerialPort(ConnectionInterface.Connectio...
null
framework/serial/serialD.py
serialD.py
py
6,823
python
en
code
null
code-starcoder2
83
[ { "api_name": "framework.connection.ConnectionInterface.ConnectionInterface", "line_number": 11, "usage_type": "attribute" }, { "api_name": "framework.connection.ConnectionInterface", "line_number": 11, "usage_type": "name" }, { "api_name": "pexpect.spawn", "line_number": 27,...
361742187
import mistune import latex2mathml.converter import os def py_states(content): states = '```{}```' state = 0 new_content = '' word = '' for c in content: if states[state] == c: if state == 7: new_content = new_content + '</pre></div>' ...
null
MDgen.py
MDgen.py
py
5,318
python
en
code
null
code-starcoder2
83
[ { "api_name": "latex2mathml.converter.converter.convert", "line_number": 43, "usage_type": "call" }, { "api_name": "latex2mathml.converter.converter", "line_number": 43, "usage_type": "attribute" }, { "api_name": "latex2mathml.converter", "line_number": 43, "usage_type": ...
653333658
import numpy as np from scipy import linalg as lin from matplotlib import pyplot as plt from matplotlib import animation import mpl_toolkits.mplot3d.axes3d as p3 def project_3d(arr): return [*arr.real[view_dims], arr.imag[0]] view_dims = [0, 1] matrix = np.matrix([ [0, 1, 0], [0, 0, 1], [-1, 0, 0]...
null
matvis2ni.py
matvis2ni.py
py
1,562
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.matrix", "line_number": 15, "usage_type": "call" }, { "api_name": "scipy.linalg.det", "line_number": 21, "usage_type": "call" }, { "api_name": "scipy.linalg", "line_number": 21, "usage_type": "name" }, { "api_name": "numpy.pi", "line_numbe...
306880342
# pylint: disable=R0913,R0903 """ dayong.configs ~~~~~~~~~~~~~~ Initial setup and configuration logic. """ import json import os from pydantic import BaseModel from dayong.settings import CONFIG_FILE class DayongConfig(BaseModel): """Data model for Dayong's configuration.""" bot_prefix: str bot_token:...
null
dayong/configs.py
configs.py
py
1,960
python
en
code
null
code-starcoder2
83
[ { "api_name": "pydantic.BaseModel", "line_number": 16, "usage_type": "name" }, { "api_name": "dayong.settings.CONFIG_FILE", "line_number": 57, "usage_type": "argument" }, { "api_name": "json.load", "line_number": 58, "usage_type": "call" }, { "api_name": "os.envir...
58083649
import pygame from plane_sprites import* class PlaneGame(object): def __init__(self): print('游戏初始化') #1.创建游戏的窗口 self.screen=pygame.display.set_mode(SCREEN_RECT.size) #2.创建游戏的始终 self.clock=pygame.time.Clock() #3.调用私有方法,精灵和精灵组的创建 self.__create_sprites() ...
null
飞机大战/plane_main.py
plane_main.py
py
2,239
python
en
code
null
code-starcoder2
83
[ { "api_name": "pygame.display.set_mode", "line_number": 8, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 8, "usage_type": "attribute" }, { "api_name": "pygame.time.Clock", "line_number": 10, "usage_type": "call" }, { "api_name": "pygame.ti...
514215494
import json import unittest import boto3 from pygglz.dynamodb import DynamodbRepository from pygglz.feature_state import FeatureState class LocalDynamodb(object): def __init__(self): self.endpoint_url = "http://localhost:4569" self.resource = boto3.resource('dynamodb', endpoint_url=self.endpoint...
null
integration_tests/dynamodb_repository_integration_test.py
dynamodb_repository_integration_test.py
py
2,651
python
en
code
null
code-starcoder2
83
[ { "api_name": "boto3.resource", "line_number": 13, "usage_type": "call" }, { "api_name": "boto3.client", "line_number": 14, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 42, "usage_type": "call" }, { "api_name": "unittest.TestCase", "line_...
552043694
#-*- coding: utf-8 -*- ############################################################################## # # NUMA Extreme Systems (www.numaes.com) # Copyright (C) 2013 # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # ...
null
numa_cheque_printing/payable_cheque.py
payable_cheque.py
py
7,524
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.getLogger", "line_number": 29, "usage_type": "call" }, { "api_name": "openerp.models.Model", "line_number": 31, "usage_type": "attribute" }, { "api_name": "openerp.models", "line_number": 31, "usage_type": "name" }, { "api_name": "openerp.fi...
32107906
import json import logging from string import Template from flask_restful import Resource, request from flask import jsonify from accessors.s3_accessor import S3Accessor from resource_helpers.abort_logger import AbortLogger MESSAGE_500 = Template("File failed to download: $error") class VariantListReturn(Resource):...
null
resources/variant_list_return.py
variant_list_return.py
py
1,343
python
en
code
null
code-starcoder2
83
[ { "api_name": "string.Template", "line_number": 10, "usage_type": "call" }, { "api_name": "flask_restful.Resource", "line_number": 13, "usage_type": "name" }, { "api_name": "logging.getLogger", "line_number": 15, "usage_type": "call" }, { "api_name": "flask_restfu...
631254577
""" Irenaeus Chan 11/27/2015 Ramachandran Plot Generator """ import sys from itertools import tee, islice, chain, izip import vector def previousAndNext(some_iterable): #http://stackoverflow.com/questions/1011938/python-previous-and-next-values-inside-a-loop prevs, items, nexts = tee(some_iterable, 3) prevs = chai...
null
Library/phipsi.py
phipsi.py
py
3,531
python
en
code
null
code-starcoder2
83
[ { "api_name": "itertools.tee", "line_number": 14, "usage_type": "call" }, { "api_name": "itertools.chain", "line_number": 15, "usage_type": "call" }, { "api_name": "itertools.chain", "line_number": 16, "usage_type": "call" }, { "api_name": "itertools.islice", ...
179775440
# -*- coding: utf-8 -*- """ Created on Tue Oct 6 13:38:57 2020 @author: nkraj """ import numpy as np import pandas as pd import datetime import matplotlib.pyplot as plt # model libraries from statsmodels.tsa.arima_model import ARIMA from statsmodels.tsa.statespace.sarimax import SARIMAX from pandas.plotting import a...
null
model_building.py
model_building.py
py
2,976
python
en
code
null
code-starcoder2
83
[ { "api_name": "data_preprocessing.sales.groupby", "line_number": 24, "usage_type": "call" }, { "api_name": "data_preprocessing.sales", "line_number": 24, "usage_type": "name" }, { "api_name": "statsmodels.api.tsa.seasonal_decompose", "line_number": 28, "usage_type": "call...
156017325
from scatter_net_convolution_train import forwardprop from scatter_net_convolution_train import init_weights from scatter_net_convolution_train import init_bias import tensorflow as tf import numpy as np from sklearn import datasets from sklearn.model_selection import train_test_split import os import time import argpa...
null
scatter_net_convolution_match.py
scatter_net_convolution_match.py
py
4,419
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.transpose", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.genfromtxt", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.genfromtxt", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.reshape", ...
364370968
import pandas as pd import tushare as ts import time,datetime from easyutils import timeutils from hq.HqUtils import * from easytrader import log sleepInterval = 1 peLow=0 #市盈率下限 peHigh=30 #市盈率上限 jiejinCount=30 #解禁数量 jiejinRatio=3 #解禁比例 yuyingLow=0.1 #预赢每股收入 engine = get_engine() #更新当日最新数据 def get_day_hq(): trad...
null
hq/GetDayHQ.py
GetDayHQ.py
py
3,055
python
en
code
null
code-starcoder2
83
[ { "api_name": "easyutils.timeutils.get_last_trade_day", "line_number": 19, "usage_type": "call" }, { "api_name": "easyutils.timeutils", "line_number": 19, "usage_type": "name" }, { "api_name": "easytrader.log.info", "line_number": 20, "usage_type": "call" }, { "ap...
374554750
from tools import models """ Use this script like this python manage.py shell < script.py """ def delete_object(object_list): for item in object_list: item.delete() # Reference Reference = models.Reference delete_object(Reference.objects.all()) url_list = ["https://www.eia.gov/energyexplained/units-and-...
null
exsys/script_db.py
script_db.py
py
15,394
python
en
code
null
code-starcoder2
83
[ { "api_name": "tools.models.Reference", "line_number": 14, "usage_type": "attribute" }, { "api_name": "tools.models", "line_number": 14, "usage_type": "name" }, { "api_name": "tools.models.PhysicalState", "line_number": 33, "usage_type": "attribute" }, { "api_name...
185095412
import sys import unittest import numpy as np import torch from metal.label_model.label_model import LabelModel from metal.label_model.baselines import ( RandomVoter, MajorityClassVoter, MajorityLabelVoter, ) sys.path.append("../synthetics") from synthetics.generate import ( SingleTaskTreeDepsGenerat...
null
tests/metal/label_model/test_label_model.py
test_label_model.py
py
4,002
python
en
code
null
code-starcoder2
83
[ { "api_name": "sys.path.append", "line_number": 14, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 14, "usage_type": "attribute" }, { "api_name": "unittest.TestCase", "line_number": 22, "usage_type": "attribute" }, { "api_name": "metal.label_mode...
476898207
from pymongo import MongoClient import json client = MongoClient('proximus.modulusmongo.net:27017') client.tepO9seb.authenticate('nasahack', 'hacking4nasa') db = client.tepO9seb if __name__ == '__main__': data = json.load(open('data/defense_ngram_np.json')) db.datasets.insert(data)
null
mongoWork/insert_defense_ngram_kwds.py
insert_defense_ngram_kwds.py
py
293
python
en
code
null
code-starcoder2
83
[ { "api_name": "pymongo.MongoClient", "line_number": 4, "usage_type": "call" }, { "api_name": "json.load", "line_number": 9, "usage_type": "call" } ]
535483665
#!/usr/bin/env python3 """ bayesian test for periodicity in equally spaced spatial/time data (ti,yi) etc following Jaynes, 'Probability Theory: The Logic of Science' section 17.6 #====================================== MODEL: y(t) = A.cos wt + B.sin wt + mu + Gaussian_noise n data points PRIORS: Jeffrey's priors...
null
src/PeriodicSeries.py
PeriodicSeries.py
py
5,801
python
en
code
null
code-starcoder2
83
[ { "api_name": "math.cos", "line_number": 36, "usage_type": "call" }, { "api_name": "math.sin", "line_number": 36, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 48, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 49, ...
4509549
# -*- coding: utf-8 -*- """ Signals and receivers for Course Access Groups. """ import logging from .models import Membership log = logging.getLogger(__name__) def on_learner_account_activated(sender, user, **kwargs): """ Receive the `USER_ACCOUNT_ACTIVATED` signal to apply MembershipRule. :param send...
null
course_access_groups/signals.py
signals.py
py
698
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.getLogger", "line_number": 10, "usage_type": "call" }, { "api_name": "models.Membership.create_from_rules", "line_number": 22, "usage_type": "call" }, { "api_name": "models.Membership", "line_number": 22, "usage_type": "name" } ]
65990093
''' Serves through a (super) simplified version of http protocol. Warning: Running this may expose your computer to attacks. Don't run this. ''' from threading import Thread from queue import Queue, Empty from socket import socket as Socket, timeout, gethostname, gethostbyname import logging from mythread import Saf...
null
myhttp.py
myhttp.py
py
8,182
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.basicConfig", "line_number": 23, "usage_type": "call" }, { "api_name": "logging.root.setLevel", "line_number": 25, "usage_type": "call" }, { "api_name": "logging.root", "line_number": 25, "usage_type": "attribute" }, { "api_name": "logging.N...
31727530
#glob模块提供了一个函数用于从目录通配符搜索中生成文件列表: import glob print(glob.glob('*.py')) #['primes.py', 'random.py', 'quote.py'] # 命令行参数 # 通用工具脚本经常调用命令行参数。这些命令行参数以链表形式存储于 sys 模块的 argv 变量。例如在命令行中执行 "python demo.py one two three" 后可以得到以下输出结果: import sys print(sys.argv) ['demo.py', 'one', 'two', 'three'] # 错误输出重定向和程序终止 # sys 还有 stdin,...
null
note-taking/stdlib.py
stdlib.py
py
2,221
python
en
code
null
code-starcoder2
83
[ { "api_name": "glob.glob", "line_number": 3, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 11, "usage_type": "attribute" }, { "api_name": "sys.stderr.write", "line_number": 18, "usage_type": "call" }, { "api_name": "sys.stderr", "line_number...
21500883
# See LICENSE file for full copyright and licensing details from odoo import models, fields, api from datetime import datetime from odoo.exceptions import ValidationError from odoo.tools import DEFAULT_SERVER_DATE_FORMAT class CommissionReport(models.TransientModel): _name = 'commission.report' start_date =...
null
property_commission_ee/wizard/commission_report.py
commission_report.py
py
1,584
python
en
code
null
code-starcoder2
83
[ { "api_name": "odoo.models.TransientModel", "line_number": 9, "usage_type": "attribute" }, { "api_name": "odoo.models", "line_number": 9, "usage_type": "name" }, { "api_name": "odoo.fields.Date", "line_number": 12, "usage_type": "call" }, { "api_name": "odoo.field...
19470117
import xlrd import xlwt # from xlutils.copy import copy #暂时用不上 import os l_p = [] # 定义两个全局list,分别存储原始和目的需要对比的数据 l_t = [] def read_excel(): wb_pri = xlrd.open_workbook('test_modify.xlsx') # 打开原始文件 wb_tar = xlrd.open_workbook('test_origin.xlsx') # 打开目标文件 wb_result = xlwt.Workbook() # 新建一个文件,用来保存结果 ...
null
excel-in-python/test_compare.py
test_compare.py
py
1,968
python
en
code
null
code-starcoder2
83
[ { "api_name": "xlrd.open_workbook", "line_number": 11, "usage_type": "call" }, { "api_name": "xlrd.open_workbook", "line_number": 12, "usage_type": "call" }, { "api_name": "xlwt.Workbook", "line_number": 13, "usage_type": "call" } ]
577276761
#!/usr/bin/env python3 """The setup script.""" from setuptools import setup, find_packages import versioneer with open('README.rst') as readme_file: readme = readme_file.read() with open('HISTORY.rst') as history_file: history = history_file.read() name = 'pycookiecutter' packages = find_packages() url = ...
null
setup.py
setup.py
py
1,594
python
en
code
null
code-starcoder2
83
[ { "api_name": "setuptools.find_packages", "line_number": 16, "usage_type": "call" }, { "api_name": "versioneer.get_version", "line_number": 18, "usage_type": "call" }, { "api_name": "versioneer.get_cmdclass", "line_number": 19, "usage_type": "call" }, { "api_name"...
125765735
from selenium import webdriver from webdriver_manager.chrome import ChromeDriverManager from selenium.webdriver.chrome.options import Options import time from fbchat import Client, log from fbchat.models import * options = webdriver.ChromeOptions() #options.add_argument('headless') #driver = webdriver.Chrome(...
null
msgReader.py
msgReader.py
py
1,091
python
en
code
null
code-starcoder2
83
[ { "api_name": "selenium.webdriver.ChromeOptions", "line_number": 8, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 8, "usage_type": "name" }, { "api_name": "fbchat.Client", "line_number": 14, "usage_type": "name" } ]
265063260
from keras.models import Sequential from keras.layers import Concatenate,Input, Dense, concatenate from keras.models import Model from keras.optimizers import Adam, RMSprop from keras.models import model_from_json from keras.layers import Dropout from keras.layers import Flatten from keras.constraints import max...
null
switching_dqn/dqn_adv.py
dqn_adv.py
py
20,250
python
en
code
null
code-starcoder2
83
[ { "api_name": "keras.backend.set_image_dim_ordering", "line_number": 13, "usage_type": "call" }, { "api_name": "keras.backend", "line_number": 13, "usage_type": "name" }, { "api_name": "numpy.random.seed", "line_number": 16, "usage_type": "call" }, { "api_name": "...
218689858
# Miro Community - Easiest way to make a video website # # Copyright (C) 2011, 2012 Participatory Culture Foundation # # Miro Community is free software: you can redistribute it and/or modify it # under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 ...
null
mirocommunity_saas/management/commands/nightly_tiers_events.py
nightly_tiers_events.py
py
3,905
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.core.management.base.BaseCommand", "line_number": 25, "usage_type": "name" }, { "api_name": "mirocommunity_saas.models.TierInfo.objects.get_current", "line_number": 40, "usage_type": "call" }, { "api_name": "mirocommunity_saas.models.TierInfo", "line_num...
173122570
''' Created on 28 Oct 2020 @author: 612563313 ''' import pytest import time from selenium.webdriver.common.by import By from AppTests.test_InitWebdriver import BaseTest from Config.config import SetupConfiguration as scd from AppPages.aFPLaunch import LaunchFP from AppTestData.LoginPage_TestData impor...
null
com.myportaltest.rivusfleet/AppTests/test_LaunchFP.py
test_LaunchFP.py
py
1,626
python
en
code
null
code-starcoder2
83
[ { "api_name": "AppTests.test_InitWebdriver.BaseTest", "line_number": 18, "usage_type": "name" }, { "api_name": "AppPages.aFPLaunch.LaunchFP", "line_number": 21, "usage_type": "call" }, { "api_name": "Config.config.SetupConfiguration.UsrName", "line_number": 22, "usage_typ...
216602983
import date_format as df from rich.console import Console from rich import print from rich.table import Table, Column from pprint import pprint import json # global variable calender_id calendar_id = 'wethinkmock@gmail.com' def get_slot_attendee_names(event): """[Takes in an event and returns whos the ...
null
functions/get_events.py
get_events.py
py
9,464
python
en
code
null
code-starcoder2
83
[ { "api_name": "rich.console.Console", "line_number": 40, "usage_type": "call" }, { "api_name": "rich.table.Table", "line_number": 41, "usage_type": "call" }, { "api_name": "rich.print", "line_number": 63, "usage_type": "call" }, { "api_name": "date_format.get_curr...
291496527
#!/usr/bin/env python3 import os import sympy import mpmath as sm import scipy.signal import matplotlib.pyplot as plt # precision sm.mp.prec = 512 def daubechies(N): # p vanishing moments. p = int(N/2) # make polynomial; see Mallat, 7.96 Py = [sm.binomial(p-1+k, k) for k in reversed(range(p))] # ...
null
test.py
test.py
py
3,708
python
en
code
null
code-starcoder2
83
[ { "api_name": "mpmath.mp", "line_number": 9, "usage_type": "attribute" }, { "api_name": "mpmath.binomial", "line_number": 15, "usage_type": "call" }, { "api_name": "mpmath.mp.polyroots", "line_number": 18, "usage_type": "call" }, { "api_name": "mpmath.mp", "li...
491261114
# Copyright (C) 2012 Alex Nitz # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation; either version 3 of the License, or (at your # option) any later version. # # This program is distributed in the h...
null
pycbc/events/threshold_opencl.py
threshold_opencl.py
py
2,286
python
en
code
null
code-starcoder2
83
[ { "api_name": "pyopencl.elementwise.ElementwiseKernel", "line_number": 46, "usage_type": "call" }, { "api_name": "pycbc.scheme.mgr.state", "line_number": 46, "usage_type": "attribute" }, { "api_name": "pycbc.scheme.mgr", "line_number": 46, "usage_type": "name" }, { ...
479122583
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri Nov 23 23:27:29 2018 @author: vivekmishra """ import os os.chdir('/Users/vivekmishra/Desktop/USC/599-DSS/StanceDataset') import requests import pandas as pd import re import string import unicodedata import seaborn as sns import matplotlib as plt #im...
null
StanceDataset/stance.py
stance.py
py
9,256
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.chdir", "line_number": 10, "usage_type": "call" }, { "api_name": "nltk.download", "line_number": 29, "usage_type": "call" }, { "api_name": "nltk.tokenize.toktok.ToktokTokenizer", "line_number": 31, "usage_type": "call" }, { "api_name": "nltk.down...
444608156
#!/home/yli11/.conda/envs/py2/bin/python import sys import os p_dir = os.path.dirname(os.path.realpath(__file__)) + "/" sys.path.append(os.path.abspath(p_dir+"../utils/")) # from liyc_utils import * import pandas as pd import argparse import getpass import datetime import matplotlib import pandas as pd matplotlib.use('...
null
bin/pie_plot.py
pie_plot.py
py
4,975
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.path.dirname", "line_number": 4, "usage_type": "call" }, { "api_name": "os.path", "line_number": 4, "usage_type": "attribute" }, { "api_name": "os.path.realpath", "line_number": 4, "usage_type": "call" }, { "api_name": "sys.path.append", "lin...
94208053
import maya.cmds as cmds import os as os import os import os.path import shutil ### reference and rig related Function ------ def findRigByName(sel): ''' still in WIP try finding the rig by it's name ''' out = [] for o in sel: if '_Rig_Grp' in o: out.append(o) out =...
null
Maya/ProjectRelated/Vejfesten/Pipeline/shotAbcExporter/old/shotAbcExporter_v0.2.py
shotAbcExporter_v0.2.py
py
10,443
python
en
code
null
code-starcoder2
83
[ { "api_name": "maya.cmds.referenceQuery", "line_number": 31, "usage_type": "call" }, { "api_name": "maya.cmds", "line_number": 31, "usage_type": "name" }, { "api_name": "maya.cmds.ls", "line_number": 37, "usage_type": "call" }, { "api_name": "maya.cmds", "line...
73947750
# -*- coding: utf-8 -*- """ Created on Fri Dec 13 14:01:42 2019 @author: sebas """ # Imports import pandas as pd import numpy as np import matplotlib.pyplot as plt import matplotlib.patches as mpatches import statistics from sklearn.decomposition import PCA from sklearn.model_selection import train_test_split, GridSe...
null
code/CMV_classifier.py
CMV_classifier.py
py
17,810
python
en
code
null
code-starcoder2
83
[ { "api_name": "pandas.read_csv", "line_number": 34, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 46, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 51, "usage_type": "call" }, { "api_name": "pandas.read_csv", ...
61399322
from cms.apps.admin.permission import site_permission_required, super_user_permission from flask import request, render_template, redirect, url_for, jsonify, \ make_response from babel.messages.catalog import Catalog from babel.messages.pofile import write_po from StringIO import StringIO import datetime from cms....
null
cms/apps/admin/views/sites.py
sites.py
py
3,247
python
en
code
null
code-starcoder2
83
[ { "api_name": "cms.models.site.Site", "line_number": 19, "usage_type": "attribute" }, { "api_name": "cms.models.site", "line_number": 19, "usage_type": "name" }, { "api_name": "flask.render_template", "line_number": 20, "usage_type": "call" }, { "api_name": "cms.a...
51905365
from django.urls import reverse from django.conf import settings def context(request): """ This function adds some app-specific values to the django template context """ claims = request.identity_context_data._id_token_claims exclude_claims = ['iat', 'exp', 'nbf', 'uti', 'aio', 'rh'] claims_to_display ...
null
1-Authentication/sign-in-b2c/Sample/context_processors.py
context_processors.py
py
827
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.conf.settings.AAD_CONFIG", "line_number": 10, "usage_type": "attribute" }, { "api_name": "django.conf.settings", "line_number": 10, "usage_type": "name" }, { "api_name": "django.urls.reverse", "line_number": 14, "usage_type": "call" }, { "api...
463164967
from neo4j import GraphDatabase, basic_auth def neoArticlesSentencesFetch(chosenLang): driver = GraphDatabase.driver("bolt://semantiqa.com:7687", auth=("neo4j", "cazzhack")) def get_sentences(article, language): with driver.session() as session: results = session.run( ...
null
views_utils/neoArticlesSentencesFetch.py
neoArticlesSentencesFetch.py
py
1,271
python
en
code
null
code-starcoder2
83
[ { "api_name": "neo4j.GraphDatabase.driver", "line_number": 5, "usage_type": "call" }, { "api_name": "neo4j.GraphDatabase", "line_number": 5, "usage_type": "name" }, { "api_name": "random.shuffle", "line_number": 31, "usage_type": "call" } ]
455581979
import os import os.path as osp import json import torch import pandas import numpy as npD from dateutil.parser import parse, parserinfo from torch_sparse import coalesce from torch_geometric.data import (Data, InMemoryDataset, download_url, extract_gz, extract_tar) from torch_geometri...
null
torch_geometric/datasets/snap_dataset.py
snap_dataset.py
py
22,939
python
en
code
null
code-starcoder2
83
[ { "api_name": "pandas.read_csv", "line_number": 16, "usage_type": "call" }, { "api_name": "torch.from_numpy", "line_number": 18, "usage_type": "call" }, { "api_name": "torch.unique", "line_number": 21, "usage_type": "call" }, { "api_name": "torch_geometric.utils.t...
348365806
from typing import Tuple import pygame import sys import os import math from inventory import Inventory """ HactuallyBenji https://opensource.com/article/17/12/game-python-moving-player """ class Player(pygame.sprite.Sprite): def __init__(self, bounds): pygame.sprite.Sprite.__init__(self) ...
null
player.py
player.py
py
3,053
python
en
code
null
code-starcoder2
83
[ { "api_name": "pygame.sprite", "line_number": 16, "usage_type": "attribute" }, { "api_name": "pygame.sprite.Sprite.__init__", "line_number": 19, "usage_type": "call" }, { "api_name": "pygame.sprite", "line_number": 19, "usage_type": "attribute" }, { "api_name": "p...
11841345
__author__ = "Manouchehr Rasouli" __date__ = "5/Aug/2017, 8/Aug/2017" import requests import json import threading import time import datetime from config_pack import configuration_manager from interupt_service_connector import inter_upt_logger from exception_log_service_connection import exception_logger class Inte...
null
inter_upt_service/inter_upt_service.py
inter_upt_service.py
py
1,506
python
en
code
null
code-starcoder2
83
[ { "api_name": "interupt_service_connector.inter_upt_logger.InterUptLogger", "line_number": 17, "usage_type": "call" }, { "api_name": "interupt_service_connector.inter_upt_logger", "line_number": 17, "usage_type": "name" }, { "api_name": "threading.Thread", "line_number": 18, ...
210350037
import logging import re import sys import urllib.parse from concurrent.futures import ThreadPoolExecutor import requests from bs4 import BeautifulSoup def fetch_afisha_page(url="https://www.afisha.ru/msk/schedule_cinema/"): response = requests.get(url) html = response.text return html def parse_afisha...
null
cinemas.py
cinemas.py
py
3,583
python
en
code
null
code-starcoder2
83
[ { "api_name": "requests.get", "line_number": 12, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 18, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 34, "usage_type": "call" }, { "api_name": "requests.get", "line_number...
106158690
from django import forms PRODUCT_QUANTITY_CHOICES = [(i, str(i)) for i in range(1, 15)] class CartAddProductForm(forms.Form): quantity = forms.TypedChoiceField( choices=PRODUCT_QUANTITY_CHOICES, coerce=int, label='Кол-во', widget=forms.NumberInput( attrs={ ...
null
shop/cart/forms.py
forms.py
py
591
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.forms.Form", "line_number": 6, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 6, "usage_type": "name" }, { "api_name": "django.forms.TypedChoiceField", "line_number": 7, "usage_type": "call" }, { "api_name": "django...
548477051
from typing import Dict, List, Tuple, NewType with open("data") as f: data = f.readlines() IntervalDict = NewType("IntervalDict", Dict[int, List[Tuple[int,int]]]) def sortSeries(data:List[str]) -> Tuple[List[int], List[str]]: parsed1 = [d[1:].split("]")[0].split(" ") for d in data] ...
null
four/b.py
b.py
py
2,291
python
en
code
null
code-starcoder2
83
[ { "api_name": "typing.NewType", "line_number": 9, "usage_type": "call" }, { "api_name": "typing.Dict", "line_number": 9, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 9, "usage_type": "name" }, { "api_name": "typing.Tuple", "line_number":...
30471702
import openpyxl from openpyxl.styles import Border, Side, Font from time import sleep import time class ParseExcel(object): def __init__(self): self.workbook = None self.excelFile = None self.font = Font(color = None) #设置字体的颜色 # 颜色对应的RGB值 self.RGBDict = {'red': 'FFFF3030', '...
null
common/ParseExcel.py
ParseExcel.py
py
7,388
python
en
code
null
code-starcoder2
83
[ { "api_name": "openpyxl.styles.Font", "line_number": 10, "usage_type": "call" }, { "api_name": "openpyxl.load_workbook", "line_number": 17, "usage_type": "call" }, { "api_name": "openpyxl.styles.Font", "line_number": 122, "usage_type": "call" }, { "api_name": "ope...
15503330
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri Jul 21 14:50:35 2017 @author: student """ import argparse import redis import sys import os if __name__ == '__main__': parser = argparse.ArgumentParser(description='Export data related to IP and MAC addresses into a matrix which will be used as da...
null
bin/create-circos-matrix.py
create-circos-matrix.py
py
2,529
python
en
code
null
code-starcoder2
83
[ { "api_name": "argparse.ArgumentParser", "line_number": 15, "usage_type": "call" }, { "api_name": "sys.stderr.write", "line_number": 28, "usage_type": "call" }, { "api_name": "sys.stderr", "line_number": 28, "usage_type": "attribute" }, { "api_name": "sys.exit", ...
223357160
import datetime import h5py import pytest from mongomock import MongoClient from splash_ingest.server.api_auth_service import create_api_client, init_api_service as init_api_key from splash_ingest.server.model import IngestType from splash_ingest.model import Mapping from ..ingest_service import ( bluesky_context, ...
null
splash_ingest/server/tests/test_workflow.py
test_workflow.py
py
5,803
python
en
code
null
code-starcoder2
83
[ { "api_name": "mongomock.MongoClient", "line_number": 25, "usage_type": "call" }, { "api_name": "mongomock.MongoClient", "line_number": 26, "usage_type": "call" }, { "api_name": "ingest_service.init_ingest_service", "line_number": 27, "usage_type": "call" }, { "ap...
295050664
import asyncio from discord.ext.commands import Bot cachedName = {} async def get_name_by_discord_id(bot: Bot, id: int): if (id not in cachedName): user = await bot.fetch_user(id) cachedName[id] = user.name return cachedName[id] async def add_pagination_arrow_reaction(res): await a...
null
app/discord/module/helper.py
helper.py
py
412
python
en
code
null
code-starcoder2
83
[ { "api_name": "discord.ext.commands.Bot", "line_number": 7, "usage_type": "name" }, { "api_name": "asyncio.gather", "line_number": 16, "usage_type": "call" } ]
551295644
#Python program to download Grok source code into local file. #this should be used by PTC employee only! #Please don't use this tool to violate any company policy! from argparse import ArgumentParser from bs4 import BeautifulSoup import urllib2 try: from urllib.request import urlopen from urllib.error import HT...
null
zillowscrapy.py
zillowscrapy.py
py
7,281
python
en
code
null
code-starcoder2
83
[ { "api_name": "argparse.ArgumentParser", "line_number": 20, "usage_type": "call" }, { "api_name": "urllib2.urlopen", "line_number": 94, "usage_type": "call" }, { "api_name": "urllib.request.error", "line_number": 95, "usage_type": "attribute" }, { "api_name": "url...
628086066
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
null
src/azure-cli/azure/cli/command_modules/storage/operations/fs_directory.py
fs_directory.py
py
3,253
python
en
code
null
code-starcoder2
83
[ { "api_name": "azure.core.exceptions.HttpResponseError", "line_number": 17, "usage_type": "name" }, { "api_name": "azure.cli.core.profiles.ResourceType.DATA_STORAGE_FILEDATALAKE", "line_number": 20, "usage_type": "attribute" }, { "api_name": "azure.cli.core.profiles.ResourceType"...
345194848
#!/usr/bin/env python3 # Kebechet # Copyright(C) 2018, 2019 Kevin Postlethwait # # This program is free software: you can redistribute it and / or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any late...
null
kebechet/managers/thoth_advise/thoth_advise.py
thoth_advise.py
py
6,499
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.getLogger", "line_number": 38, "usage_type": "call" }, { "api_name": "kebechet.managers.manager.ManagerBase", "line_number": 41, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 69, "usage_type": "attribute" }, { "api_...
642655417
# Nurse shift replication by Cassio Amorim, CJS Inc. # Licensed under Apache 2.0 License. # Original paper by Ikeda, Nakamura, Humble. DOI: 10.1038/s41598-019-49172-3 # Original licensed under Creative Commons ## Target Hamiltonian: ## 目的ハミルトニアン: ## H(q) = \sum_n,n' \sum_d, d' J_i(n, d)j(n',d')q_iq_j ## ...
null
Nurse Shift.py
Nurse Shift.py
py
5,105
python
en
code
null
code-starcoder2
83
[ { "api_name": "collections.defaultdict", "line_number": 58, "usage_type": "call" }, { "api_name": "copy.deepcopy", "line_number": 68, "usage_type": "call" }, { "api_name": "dwave.system.samplers.DWaveSampler", "line_number": 94, "usage_type": "call" }, { "api_name...
472541643
import enum from ctssimu.data import Machine, AbstractState, states, AllOtherStates from ctssimu.cts import Process, ProcessState from ctssimu.io import CtEvetAnnoodeOff, CtEvetPowerOffCooling, CtEvetPowerOffFinished, CtEvetPowerOffStart class PowerOffOperatorState(AbstractState, enum.Enum): IDLE = 0 RUNNING ...
null
ctssimu/ctssimu/cts/power/off.py
off.py
py
2,621
python
en
code
null
code-starcoder2
83
[ { "api_name": "ctssimu.data.AbstractState", "line_number": 7, "usage_type": "name" }, { "api_name": "enum.Enum", "line_number": 7, "usage_type": "attribute" }, { "api_name": "ctssimu.data.Machine", "line_number": 21, "usage_type": "name" }, { "api_name": "ctssimu....
367550628
from sklearn import preprocessing import pandas as pd import matplotlib.pyplot as plt def iris_type(s): s = str(s,'utf-8') # print(type(s)) it = {'Iris-setosa': 0, 'Iris-versicolor': 1, 'Iris-virginica': 2} return it[s] if __name__ == "__main__": path = u'8.iris.data' # 数据文件路径 df = pd.read_csv...
null
sklearn_loc/Iris/iris-plot.py
iris-plot.py
py
994
python
en
code
null
code-starcoder2
83
[ { "api_name": "pandas.read_csv", "line_number": 12, "usage_type": "call" }, { "api_name": "sklearn.preprocessing.LabelEncoder", "line_number": 16, "usage_type": "call" }, { "api_name": "sklearn.preprocessing", "line_number": 16, "usage_type": "name" }, { "api_name...
57437260
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) from contextlib impo...
null
src/python/pants/java/jar/manifest.py
manifest.py
py
1,537
python
en
code
null
code-starcoder2
83
[ { "api_name": "contextlib.closing", "line_number": 23, "usage_type": "call" }, { "api_name": "six.StringIO", "line_number": 23, "usage_type": "call" } ]
438629179
import PyPDF2 from sys import argv def extract(old_path, new_path): old_pdf = PyPDF2.PdfFileReader(open(old_path, 'rb')) new_pdf = PyPDF2.PdfFileWriter() get = lambda x : old_pdf.getPage(x).extractText() old_sz = old_pdf.getNumPages() for i in range(old_sz): if i == old_sz-1 ...
null
fix-pdf/main.py
main.py
py
625
python
en
code
null
code-starcoder2
83
[ { "api_name": "PyPDF2.PdfFileReader", "line_number": 6, "usage_type": "call" }, { "api_name": "PyPDF2.PdfFileWriter", "line_number": 7, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 20, "usage_type": "argument" }, { "api_name": "sys.argv", "...
240285070
import logging import tasks.tasks as conc import Jython_tasks.task as jython_tasks from couchbase_helper.documentgenerator import doc_generator from membase.api.rest_client import RestConnection from sdk_client3 import SDKClient as VBucketAwareMemcached from BucketLib.BucketOperations import BucketHelper """An API f...
null
lib/couchbase_helper/cluster.py
cluster.py
py
37,834
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.getLogger", "line_number": 26, "usage_type": "call" }, { "api_name": "tasks.tasks.BucketCreateTask", "line_number": 39, "usage_type": "call" }, { "api_name": "tasks.tasks", "line_number": 39, "usage_type": "name" }, { "api_name": "tasks.task...
353756888
import discord, asyncio, random, os client = discord.Client() async def action(message): reactList = ["IL EST MALADE", "Mais qu'est ce qu'il est en train de faire", \ "Mais je pensais vraiment pas qu'il allait faire ça"] introList = ["Alerte, si vous voyez des chips vertes dans votre pa...
null
forlanBot.py
forlanBot.py
py
3,286
python
en
code
null
code-starcoder2
83
[ { "api_name": "discord.Client", "line_number": 3, "usage_type": "call" }, { "api_name": "random.choice", "line_number": 33, "usage_type": "call" }, { "api_name": "random.choice", "line_number": 38, "usage_type": "call" }, { "api_name": "discord.Game", "line_nu...
330565394
#!/usr/bin/python #-*- coding: utf-8 -*- import numpy as np import glob import cv2 import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec def get_images(list_images): # We read the images array_imgs = [] for name in list_images: img = cv2.imread(name) img = cv2.cvtColor(im...
null
Follow Line/analysis_vectors.py
analysis_vectors.py
py
3,768
python
en
code
null
code-starcoder2
83
[ { "api_name": "cv2.imread", "line_number": 15, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 16, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2RGB", "line_number": 16, "usage_type": "attribute" }, { "api_name": "cv2.cvtColor", "li...
344020708
from pygame import Surface, SRCALPHA from pygame import Rect from pygame.image import load as load_img from pygame.transform import flip import pygame from .. import Colors from .. import screen_size, gravity from .position import Position walking_sprites = ( 20, 114, 48, 64, ) class Hero(object): size = ...
null
Witcher 2D/Witcher 2D_r/game/objects/hero.py
hero.py
py
4,166
python
en
code
null
code-starcoder2
83
[ { "api_name": "position.Position", "line_number": 30, "usage_type": "call" }, { "api_name": "position.Position", "line_number": 32, "usage_type": "call" }, { "api_name": "pygame.Surface", "line_number": 33, "usage_type": "call" }, { "api_name": "pygame.SRCALPHA", ...
201387667
# coding: utf-8 import pandas as pd import matplotlib.pyplot as plt import numpy as np data = pd.read_csv('Li2CO3.dos1ev', delim_whitespace=True, skiprows=3, names = ['E','tot','Li','C','O1','O2']) data.describe() data['O1'] = data['O1']+data['O2'] for i in np.arange(4): plt.plot(data['E'],data[data.keys()[i+1]])...
null
Images/DOS_plots/LCO_plot.py
LCO_plot.py
py
469
python
en
code
null
code-starcoder2
83
[ { "api_name": "pandas.read_csv", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.arange", "line_number": 10, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 11, "usage_type": "call" }, { "api_name": "matplotlib.pyplot"...
299133036
# coding: utf-8 from datetime import datetime from random import choice from django.core.management.base import BaseCommand from django.contrib.auth.models import User from core.models import Post, Photo import logging AUTHORS = ['LAhmatyi', 'tinki', 'skyslayer', 'akafist', 'prophoter'] log = logging.getLogger(__n...
null
src/core/management/commands/publish_deferred.py
publish_deferred.py
py
1,183
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.getLogger", "line_number": 14, "usage_type": "call" }, { "api_name": "django.core.management.base.BaseCommand", "line_number": 17, "usage_type": "name" }, { "api_name": "core.models.Post.all.filter", "line_number": 20, "usage_type": "call" }, { ...
577424660
#!/usr/bin/env python3 import argparse import requests import sys from .cli import CLI from .library import ShibbolethError def run(): """Authenticate via U-M Shibboleth from the command line.""" # Argument parsing parser = argparse.ArgumentParser( description="Authenticate to U-M Shibboleth from...
null
src/__main__.py
__main__.py
py
1,347
python
en
code
null
code-starcoder2
83
[ { "api_name": "argparse.ArgumentParser", "line_number": 13, "usage_type": "call" }, { "api_name": "cli.CLI", "line_number": 27, "usage_type": "call" }, { "api_name": "requests.Request", "line_number": 28, "usage_type": "call" }, { "api_name": "cli.perform", "l...
101955264
#-*- coding: utf-8 -*- import numpy as np import itertools from fix_axis import fix_axis from tomo_seq import tomo_seq_all_axis from GP_data_processor import GP_data_processor from numpy import random as nprd from numpy import array as npar from data_manager import data_manager from scipy.misc import derivative class ...
null
stge/simulated_data_manager.py
simulated_data_manager.py
py
8,772
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.apply_along_axis", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.sum", "line_number": 18, "usage_type": "call" }, { "api_name": "fix_axis.fix_axis.get_sl...
353977539
#!/usr/bin/env python3 #this program just alternates between various incline positions import serial import time import binascii import oly_lib #===============main===================== #open port ser = serial.Serial( port='/dev/ttyUSB0', baudrate=38400, parity=serial.PARITY_NONE, stopbits=serial.S...
null
pbvr_Pi/RaspberryPi/Jaron/oly_utils-master/oly_automaton.py
oly_automaton.py
py
1,205
python
en
code
null
code-starcoder2
83
[ { "api_name": "serial.Serial", "line_number": 13, "usage_type": "call" }, { "api_name": "serial.PARITY_NONE", "line_number": 16, "usage_type": "attribute" }, { "api_name": "serial.STOPBITS_TWO", "line_number": 17, "usage_type": "attribute" }, { "api_name": "serial...
393466733
import numpy as np from matplotlib import pyplot as plt N = 330 I0 = 1 mu_0 = 4*np.pi*10**(-7) R = 0.07 a_liste = [2*R, R, R/2] def B_felt_antihelmholtz(x,a): prefaktor = N*mu_0*I0/(2*R) return 10000*prefaktor*((1 +(x-a/2)**2/R**2)**(-1.5) - (1 +(x+a/2)**2/R**2)**(-1.5)) def brgn_avvik(B, B_brgn): retur...
null
Lab/ElMag_FY1003/antihelmoltz.py
antihelmoltz.py
py
4,058
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.pi", "line_number": 7, "usage_type": "attribute" }, { "api_name": "numpy.asarray", "line_number": 29, "usage_type": "call" }, { "api_name": "numpy.float64", "line_number": 29, "usage_type": "attribute" }, { "api_name": "numpy.asarray", "li...
513440772
from lama.img_processing import normalise from logzero import logger as logging from lama import common import os import nrrd from pathlib import Path from scipy import ndimage import numpy as np import SimpleITK as sitk import pandas as pd from lama.stats.permutation_stats import bin_heatmap from lama.u...
null
lama/stats/permutation_stats/bin_and_norm.py
bin_and_norm.py
py
2,256
python
en
code
null
code-starcoder2
83
[ { "api_name": "pathlib.Path", "line_number": 19, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 21, "usage_type": "call" }, { "api_name": "nrrd.read", "line_number": 24, "usage_type": "call" }, { "api_name": "nrrd.read", "line_number": 27...
478238134
import torch import time import math from visdom import Visdom # from util import epoch_time from nltk.translate.bleu_score import SmoothingFunction from nltk.translate.meteor_score import meteor_score from rouge import Rouge import nltk import torch import torch.nn as nn from torch.utils.data import DataLoa...
null
M2TS_model/run.py
run.py
py
5,062
python
en
code
null
code-starcoder2
83
[ { "api_name": "argparse.ArgumentParser", "line_number": 31, "usage_type": "call" }, { "api_name": "torch.device", "line_number": 48, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", "line_number": 48, "usage_type": "call" }, { "api_name": "torch.cu...
69527100
#from django.conf.urls import url from django.urls import re_path as url from .views import formset, advanced, index urlpatterns = [ url(r'^formset/', formset, name='example-formset'), url(r'^advanced/', advanced, name='example-advanced'), url(r'^', index, name='example-index'), ]
null
example/core/urls.py
urls.py
py
296
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.urls.re_path", "line_number": 7, "usage_type": "call" }, { "api_name": "views.formset", "line_number": 7, "usage_type": "argument" }, { "api_name": "django.urls.re_path", "line_number": 8, "usage_type": "call" }, { "api_name": "views.advanced...
431060408
import requests from allauth.socialaccount.providers.base import ProviderAccount from allauth.socialaccount.providers.core.oauth2.provider import OAuth2Provider class TwentyThreeAndMeAccount(ProviderAccount): pass class TwentyThreeAndMeProvider(OAuth2Provider): id = 'twentythreeandme' name = '23andMe' ...
null
allauth/socialaccount/providers/other/twentythreeandme/provider.py
provider.py
py
1,141
python
en
code
null
code-starcoder2
83
[ { "api_name": "allauth.socialaccount.providers.base.ProviderAccount", "line_number": 7, "usage_type": "name" }, { "api_name": "allauth.socialaccount.providers.core.oauth2.provider.OAuth2Provider", "line_number": 11, "usage_type": "name" }, { "api_name": "requests.get", "line_...
443382926
import numpy as np import tensorflow as tf import _pickle as pickle from tqdm import tqdm import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt class Network(object): def __init__(self, io_nn, latent_size, input_size, time_series_length, output_size, encoder_num_units=[100, 100...
null
scinet_motor/model_new.py
model_new.py
py
23,015
python
en
code
null
code-starcoder2
83
[ { "api_name": "matplotlib.use", "line_number": 6, "usage_type": "call" }, { "api_name": "tensorflow.Graph", "line_number": 27, "usage_type": "call" }, { "api_name": "tensorflow.Session", "line_number": 42, "usage_type": "call" }, { "api_name": "tqdm.tqdm", "li...
164395540
from tkinter import * from PIL import ImageTk,Image from face_recognition import * import os window = Tk() window.title("Graduate Thesis") window.geometry('1000x600') lbl = Label(window, text="Graduate Thesis",fg="Red", font=("arial",27,"bold")) lbl.place(x=370,y=10) lb2 = Label(window, text="Kh...
null
GUI_official.py
GUI_official.py
py
2,308
python
en
code
null
code-starcoder2
83
[ { "api_name": "PIL.ImageTk.PhotoImage", "line_number": 49, "usage_type": "call" }, { "api_name": "PIL.ImageTk", "line_number": 49, "usage_type": "name" }, { "api_name": "PIL.Image.open", "line_number": 49, "usage_type": "call" }, { "api_name": "PIL.Image", "li...
259457475
# Javier Mariño import matplotlib.pyplot as plt import numpy as np plt.ion() dimt = 2000 # número de iteraciones temporales deltat = 0.1; deltax = 0.5; alfa = 0.1; N = 20 # parámetros naturales de la discretización s = alfa*deltat/deltax**2 # calculamos la estabilidad T = np.zeros(N+1); T[5:9]=np.random.sample(4)*10...
null
bol8/bol8_ex1ayb_Mariño_Villadamigo_Javier.py
bol8_ex1ayb_Mariño_Villadamigo_Javier.py
py
871
python
en
code
null
code-starcoder2
83
[ { "api_name": "matplotlib.pyplot.ion", "line_number": 5, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 5, "usage_type": "name" }, { "api_name": "numpy.zeros", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.random.sample...
363057054
from django.urls import path from . import views urlpatterns = [ path('home/', views.home, name="home"), path('', views.blog, name="blog"), path('<int:blog_id>/', views.detail, name="detail"), # <type:변수이름>, 이 변수이름은 argument로 views에 전달한다. path converterㅍ path('create/', views.create, name='...
null
mysite/myapp/urls.py
urls.py
py
425
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.urls.path", "line_number": 5, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 6, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "django.urls.path", ...
330838265
from flask import Flask from flask.ext.sqlalchemy import SQLAlchemy from flask.ext.login import LoginManager from momentjs import momentjs import bmemcached # app object app = Flask(__name__) # config file app.config.from_object('config') # DB db = SQLAlchemy(app) # login lm = LoginManager() lm.init_app(app) lm.login_...
null
app/__init__.py
__init__.py
py
712
python
en
code
null
code-starcoder2
83
[ { "api_name": "flask.Flask", "line_number": 8, "usage_type": "call" }, { "api_name": "flask.ext.sqlalchemy.SQLAlchemy", "line_number": 12, "usage_type": "call" }, { "api_name": "flask.ext.login.LoginManager", "line_number": 14, "usage_type": "call" }, { "api_name"...
161447871
from collections import Counter import sys sys.setrecursionlimit(5000000) S = list(input()) L = len(S) A = Counter(S) nCr = {} def cmb(n, r): if r == 0 or r == n: return 1 if r == 1: return n if (n,r) in nCr: return nCr[(n,r)] nCr[(n,r)] = cmb(n-1,r) + cmb(n-1,r-1) return nCr[(n,r)] if L == 1: ...
null
Python_codes/p03618/s011382759.py
s011382759.py
py
453
python
en
code
null
code-starcoder2
83
[ { "api_name": "sys.setrecursionlimit", "line_number": 3, "usage_type": "call" }, { "api_name": "collections.Counter", "line_number": 7, "usage_type": "call" } ]
421816810
import numpy as np import pygame as pg from Code4Fun.Utility.Vec2 import Vec2 from numba import guvectorize, complex64, int32 from PIL import Image # size = Vec2(1400, 1000) # size = Vec2(1120, 400) size = Vec2(1680, 600) man_min = Vec2(-2.5, -1.25) man_max = Vec2(1, 1.25) jul_min = Vec2(-1.75, -1.25) jul_max = Vec2...
null
Projects/Fractals/Mandelbrot/JuliaSetNumba.py
JuliaSetNumba.py
py
8,570
python
en
code
null
code-starcoder2
83
[ { "api_name": "Code4Fun.Utility.Vec2.Vec2", "line_number": 10, "usage_type": "call" }, { "api_name": "Code4Fun.Utility.Vec2.Vec2", "line_number": 11, "usage_type": "call" }, { "api_name": "Code4Fun.Utility.Vec2.Vec2", "line_number": 12, "usage_type": "call" }, { "...
424252688
import numpy as np import scipy.io as sio from os import listdir from pick import pick import sklearn from sklearn.model_selection import train_test_split from default_params import num_classes from datetime import date # for automated SVM experiments base_path = "../data/animals/015/" op_date = date(2017, 3, 20) # ...
null
preprocessing_data.py
preprocessing_data.py
py
9,849
python
en
code
null
code-starcoder2
83
[ { "api_name": "datetime.date", "line_number": 12, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 20, "usage_type": "call" }, { "api_name": "scipy.io.loadmat", "line_number": 26, "usage_type": "call" }, { "api_name": "scipy.io", "line_number...
369235337
import autograd.numpy as np from autograd import grad from tdm.base.base import BaseEstimator from tdm.metrics.metrics import mean_squared_error class BaseRegression(BaseEstimator): def __init__(self, lr=0.01, penatly='None', C=0.01, tolerance=0.0001, max_iters=1000): self.C = C self.lr = lr ...
null
tdm/linear_model.py
linear_model.py
py
2,182
python
en
code
null
code-starcoder2
83
[ { "api_name": "tdm.base.base.BaseEstimator", "line_number": 5, "usage_type": "name" }, { "api_name": "autograd.numpy.random.normal", "line_number": 23, "usage_type": "call" }, { "api_name": "autograd.numpy.random", "line_number": 23, "usage_type": "attribute" }, { ...
232067299
############################################################################### # SKA South Africa (http://ska.ac.za/) # # Author: cam@ska.ac.za # # Copyright @ 2013 SKA SA. All rights reserved. # ...
null
katcp/test/test_resource_client.py
test_resource_client.py
py
49,897
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.getLogger", "line_number": 34, "usage_type": "call" }, { "api_name": "tornado.testing", "line_number": 37, "usage_type": "attribute" }, { "api_name": "tornado.concurrent.Future", "line_number": 39, "usage_type": "call" }, { "api_name": "torn...
441745577
#Same as previous exrecise, but employs scikit learn inbuilt RBF KPCA function from scipy.spatial.distance import pdist, squareform from scipy import exp from scipy.linalg import eigh import numpy as np import matplotlib.pyplot as plt from sklearn.datasets import make_moons from sklearn.decomposition import KernelPCA ...
null
tutorials/sebraex2.py
sebraex2.py
py
1,446
python
en
code
null
code-starcoder2
83
[ { "api_name": "sklearn.datasets.make_moons", "line_number": 11, "usage_type": "call" }, { "api_name": "sklearn.decomposition.KernelPCA", "line_number": 14, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 18, "usage_type": "call" }, { ...
331849879
# encoding:utf-8 from __future__ import print_function import sys import os import time import libvirt domxml = """<domain type='kvm'> <name>example</name> <memory>131072</memory> <vcpu>1</vcpu> <os> <type arch='x86_64' machine='pc-0.13'>hvm</type> </os> <devices> <disk type...
null
projects/openstack/libvirt/guide/blockjob_example.py
blockjob_example.py
py
1,862
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.system", "line_number": 26, "usage_type": "call" }, { "api_name": "libvirt.open", "line_number": 41, "usage_type": "call" }, { "api_name": "sys.stderr", "line_number": 43, "usage_type": "attribute" }, { "api_name": "sys.stderr", "line_number"...
424249046
import math from collections import Counter import cv2 import numpy as np frame_counter=0 kernel = np.ones((3,3), np.uint8) def rect_to_bb(rect): x = rect.left() y = rect.top() w = rect.right() - x h = rect.bottom() - y return x, y, w, h def distance(point1, point2): dist = math.sqrt((poi...
null
detecting_and_removing_green_color.py
detecting_and_removing_green_color.py
py
2,884
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.ones", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.uint8", "line_number": 9, "usage_type": "attribute" }, { "api_name": "math.sqrt", "line_number": 21, "usage_type": "call" }, { "api_name": "cv2.inRange", "line_number": ...
285753376
#!/usr/bin/python from log2chart.argparser import ArgParser from log2chart.loggingobject import LoggingObject from log2chart.moduleobjectproxy import ModuleObjectProxy from log2chart.renderer.registry import RendererParserRegistry, RendererRegistry import argparse import pkgutil import os class RendererObjectProxy(...
null
log2chart/renderer/factory.py
factory.py
py
2,963
python
en
code
null
code-starcoder2
83
[ { "api_name": "log2chart.moduleobjectproxy.ModuleObjectProxy", "line_number": 13, "usage_type": "name" }, { "api_name": "log2chart.renderer.registry.RendererParserRegistry", "line_number": 23, "usage_type": "argument" }, { "api_name": "log2chart.renderer.registry.RendererRegistry...
432779268
# -*- coding: utf-8 -*- """ Project : CoCoA Date : april-june 2020 Authors : Olivier Dadoun, Julien Browaeys, Tristan Beau Copyright ©CoCoa-team-17 License: See joint LICENSE file Module : cocoaplot About : An interface module to easily plot cocoa data with bokeh """ import random import math import pandas a...
null
cocoaplot/display.py
display.py
py
14,144
python
en
code
null
code-starcoder2
83
[ { "api_name": "bokeh.palettes", "line_number": 52, "usage_type": "attribute" }, { "api_name": "bokeh.models.HoverTool", "line_number": 53, "usage_type": "call" }, { "api_name": "cocoa.covid19.Parser", "line_number": 61, "usage_type": "call" }, { "api_name": "cocoa...
641837362
import os import json from flask import Flask import boto3 from werkzeug.utils import secure_filename from flask import request import tempfile def create_app(): app = Flask(__name__) services = json.loads(os.getenv("VCAP_SERVICES")) host = services["predix-blobstore"][0]["credentials"]["host"] if "h...
null
server/__init__.py
__init__.py
py
1,614
python
en
code
null
code-starcoder2
83
[ { "api_name": "flask.Flask", "line_number": 11, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 13, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 13, "usage_type": "call" }, { "api_name": "boto3.session.Session", "line_nu...
100688706
# memorandi.location.models # Models for the location metadata # # Author: Benjamin Bengfort <benjamin@bengfort.com> # Created: Tue Feb 11 14:41:06 2014 -0500 # # Copyright (C) 2014 Bengfort.com # For license information, see LICENSE.txt # # ID: models.py [] benjamin@bengfort.com $ """ Models for the location metad...
null
memorandi/location/models.py
models.py
py
6,769
python
en
code
null
code-starcoder2
83
[ { "api_name": "model_utils.models.TimeStampedModel", "line_number": 32, "usage_type": "name" }, { "api_name": "django.db.models.CharField", "line_number": 45, "usage_type": "call" }, { "api_name": "django.db.models", "line_number": 45, "usage_type": "name" }, { "a...
396369260
import numpy as np import matplotlib.pyplot as plt import sklearn import sklearn.datasets import sklearn.linear_model from planar_utils import plot_decision_boundary, sigmoid, load_planar_dataset, load_extra_datasets noisy_circles, noisy_moons, blobs, gaussian_quantiles, no_structure = load_extra_datasets() datasets ...
null
extra_datasets.py
extra_datasets.py
py
4,937
python
en
code
null
code-starcoder2
83
[ { "api_name": "planar_utils.load_extra_datasets", "line_number": 8, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.scatter", "line_number": 26, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 26, "usage_type": "name" }, { "api_n...
205159755
import json import os import ffmpy CONFIG_PATH = os.path.join(os.path.dirname(__file__), 'config.json') with open(CONFIG_PATH, 'r', encoding='utf-8') as f: CONFIG = json.load(f) def compression(source_file, input_file, quality, path_to_ffmpeg): if not path_to_ffmpeg: path_to_ffmpeg = CONFIG['ffmpeg'...
null
core.py
core.py
py
992
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.path.join", "line_number": 6, "usage_type": "call" }, { "api_name": "os.path", "line_number": 6, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 6, "usage_type": "call" }, { "api_name": "json.load", "line_number":...
562049240
## Initialization import asyncio import discord import youtube_dl from discord.ext import commands from common import config, embedMessage, ytdlSrc, category ## Class setup class play(commands.Cog): def __init__(self, bot): self.bot = bot ## Help stuff self.hidden = False self.cate...
null
cogs/Music/play.py
play.py
py
7,261
python
en
code
null
code-starcoder2
83
[ { "api_name": "discord.ext.commands.Cog", "line_number": 9, "usage_type": "attribute" }, { "api_name": "discord.ext.commands", "line_number": 9, "usage_type": "name" }, { "api_name": "common.category.getCategory", "line_number": 15, "usage_type": "call" }, { "api_...
295854624
from PIL.Image import open as im_open from requests import get from urllib.request import quote from re import search, findall from random import shuffle, choice from tool import process_img class Baidu(object): """ 百度 """ def __init__(self, father): self.father = father self.name = 'Baidu' ...
null
pyqt/wallpaper switcher/api/Baidu.py
Baidu.py
py
6,601
python
en
code
null
code-starcoder2
83
[ { "api_name": "random.choice", "line_number": 14, "usage_type": "call" }, { "api_name": "random.choice", "line_number": 24, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 27, "usage_type": "call" }, { "api_name": "urllib.request.quote", "...
204301336
""" rl environment By : ya0000000 2021/08/31 """ import numpy as np import os import math import time import inverseKinematics as IK from IK_FindOptSol import FindOptSol from robot_vrep import my_robot import config import cv2 as cv from yolo import * def creat_path(path): if path_exsit(path=path): print...
null
vrep/SAC_camera_version2/env_new2.py
env_new2.py
py
15,741
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.makedirs", "line_number": 23, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 25, "usage_type": "call" }, { "api_name": "os.path", "line_number": 25, "usage_type": "attribute" }, { "api_name": "math.pi", "line_number": ...
565126991
#!/usr/bin/python3 from base import * from tag import * import yaml import datetime import re class Solution(): """.""" def __init__(self, file): file = Path(file) self.path = file self.oj, self.id, self.name = file.with_suffix( '').name.split(' ', maxsplit=2) ...
null
Python/myblog/lib/script/solution.py
solution.py
py
2,970
python
en
code
null
code-starcoder2
83
[ { "api_name": "datetime.datetime.utcfromtimestamp", "line_number": 21, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 21, "usage_type": "attribute" }, { "api_name": "yaml.load", "line_number": 33, "usage_type": "call" } ]
570591905
################################################################# ######################## CODE FIGURE 4 BN ###################### ################################################################# # Run with passing number of hidden layers as argument import numpy as np import torch import torch.nn as nn import n...
null
code_fig_4_bn.py
code_fig_4_bn.py
py
7,334
python
en
code
null
code-starcoder2
83
[ { "api_name": "torch.cuda", "line_number": 22, "usage_type": "attribute" }, { "api_name": "torch.cuda", "line_number": 23, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 24, "usage_type": "attribute" }, { "api_name": "numpy.ones", "line_...
150098585
from backbones.resnet_fpn import ResNetFPN from backbones.resnet import ResNet from heads.cls_bbox import ClsBBoxHead_fc as ClsBBoxHead from heads.mask import MaskHead from tools.detect_utils import calc_iou, bbox_corner2center, bbox_center2corner from proposal.rpn import RPN from pooling.roi_align import RoiAlign from...
null
maskrcnn.py
maskrcnn.py
py
26,912
python
en
code
null
code-starcoder2
83
[ { "api_name": "torch.nn.Module", "line_number": 19, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 19, "usage_type": "name" }, { "api_name": "configparser.ConfigParser", "line_number": 43, "usage_type": "call" }, { "api_name": "os.path.abspa...
127277110
import json def total_score(j): sum=0 parsed=json.loads(j) for key, value in parsed.items(): sum+=value data={} data["total_score"]=sum return json.dumps(data) #return data ? why not? print(total_score('{"john": 10, "steve": 31}'))
null
S17week2/JSON.py
JSON.py
py
273
python
en
code
null
code-starcoder2
83
[ { "api_name": "json.loads", "line_number": 4, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 9, "usage_type": "call" } ]
39253422
from bs4 import BeautifulSoup import urllib.request import re def crawl(start_page, distance, action): visited = set() queue = [[start_page, distance]] def getLinks(url): try: html_page = urllib.request.urlopen(url) except urllib.error.HTTPError as e: return [] ...
null
zima2019/RozszerzonyPython/Lista6/zadanie1.py
zadanie1.py
py
1,550
python
en
code
null
code-starcoder2
83
[ { "api_name": "urllib.request.request.urlopen", "line_number": 9, "usage_type": "call" }, { "api_name": "urllib.request.request", "line_number": 9, "usage_type": "attribute" }, { "api_name": "urllib.request", "line_number": 9, "usage_type": "name" }, { "api_name":...
509837062
import os import sys import json import pydoc import datetime import psycopg2 from tabulate import tabulate from argparse import ArgumentParser REPORT = """\n\n\n\n\n\n==================================ORDER================================== order-id: {orderId} billAmount: {billAmount} status: {status} timestamp: {ts}...
null
orderwise.py
orderwise.py
py
3,446
python
en
code
null
code-starcoder2
83
[ { "api_name": "tabulate.tabulate", "line_number": 43, "usage_type": "call" }, { "api_name": "datetime.date.today", "line_number": 61, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 61, "usage_type": "attribute" }, { "api_name": "os.path.join...