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
421992747
# -*- coding: utf-8 -*- """ Created on Tue Aug 02 13:49:45 2016 Theta-Gamma Coupling model @author: Vlastimil Koudelka """ import numpy as np import matplotlib.pyplot as plt import scipy.signal as sig import scipy.stats as stat plt.close('all') fs = 250 #samplerate [Hz] T = 1.0/fs #sampling period [s] dur = 2 ...
null
V2_Phase_amplitude_coupling.py
V2_Phase_amplitude_coupling.py
py
2,353
python
en
code
null
code-starcoder2
66
[ { "api_name": "matplotlib.pyplot.close", "line_number": 13, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 13, "usage_type": "name" }, { "api_name": "numpy.round", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.linspace"...
280076009
from rest_framework import renderers from datetime import datetime from docx import Document from docx.shared import Pt from docx.shared import Inches from io import BytesIO from localflavor.us import us_states from django.conf import settings from rest_framework_csv.renderers import CSVRenderer import re from docx.sha...
null
cbrsservices/renderers.py
renderers.py
py
24,186
python
en
code
null
code-starcoder2
66
[ { "api_name": "rest_framework_csv.renderers.CSVRenderer", "line_number": 14, "usage_type": "name" }, { "api_name": "rest_framework_csv.renderers.CSVRenderer", "line_number": 22, "usage_type": "name" }, { "api_name": "rest_framework_csv.renderers.CSVRenderer", "line_number": 1...
518441446
# -*- coding: utf-8 -*- """ Language Identification Server Uses langid.py to identify the language of a text. Able to distinguish Brazilian Portuguese from European Portuguese, Latin America Spanish from Peninsular Spanish and Simplified Chinese from Traditional Chinese Usage ----- Try out a demo at: http://langi...
null
setup.py
setup.py
py
1,352
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.abspath", "line_number": 22, "usage_type": "call" }, { "api_name": "os.path", "line_number": 22, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 23, "usage_type": "call" }, { "api_name": "os.path", "line_numb...
564933297
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. from typing import List from msrest.serialization import Model from .metadata import Metadata from .qna_request_context import QnARequestContext from .ranker_types import RankerTypes class GenerateAnswerRequestBody(Model)...
null
libraries/botbuilder-ai/botbuilder/ai/qna/models/generate_answer_request_body.py
generate_answer_request_body.py
py
2,178
python
en
code
null
code-starcoder2
66
[ { "api_name": "msrest.serialization.Model", "line_number": 13, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 32, "usage_type": "name" }, { "api_name": "metadata.Metadata", "line_number": 32, "usage_type": "name" }, { "api_name": "qna_request_...
48418649
from pymongo import MongoClient import collections import re import sys import numpy as np import pandas as pd import datetime from categories import * from numpy import array import keras from keras.models import Sequential from keras.layers import Dense,Conv1D,GlobalMaxPooling1D #from pos_tagging import * import mult...
null
personalisation/keras/model_generator_tags.py
model_generator_tags.py
py
16,569
python
en
code
null
code-starcoder2
66
[ { "api_name": "time.time", "line_number": 21, "usage_type": "call" }, { "api_name": "time.time", "line_number": 23, "usage_type": "call" }, { "api_name": "pymongo.MongoClient", "line_number": 29, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 5...
135634638
from .os_utils import os, maybe_add_slash import warnings from tqdm import tqdm from utilities import s3_util as s3u with warnings.catch_warnings(): warnings.simplefilter("ignore") import pandas as pd S3_REFERENCE = {"east": "czbiohub-reference-east", "west": "czbiohub-reference"} SAMPLE_R...
null
aguamenti/s3_utils.py
s3_utils.py
py
2,402
python
en
code
null
code-starcoder2
66
[ { "api_name": "warnings.catch_warnings", "line_number": 9, "usage_type": "call" }, { "api_name": "warnings.simplefilter", "line_number": 10, "usage_type": "call" }, { "api_name": "os_utils.maybe_add_slash", "line_number": 40, "usage_type": "call" }, { "api_name": ...
91966719
# coding: utf-8 import argparse import time import math import os, sys import torch from data_utils import get_lm_corpus from models.mem_transformer import MemTransformerLM from utils.exp_utils import get_logger from inference.translator import Translator import copy parser = argparse.ArgumentParser(description='Gen...
null
pytorch/generate_beam_search.py
generate_beam_search.py
py
6,751
python
en
code
null
code-starcoder2
66
[ { "api_name": "argparse.ArgumentParser", "line_number": 15, "usage_type": "call" }, { "api_name": "torch.device", "line_number": 65, "usage_type": "call" }, { "api_name": "utils.exp_utils.get_logger", "line_number": 68, "usage_type": "call" }, { "api_name": "os.pa...
304844181
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Classes to abstract 2D pose and orientation using matrices in SE(2) and SO(2) To use:: from spatialmath.pose2d import * T = SE2(1, 2, 0.3) import spatialmath as sm T = sm.SE2.Rx(1, 2, 0.3) .. inheritance-diagram:: spatialmath.pose3d :top-clas...
null
spatialmath/pose2d.py
pose2d.py
py
17,320
python
en
code
null
code-starcoder2
66
[ { "api_name": "spatialmath.baseposematrix.BasePoseMatrix", "line_number": 34, "usage_type": "name" }, { "api_name": "spatialmath.base.t2r", "line_number": 78, "usage_type": "call" }, { "api_name": "spatialmath.base", "line_number": 78, "usage_type": "name" }, { "a...
170652995
"""Script for running inference on a collection of new images. For information on required arguments, please see the README or run: python run_inference.py -h NOTE: Server must be launched before running this script. """ import argparse import csv import glob import os import requests import time def main(args): ...
null
bin/run_inference.py
run_inference.py
py
2,058
python
en
code
null
code-starcoder2
66
[ { "api_name": "time.time", "line_number": 18, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 21, "usage_type": "call" }, { "api_name": "os.path", "line_number": 21, "usage_type": "attribute" }, { "api_name": "glob.glob", "line_number": ...
111391783
import pandas as pd import random import dash import dash_bootstrap_components as dbc import dash_core_components as dcc import dash_html_components as html from finb.analyzer.ui.app import application from dash.dependencies import Input, Output, MATCH, State from dash.exceptions import PreventUpdate from finb.analyze...
null
finb/analyzer/ui/tabs/COGS_compare/COGS_compare.py
COGS_compare.py
py
4,015
python
en
code
null
code-starcoder2
66
[ { "api_name": "dash_bootstrap_components.Container", "line_number": 21, "usage_type": "call" }, { "api_name": "dash_bootstrap_components.Row", "line_number": 22, "usage_type": "call" }, { "api_name": "dash_html_components.H5", "line_number": 22, "usage_type": "call" }, ...
188826685
import subprocess from datetime import datetime import pandas as pd from feast import FeatureStore from feast.data_source import PushMode def run_demo(): store = FeatureStore(repo_path=".") print("\n--- Run feast apply to setup feature store on Postgres ---") subprocess.run(["feast", "apply"]) prin...
null
sdk/python/feast/templates/postgres/feature_repo/test_workflow.py
test_workflow.py
py
4,413
python
en
code
null
code-starcoder2
66
[ { "api_name": "feast.FeatureStore", "line_number": 11, "usage_type": "call" }, { "api_name": "subprocess.run", "line_number": 13, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 22, "usage_type": "call" }, { "api_name": "datetime.date...
455467279
import cv2 import sys import os if len(sys.argv) != 4: print("Usage: python {} hoge.wmv output_dir out_file_prefix".format(sys.argv[0])) exit(0) cap = cv2.VideoCapture(sys.argv[1]) if cap.isOpened() == False: print("failed to open {}".format(sys.argv[1])) exit(0) print("opened {}".format(sys.argv[1])) dir = sys...
null
read_image_from_wmv.py
read_image_from_wmv.py
py
1,185
python
en
code
null
code-starcoder2
66
[ { "api_name": "sys.argv", "line_number": 5, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 6, "usage_type": "attribute" }, { "api_name": "cv2.VideoCapture", "line_number": 9, "usage_type": "call" }, { "api_name": "sys.argv", "line_number...
362447460
import numpy as np from scipy.special import logsumexp def phred_scale(prob, max_val=100): assert 0 <= prob <= 1, f'invalid probability: {prob}' return int(round(np.clip(-10 * np.log10(prob), 0, max_val))) def log2_to_phred_scale(log2_prob, max_val=100): return int(round(np.clip(-10 * log2_prob / np.log...
null
fbio/stats/stats_utils.py
stats_utils.py
py
1,341
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.clip", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.log10", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.clip", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.log10", "line_number": 11, ...
63298650
from django import template from django.db.models import Count from django.db.models.functions import * from myBlog import models register = template.Library() @register.inclusion_tag("class_tag.html") def get_classification_style(username): article_list = models.Article.objects.filter(user__username=username) use...
null
Blog/myBlog/templatetags/my_tags.py
my_tags.py
py
923
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.template.Library", "line_number": 6, "usage_type": "call" }, { "api_name": "django.template", "line_number": 6, "usage_type": "name" }, { "api_name": "myBlog.models.Article.objects.filter", "line_number": 11, "usage_type": "call" }, { "api_na...
643669997
import MySQLdb db=MySQLdb.connect( host="127.0.0.1", user="root", database="test" ) cursor=db.cursor() print(cursor) #cursor.execute("CREATE TABLE user (Id INT, Name VARCHAR(255), address VARCHAR(255), Phone INT)") # query="INSERT INTO user (Id, Name, address, Phone) values(%s, %s,%s,%s)" # values=[(1,"abh...
null
python/myqueses.py
myqueses.py
py
1,094
python
en
code
null
code-starcoder2
66
[ { "api_name": "MySQLdb.connect", "line_number": 3, "usage_type": "call" } ]
338473206
import datetime import os import random import string import warnings import pandas as pd from dagster import ( Array, AssetKey, EventMetadata, EventMetadataEntry, ExperimentalWarning, Field, ModeDefinition, Output, OutputDefinition, Partition, PartitionSetDefinition, pi...
null
python_modules/dagster-test/dagster_test/toys/asset_lineage.py
asset_lineage.py
py
5,391
python
en
code
null
code-starcoder2
66
[ { "api_name": "warnings.filterwarnings", "line_number": 26, "usage_type": "call" }, { "api_name": "dagster.ExperimentalWarning", "line_number": 26, "usage_type": "name" }, { "api_name": "datetime.date", "line_number": 31, "usage_type": "call" }, { "api_name": "dat...
538513611
from django.http import JsonResponse, HttpResponseServerError from rest_framework.views import APIView from d2Result.surveyViews.utils.check_and_aggregate import CheckAndAggregate from d2Result.models import d2ResultModel from pymongo_aggregate.aggregate_rule import AggregateRule import logging logger = logging.getLog...
null
d2_client/d2Result/surveyViews/inclinationView.py
inclinationView.py
py
2,643
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 7, "usage_type": "call" }, { "api_name": "rest_framework.views.APIView", "line_number": 10, "usage_type": "name" }, { "api_name": "d2Result.surveyViews.utils.check_and_aggregate.CheckAndAggregate", "line_number": 13, "usag...
586096053
#%% Imports import os import nltk import tqdm import codecs import pickle import pandas as pd #from sklearn.feature_extraction.text import CountVectorizer #%% Path definition base_folder = os.getcwd() input_folder = os.path.join(base_folder, '01_data', '01_preprocessed') output_path = os.path.join(base_folder, '01_da...
null
00_old_versions/02_generate_corpus_v0.py
02_generate_corpus_v0.py
py
2,659
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.getcwd", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path", "line_number": 13, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number":...
547316423
import logging import pathlib from typing import Union, List from .exceptions import * def check_path(path: pathlib.Path, logger: logging.Logger) -> pathlib.Path: if not isinstance(path, pathlib.Path): try: path = pathlib.Path(path) except Exception as e: msg = f"Unhandled ...
null
net_parser/utils/common.py
common.py
py
2,682
python
en
code
null
code-starcoder2
66
[ { "api_name": "pathlib.Path", "line_number": 7, "usage_type": "attribute" }, { "api_name": "logging.Logger", "line_number": 7, "usage_type": "attribute" }, { "api_name": "pathlib.Path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "pathlib.Path", ...
220524507
from selenium import webdriver import time driver = webdriver.Chrome(r'C:\Users\hello\Desktop\chromedriver.exe') driver.get('https://www.jsonline.com/search/opioid/') SCROLL_PAUSE_TIME = 3.0 # Get scroll height last_height = driver.execute_script("return document.body.scrollHeight") i=1 while i<10: # Scroll do...
null
MSJ/MO/zeyu_code_MSJO2.py
zeyu_code_MSJO2.py
py
1,304
python
en
code
null
code-starcoder2
66
[ { "api_name": "selenium.webdriver.Chrome", "line_number": 4, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 4, "usage_type": "name" }, { "api_name": "time.sleep", "line_number": 26, "usage_type": "call" } ]
18873480
from sys import stdout as console from random import randint, sample import argparse def sub_file_write(location,data): with open('data/substitutions10mill/' + location,'a') as f: f.write(data + '\n') def to_byte_fromint(string): split_byte = string.split('0b') padded_byte = ''.join( [''.join(['0' for i in ran...
null
generate-data/py-scripts/old_20170901/substitution_p-r-c_gen.py
substitution_p-r-c_gen.py
py
2,448
python
en
code
null
code-starcoder2
66
[ { "api_name": "random.sample", "line_number": 24, "usage_type": "call" }, { "api_name": "sys.stdout.write", "line_number": 36, "usage_type": "call" }, { "api_name": "sys.stdout", "line_number": 36, "usage_type": "name" }, { "api_name": "sys.stdout.flush", "lin...
444502939
import logging import tornado.escape import tornado.ioloop import tornado.options import tornado.web import tornado.websocket import uuid from tornado.web import authenticated,RequestHandler import redis import _ctypes from .main import Base class ChatHandler(Base): """ 聊天室 """ @authenticated def...
null
handlers/chat.py
chat.py
py
2,308
python
en
code
null
code-starcoder2
66
[ { "api_name": "main.Base", "line_number": 15, "usage_type": "name" }, { "api_name": "tornado.web.authenticated", "line_number": 19, "usage_type": "name" }, { "api_name": "tornado.escape.websocket", "line_number": 23, "usage_type": "attribute" }, { "api_name": "tor...
335280565
# ***************************************************************************** # © Copyright IBM Corp. 2021. All Rights Reserved. # # This program and the accompanying materials # are made available under the terms of the Apache V2.0 # which accompanies this distribution, and is available at # http://www.apache.org/l...
null
scripts/test_AMPQPreload.py
test_AMPQPreload.py
py
5,887
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 18, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 32, "usage_type": "call" }, { "api_name": "azure.amqp_receiver.add_iothub_args", "line_number": 41, "usage_type": "call" }, { "api...
455650215
import json import bs4 from .parser import Parser class ProblemListParser(Parser): """ [ {'username': 'user1', 'nickname': 'nick', 'school': 'myschool', 'solved': 0}, {'username': 'user2', 'nickname': 'nick2', 'school': None, 'solved': 2}, ... ] """ def parse(self, respon...
null
vjudge_interface/parsers/problem_list_parser.py
problem_list_parser.py
py
1,384
python
en
code
null
code-starcoder2
66
[ { "api_name": "parser.Parser", "line_number": 7, "usage_type": "name" }, { "api_name": "json.loads", "line_number": 19, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 26, "usage_type": "call" } ]
287262233
#!/usr/bin/env python3 # jimk: remote machines need the above line when building console scripts which will # be installed on machines which also require python 2 in their path from setuptools import setup, find_packages console_scripts = ['manifestforwork = v_m_t.manifestforwork:manifestShell', 'ma...
null
setup.py
setup.py
py
1,048
python
en
code
null
code-starcoder2
66
[ { "api_name": "setuptools.setup", "line_number": 8, "usage_type": "call" }, { "api_name": "setuptools.find_packages", "line_number": 8, "usage_type": "call" } ]
350434956
#!/usr/bin/env python # -*- coding: utf-8 -*- # ** # # ================= # # QI_WORKER # # ================= # # Abstract worker class # # @author ES # ** import logging import time from data_manager.controller.db_stream_controller import DBStreamController from es_common.enums.robot_enums import RobotName from robot...
null
robot_manager/worker/qi/qi_worker.py
qi_worker.py
py
4,052
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 23, "usage_type": "call" }, { "api_name": "data_manager.controller.db_stream_controller.DBStreamController", "line_number": 31, "usage_type": "call" }, { "api_name": "robot_manager.handler.qi.connection_handler.ConnectionHandler.c...
503078261
# -*- coding: utf-8 -*- ''' Created on 2015/01/25 @OriginAuthor: samuraitaiga @ModifiedBy: LuizeraSD ''' import logging import os import hashlib import shutil import requests import re import json import base64 from mt4 import get_mt4 from mt4 import DEFAULT_MT4_NAME from __builtin__ import str class BackTest(obje...
null
metatrader/backtest.py
backtest.py
py
18,223
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.split", "line_number": 61, "usage_type": "call" }, { "api_name": "os.path", "line_number": 61, "usage_type": "attribute" }, { "api_name": "mt4.get_mt4", "line_number": 68, "usage_type": "call" }, { "api_name": "mt4.DEFAULT_MT4_NAME", "li...
383902233
import requests from time import sleep class WebFamous(): def __init__(self, url): self.url = 'https://channel9.msdn.com/Blogs/Microsoft-Student-Partner-Spain/Reto-2-Crea-tu-backend-con-WebAPI/player#autoplay' self.r = requests.get(url) def get_request(self): return self.r ...
null
web_famous.py
web_famous.py
py
1,120
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.get", "line_number": 9, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 39, "usage_type": "call" }, { "api_name": "requests.codes", "line_number": 42, "usage_type": "attribute" } ]
73185801
# -*- coding: utf-8 -*- """ Created on Thu Oct 22 11:58:47 2020 @author: Pauline """ import numpy as np import matplotlib.pyplot as plt from numpy.fft import rfft,irfft,fft,ifft def gaussian(x, mu, sig): return np.exp(-(x - mu)**2 / (2 * sig**2)) def roll(array,n): N=len(array) k=np.arange(N) retur...
null
Assignment4/hw4.py
hw4.py
py
1,817
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.exp", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.arange", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.real", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.fft.ifft", "line_number":...
598773710
#!/usr/bin/env python3 import extra import pandas as pd import sys import numpy as np import matplotlib.pyplot as plt # Get all pw.x output data from given path # Find en tot, cutoff, cpu time # Save pandas dataframe in plot_data.txt def prepare(argv): input_path = argv[0] flist = special_scan(input_path) ...
null
es2/all_plotter.py
all_plotter.py
py
5,023
python
en
code
null
code-starcoder2
66
[ { "api_name": "pandas.DataFrame", "line_number": 16, "usage_type": "call" }, { "api_name": "extra.scanner", "line_number": 122, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.subplots", "line_number": 138, "usage_type": "call" }, { "api_name": "matplotli...
107535582
import json import pandas as pd import codecs import sys import os import argparse import logging parser = argparse.ArgumentParser(description='Process instagam message.json files to csv') parser.add_argument('--f', help='filepath to the JSON messages.json downladed from instagram',required=True) parser.add_argument...
null
processJSON.py
processJSON.py
py
2,140
python
en
code
null
code-starcoder2
66
[ { "api_name": "argparse.ArgumentParser", "line_number": 11, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 14, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 16, "usage_type": "call" }, { "api_name": "codecs.op...
473183107
from calc_add_unusual_amino import Add from PyQt5 import QtCore, QtGui, QtWidgets from Error_dialog_window import Ui_Frame from Information_dialog_window import Ui_Frame_i class Ui_AddUnusualAminoAcid(object): def setupUi(self, MainWindow): MainWindow.setObjectName("MainWindow") MainWindow.resize(...
null
Add_unusual_amino_acid_dialog_window.py
Add_unusual_amino_acid_dialog_window.py
py
5,846
python
en
code
null
code-starcoder2
66
[ { "api_name": "PyQt5.QtCore.QSize", "line_number": 11, "usage_type": "call" }, { "api_name": "PyQt5.QtCore", "line_number": 11, "usage_type": "name" }, { "api_name": "PyQt5.QtCore.QSize", "line_number": 12, "usage_type": "call" }, { "api_name": "PyQt5.QtCore", ...
200413897
""" handles parsing text and running the command specified from it then gets the string to pass back to slack """ import logging import random import re import json import request_helper as request def get_return_text(raw_text, message_user): """ Returns the response we are giving to slack :raw_text the r...
null
lisa_commands/commands.py
commands.py
py
6,791
python
en
code
null
code-starcoder2
66
[ { "api_name": "re.search", "line_number": 30, "usage_type": "call" }, { "api_name": "request_helper.anime_news_network_search", "line_number": 67, "usage_type": "call" }, { "api_name": "request_helper.youtube_search", "line_number": 70, "usage_type": "call" }, { "...
407004850
# -*- coding: UTF-8 -*- """ Project -> File: tempe -> run Author: PMR Date: 2021/9/1 9:22 Desc: 内测版本 """ import gc import pandas as pd from pathlib import Path from condition_category import ConditionCategory from all_dataset_condition_category_mean import AllDatasetConditionCategoryMean from prediction_m...
null
run.py
run.py
py
9,181
python
en
code
null
code-starcoder2
66
[ { "api_name": "condition_category.ConditionCategory", "line_number": 18, "usage_type": "call" }, { "api_name": "all_dataset_condition_category_mean.AllDatasetConditionCategoryMean", "line_number": 19, "usage_type": "call" }, { "api_name": "prediction_model.PredictionModel", "...
367990286
from django.urls import path from payment import views app_name = "payment" urlpatterns = [ path("cart/", views.payment_cart, name="cart"), path("purchase/", views.payment_purchase, name="purchase"), path("results/", views.payment_complete, name="results"), ]
null
payment/urls.py
urls.py
py
275
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.urls.path", "line_number": 8, "usage_type": "call" }, { "api_name": "payment.views.payment_cart", "line_number": 8, "usage_type": "attribute" }, { "api_name": "payment.views", "line_number": 8, "usage_type": "name" }, { "api_name": "django.ur...
337670590
#!/usr/bin/env python import argparse import json from pathlib import Path from warnings import warn import shutil import tempfile import random from collections import defaultdict import numpy as np from itertools import permutations import mrt.e2e.mr_utils import mrt.viggo.mr_utils from mrt.dialog_planner.bglm impo...
null
scripts/data_preprocessing/add_simple_orders.py
add_simple_orders.py
py
9,253
python
en
code
null
code-starcoder2
66
[ { "api_name": "mrt.e2e.mr_utils.e2e", "line_number": 21, "usage_type": "attribute" }, { "api_name": "mrt.e2e.mr_utils", "line_number": 21, "usage_type": "name" }, { "api_name": "mrt.e2e.mr_utils.viggo", "line_number": 23, "usage_type": "attribute" }, { "api_name":...
26494578
#!/usr/bin/env python # -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # ---------------------------------------------...
null
eventhubs/examples/recv.py
recv.py
py
1,910
python
en
code
null
code-starcoder2
66
[ { "api_name": "eventhubs.EventData.offset", "line_number": 30, "usage_type": "call" }, { "api_name": "eventhubs.EventData", "line_number": 30, "usage_type": "name" }, { "api_name": "eventhubs.EventData.sequence_number", "line_number": 31, "usage_type": "call" }, { ...
538922211
""" _ |_|_ _ | | _|_|_|_|_ |_|_|_|_|_|_ |_|_|_|_|_| | | |_| |_|_ |_| Author: Souham Biswas Website: https://www.linkedin.com/in/souham/ """ import json import os import time from datetime import datetime from glob import glob import tensorflow as tf # if int(tf.__version__.split('.')[0]) >...
null
nets_v2/nn.py
nn.py
py
29,294
python
en
code
null
code-starcoder2
66
[ { "api_name": "tensorflow.keras.utils.Sequence", "line_number": 38, "usage_type": "name" }, { "api_name": "tensorflow.keras", "line_number": 51, "usage_type": "attribute" }, { "api_name": "glob.glob", "line_number": 57, "usage_type": "call" }, { "api_name": "utils...
215309127
#!/usr/bin/env python import os import sys import argparse import codecs import logging import time import math import operator import pickle logger_freq = 2 logger_timestamp = time.time() logger = logging.getLogger(__file__) logging.getLogger().handlers = [] def log_major(message): global logger_timestamp logg...
null
Align/apply_tree.py
apply_tree.py
py
7,192
python
en
code
null
code-starcoder2
66
[ { "api_name": "time.time", "line_number": 15, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 16, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 17, "usage_type": "call" }, { "api_name": "time.time", "line_n...
557627742
import datetime import enum import pandas as pd import sqlalchemy from panormus.data.bo.db_engine import (get_credentials, DB_CREDS_DIR, PostgresEngine) class oDataDimension(enum.Enum): items = "items" attributes = "attributes" cuts = "cuts" sources = "sources" def get_instance_using_credentials(f...
null
Caxton/JY_Completed/panormus/quant/data/bo/disco_daily.py
disco_daily.py
py
12,935
python
en
code
null
code-starcoder2
66
[ { "api_name": "enum.Enum", "line_number": 10, "usage_type": "attribute" }, { "api_name": "panormus.data.bo.db_engine.DB_CREDS_DIR", "line_number": 17, "usage_type": "name" }, { "api_name": "panormus.data.bo.db_engine.get_credentials", "line_number": 26, "usage_type": "cal...
638386449
from seamless.qt.QtWidgets import QTextEdit, QWidget, QVBoxLayout from seamless.qt.QtCore import Qt from PyQt5.QtGui import QColor import json w = QWidget() #w.setWindowFlags(Qt.WindowStaysOnTopHint) w.setAttribute(Qt.WA_ShowWithoutActivating) vbox = QVBoxLayout() #vbox.addStretch(1) w.resize(600,600) w.setLayout(vbox...
null
OLD/lib/gui/cell-basic_editor_json.py
cell-basic_editor_json.py
py
712
python
en
code
null
code-starcoder2
66
[ { "api_name": "seamless.qt.QtWidgets.QWidget", "line_number": 6, "usage_type": "call" }, { "api_name": "seamless.qt.QtCore.Qt.WA_ShowWithoutActivating", "line_number": 8, "usage_type": "attribute" }, { "api_name": "seamless.qt.QtCore.Qt", "line_number": 8, "usage_type": "...
60645917
""" Functions that act on the Spatial Fourier Coefficients `FFT` (Fast) Fourier Transform `iFFT` Inverse (Fast) Fourier Transform `spatFT` Spatial Fourier Transform `iSpatFT` Fast Inverse Spatial Fourier Transform `PWDecomp` Plane Wave Decomposition """ import numpy as _np from scipy.linalg import ls...
null
sound_field_analysis/process.py
process.py
py
16,584
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.atleast_2d", "line_number": 102, "usage_type": "call" }, { "api_name": "numpy.ceil", "line_number": 121, "usage_type": "call" }, { "api_name": "numpy.log2", "line_number": 121, "usage_type": "call" }, { "api_name": "numpy.fft.rfft", "line_...
106177895
import discord from discord.ext import commands import os from pymongo import MongoClient TOKEN = os.environ["TOKEN"] MONG0 = "mongodb+srv://eyzenhart:H0ZFBDMfmSQqS3qe@cluster0.ngjuw.mongodb.net/ezequiel?retryWrites=true&w=majority" PREFIX = ("?", "!") INTENTS = discord.Intents().all() client = commands.Bot(command_p...
null
bot.py
bot.py
py
2,625
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.environ", "line_number": 6, "usage_type": "attribute" }, { "api_name": "discord.Intents", "line_number": 9, "usage_type": "call" }, { "api_name": "discord.ext.commands.Bot", "line_number": 11, "usage_type": "call" }, { "api_name": "discord.ext.co...
195984773
import sys import time import json import random import asyncio import aiohttp import requests import traceback from utils.dao import redis_cache, LTUserSettings, StormGiftBlackRoom, DelayAcceptGiftsMQ from config import cloud_acceptors from utils.mq import mq_raffle_to_acceptor from utils.highlevel_api import DBCookie...
null
lt/lt_acceptor.py
lt_acceptor.py
py
8,410
python
en
code
null
code-starcoder2
66
[ { "api_name": "asyncio.Queue", "line_number": 20, "usage_type": "call" }, { "api_name": "aiohttp.ClientSession", "line_number": 24, "usage_type": "call" }, { "api_name": "aiohttp.ClientTimeout", "line_number": 24, "usage_type": "call" }, { "api_name": "time.time",...
133133175
import os import csv import pandas as pd import numpy from inference_schema.schema_decorators import input_schema from inference_schema.parameter_types.numpy_parameter_type import NumpyParameterType from azure.storage.blob import BlockBlobService from sklearn.preprocessing import StandardScaler from sklearn.externals ...
null
Pipeline/deployment/score.py
score.py
py
2,809
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.environ", "line_number": 21, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 22, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 23, "usage_type": "attribute" }, { "api_name": "os.environ", "lin...
339989915
import discord import threading import os import re import logging import collections import copy import asyncio import math import time import inspect import datetime import aiohttp import random import string import imdbpie from imdbpie import Imdb from .utils import checks from .utils.chat_formatting import pagify, ...
null
movie.py
movie.py
py
15,493
python
en
code
null
code-starcoder2
66
[ { "api_name": "discord.Client", "line_number": 34, "usage_type": "call" }, { "api_name": "cogs.utils.dataIO.dataIO.load_json", "line_number": 47, "usage_type": "call" }, { "api_name": "cogs.utils.dataIO.dataIO", "line_number": 47, "usage_type": "name" }, { "api_na...
77662514
import requests from bs4 import BeautifulSoup raw = requests.get("https://tv.naver.com/r") html = BeautifulSoup(raw.text, "html.parser") # 1위 - 100위 컨테이너 선택자: dl.cds_info clips = html.select("dl.cds_info") for cl in clips: # 수정된 부분 title = cl.select_one("dt.title").text.strip() chn = cl.select_one("dd.c...
null
crawling/3.2.csv_2.py
3.2.csv_2.py
py
570
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.get", "line_number": 5, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 6, "usage_type": "call" } ]
121570039
import torch import numpy as np import random from collections import namedtuple, deque from torch.nn.utils.clip_grad import clip_grad_norm_ import torch.nn.functional as F import torch.optim as optim from A2C_Model import Advantage_Actor_Critic # from A2C_Model import A2C_nn class Agent(): def __init__...
null
A2C/A2C_Agent.py
A2C_Agent.py
py
6,687
python
en
code
null
code-starcoder2
66
[ { "api_name": "random.seed", "line_number": 29, "usage_type": "call" }, { "api_name": "A2C_Model.Advantage_Actor_Critic", "line_number": 31, "usage_type": "call" }, { "api_name": "torch.optim.Adam", "line_number": 33, "usage_type": "call" }, { "api_name": "torch.o...
508187958
# -*- coding: utf-8 -*- from Acquisition import aq_inner from zope.component import getMultiAdapter from zope.interface import implements from plone.app.layout.navigation.interfaces import INavtreeStrategy from plone.app.layout.navigation.navtree import buildFolderTree from plone.app.layout.navigation.root import get...
null
src/observatorio/tema/browser/viewlets/dropdown.py
dropdown.py
py
4,950
python
en
code
null
code-starcoder2
66
[ { "api_name": "Products.CMFPlone.browser.navtree.NavtreeQueryBuilder", "line_number": 29, "usage_type": "name" }, { "api_name": "Products.CMFPlone.browser.navtree.NavtreeQueryBuilder.__init__", "line_number": 34, "usage_type": "call" }, { "api_name": "Products.CMFPlone.browser.na...
49618977
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from pyquery import PyQuery as pq import requests import time import sys import os # self.url = 'http://classair.dhu.edu.cn/mhs.php/Mhs/' class SignIn(object): def __init__(self, arg): self.id = arg if os.path.exists("qiubolog.txt"): self.fi...
null
qiubo.py
qiubo.py
py
6,550
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.exists", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path", "line_number": 12, "usage_type": "attribute" }, { "api_name": "requests.Session", "line_number": 18, "usage_type": "call" }, { "api_name": "pyquery.PyQuery", "l...
232884010
import requests import re headers = { 'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.87 Safari/537.36' } r = requests.get('http://www.dyyy120.com',headers=headers) # print(r.cookies) for key, value in r.cookies.items(): print(key + "=" + value)
null
requests-demo/requests-cookies.py
requests-cookies.py
py
320
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.get", "line_number": 8, "usage_type": "call" } ]
279259438
import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns from sklearn.model_selection import train_test_split from sklearn.linear_model import LinearRegression # load a new data set dataset = pd.read_csv("./housing.csv") # data pre-processing dataset.dropna(inplace=True) # initial...
null
data_processing.py
data_processing.py
py
1,376
python
en
code
null
code-starcoder2
66
[ { "api_name": "pandas.read_csv", "line_number": 9, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 41, "usage_type": "call" }, { "api_name": "sklearn.model_selection.train_test_split", "line_number": 44, "usage_type": "call" }, { "api_name...
281147715
""" From Daphne Stam Plots grid of polarization from pixels.out files """ import matplotlib.pyplot as plt import numpy as np import math # Change the file name if needed: name = raw_input('Name of .out file (without ".out")') filein= name+".out" # Determine the number of pixels: xyz= np.loadtxt(filein) x = xyz[:,0] y...
null
bin/aerx/plot_disk.py
plot_disk.py
py
1,484
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.loadtxt", "line_number": 14, "usage_type": "call" }, { "api_name": "math.sqrt", "line_number": 18, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.subplots", "line_number": 21, "usage_type": "call" }, { "api_name": "matplotlib.pyplot"...
153605851
import os import sys import json from django.core.management.utils import get_random_secret_key def patch_settings(): dir_name = os.path.dirname(os.path.abspath(__file__)) settings_path = os.path.join(dir_name, '..', 'settings.py') if not os.path.exists(settings_path): sys.stdout.write('Error not...
null
config/settings_config.py
settings_config.py
py
1,305
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.dirname", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path.join", "line_nu...
633503902
from django.shortcuts import render from django.urls import reverse_lazy from django.contrib.auth.mixins import LoginRequiredMixin from django.views.generic import (TemplateView,ListView, DetailView,CreateView, DeleteView,UpdateView, ...
null
CaseBrief/dashboard/views.py
views.py
py
5,044
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.contrib.auth.get_user_model", "line_number": 19, "usage_type": "call" }, { "api_name": "django.contrib.auth.mixins.LoginRequiredMixin", "line_number": 57, "usage_type": "name" }, { "api_name": "django.views.generic.ListView", "line_number": 57, "usag...
549496732
from django.shortcuts import render import pandas as pd import pickle import os # Create your views here. def home(request): return render(request, 'app1/home.html') def check(request): columns = ['cpis', 'isChild', 'name'] data = [['10',1,'John Citizen'],['12',0,'Jake Citizen'],['120',0,'Jane Citizen'],['...
null
app1/views.py
views.py
py
1,222
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.shortcuts.render", "line_number": 7, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path.isfile", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path", ...
188740393
from datetime import datetime from dateutil.parser import parse class Match(object): """ CSGL Match model """ def __init__(self): self.match_id = None self.csgl_url = None self.hltv_url = None self.best_of = None self.maps = [] self.date = None self.team_1 = None self.team_2 = None self.team_1_o...
null
persistence/database/models.py
models.py
py
2,075
python
en
code
null
code-starcoder2
66
[ { "api_name": "dateutil.parser.parse", "line_number": 24, "usage_type": "call" } ]
209050276
from a00_PMTERS_CONST import mr_parameter from scipy.integrate import quad from scipy.optimize import newton, newton_krylov, fsolve, broyden1 import numpy.polynomial.chebyshev as cheb import numpy as np import time from os.path import exists from progressbar import progressbar from scipy.sparse.linalg import spsolve '...
null
Example_03/a09_PRTCLE_FOKAS.py
a09_PRTCLE_FOKAS.py
py
20,806
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.zeros", "line_number": 47, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 50, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 53, "usage_type": "call" }, { "api_name": "a00_PMTERS_CONST.mr_parameter", ...
49863652
import pygame as pg import constants class Hexagon(pg.sprite.Sprite): def __init__(self, x, y, velx, vely): pg.sprite.Sprite.__init__(self) self.image = pg.image.load("../../Pygame Tests/hexagon.png") self.image = pg.transform.scale(self.image, (150, 150)) self.rect = self.image.ge...
null
Simluator/images/Hexagon.py
Hexagon.py
py
787
python
en
code
null
code-starcoder2
66
[ { "api_name": "pygame.sprite", "line_number": 5, "usage_type": "attribute" }, { "api_name": "pygame.sprite.Sprite.__init__", "line_number": 7, "usage_type": "call" }, { "api_name": "pygame.sprite", "line_number": 7, "usage_type": "attribute" }, { "api_name": "pyga...
422956924
from SocketServer import * from socket import * import SocketServer import commands import compileall import ConfigParser from toontown import AnimationGlobals import Cookie import socket from subprocess import call import BaseHTTPServer import audiodev import SimpleHTTPServer import ctypes from sys import argv from ma...
null
toontown/LocalAvatar.py
LocalAvatar.py
py
5,092
python
en
code
null
code-starcoder2
66
[ { "api_name": "direct.actor.Actor.Actor", "line_number": 55, "usage_type": "call" }, { "api_name": "toontown.AnimationGlobals.torsoAnimDict", "line_number": 57, "usage_type": "attribute" }, { "api_name": "toontown.AnimationGlobals", "line_number": 57, "usage_type": "name"...
360945771
import sys import time import os sys.path.append("../Common") from Mysql.libmysql import dbConMysql from time import sleep from selenium import webdriver import json import re from time import sleep import json config_db = {'user': 'root', 'password': 'karisma*3%7*4', 'host': 'mthx.cafe24.com', 'database': 'mthx_ap...
null
MysqlToSQLlite/Crawlwer_UccSermonJsonToDB_BS3.py
Crawlwer_UccSermonJsonToDB_BS3.py
py
8,419
python
en
code
null
code-starcoder2
66
[ { "api_name": "sys.path.append", "line_number": 5, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 5, "usage_type": "attribute" }, { "api_name": "Mysql.libmysql.dbConMysql", "line_number": 17, "usage_type": "call" }, { "api_name": "Mysql.libmysql....
442167976
from flask import Response, request, redirect from render import render_grid from service import action car = (0,0,'N') class Controller: def __init__(self, flask_app): @flask_app.route('/', methods = ['GET']) def index(): return Response(render_grid(car), mimetype = 'text/pl...
null
controller.py
controller.py
py
702
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.Response", "line_number": 13, "usage_type": "call" }, { "api_name": "render.render_grid", "line_number": 13, "usage_type": "call" }, { "api_name": "flask.request.json", "line_number": 18, "usage_type": "attribute" }, { "api_name": "flask.reque...
500690061
from pandas._libs.tslibs import Period import websocket, json, pprint, talib,csv import pandas as pd import numpy as np import config from os import close from binance.client import Client from binance.enums import * SOCKET = "wss://stream.binance.com:9443/ws/xrpusdt@kline_1m" RSI_PERIOD = 14 RSI_OVERBOUGHT = 70 RSI_...
null
bot_x.py
bot_x.py
py
6,545
python
en
code
null
code-starcoder2
66
[ { "api_name": "binance.client.Client", "line_number": 19, "usage_type": "call" }, { "api_name": "config.API_KEY", "line_number": 19, "usage_type": "attribute" }, { "api_name": "config.API_SECRET", "line_number": 19, "usage_type": "attribute" }, { "api_name": "csv....
599742413
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.shortcuts import render, redirect from django.http import HttpResponse from models import * from book01 import models # Create your views here. def publisher(request): publ= publisherInfo.objects.all().order_by('id') publ2 = publishe...
null
book01/views.py
views.py
py
4,280
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.shortcuts.render", "line_number": 16, "usage_type": "call" }, { "api_name": "book01.models.publisherInfo.objects.create", "line_number": 23, "usage_type": "call" }, { "api_name": "book01.models.publisherInfo", "line_number": 23, "usage_type": "attrib...
336036251
"""MNIST Autoencoder. """ from six.moves import xrange # pylint: disable=redefined-builtin import tensorflow as tf import json, os, re, math import numpy as np import utils as ut import input as inp import tools.checkpoint_utils as ch_utils import activation_functions as act import visualization as vis import prettyte...
null
model/FF_model.py
FF_model.py
py
8,761
python
en
code
null
code-starcoder2
66
[ { "api_name": "tensorflow.app.flags.DEFINE_integer", "line_number": 15, "usage_type": "call" }, { "api_name": "tensorflow.app", "line_number": 15, "usage_type": "attribute" }, { "api_name": "tensorflow.app", "line_number": 16, "usage_type": "attribute" }, { "api_n...
297086505
""" Filename: ledger.py Package: cards.objects Author: Sean Carrick Created On: September 12, 2019 Modified: September 12, 2019 Version: 0.1.0 """ import datetime class Ledger(list): """ Provides a transaction ledger for an account. This gives the account a history that can be displayed at a lat...
null
cards/objects/ledger.py
ledger.py
py
2,054
python
en
code
null
code-starcoder2
66
[ { "api_name": "datetime.datetime.now", "line_number": 22, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 22, "usage_type": "attribute" }, { "api_name": "datetime.datetime.now", "line_number": 57, "usage_type": "call" }, { "api_name": "da...
160445254
# -*- coding: utf-8 -*- from django.utils.translation import ugettext as _ RELATIONS = { # 'relation_type_name': (from_1_to_2, from_2_to_1), 'ownership': ( _('owns'), _('is owned by') ), # possui, pertence à 'participation': ( _('participates in'), _('has as participant') ), ...
null
mootiro_komoo/apps/main/relations.py
relations.py
py
1,735
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.utils.translation.ugettext", "line_number": 8, "usage_type": "call" }, { "api_name": "django.utils.translation.ugettext", "line_number": 13, "usage_type": "call" }, { "api_name": "django.utils.translation.ugettext", "line_number": 18, "usage_type": "...
135424572
import tensorflow as tf import tensorflow.contrib.rnn as rnn import numpy as np from collections import deque import random from DNC import DNC BELTA = 0.0003 METHOD = [ dict(name='kl_pen', kl_target=0.01, lam=0.5), # KL penalty # Clipped surrogate objective, find this is better dict(name='clip', epsilon=...
null
src/DNC_PPO.py
DNC_PPO.py
py
11,420
python
en
code
null
code-starcoder2
66
[ { "api_name": "collections.deque", "line_number": 18, "usage_type": "call" }, { "api_name": "tensorflow.Session", "line_number": 22, "usage_type": "call" }, { "api_name": "tensorflow.placeholder", "line_number": 23, "usage_type": "call" }, { "api_name": "tensorflo...
507692849
import scrapy f = open('haha.txt', "r") #urls = [line for line in f] ''' for k in urls: print(k)file js-file js-details-container ''' class DummySpider(scrapy.Spider): flag = 0 global urls name = "dummy" start_urls = [line.strip() for line in f] def parse(self, response): if(respon...
null
Github-Spider/dummy_spider2.py
dummy_spider2.py
py
1,047
python
en
code
null
code-starcoder2
66
[ { "api_name": "scrapy.Spider", "line_number": 12, "usage_type": "attribute" } ]
561152580
import nose from nose.tools import * from multiprocessing import Process import requests import time import json from resty.server import RESTController from resty.decorators import request_type, request_path SERVER = "http://localhost:8080" HOSTNAME = "localhost" PORT = 8080 # request callbacks def time_as_string ...
null
resty/test/test_resty.py
test_resty.py
py
1,943
python
en
code
null
code-starcoder2
66
[ { "api_name": "time.gmtime", "line_number": 18, "usage_type": "call" }, { "api_name": "time.time", "line_number": 18, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 24, "usage_type": "call" }, { "api_name": "resty.decorators.request_type", ...
133890162
import os import operator import os.path import time import threading import pygame import random pygame.init() CRED = "\033[91m" CEND = "\033[0m" highscore = "highscore.txt" player = True p1_char = "\033[32m" + "X" + "\033[0m" p2_char = "\033[34m" + "O" + "\033[0m" playername1 = "" playername2 = "" round = 0 vertica...
null
Tictactoe_v2.0.py
Tictactoe_v2.0.py
py
17,437
python
en
code
null
code-starcoder2
66
[ { "api_name": "pygame.init", "line_number": 8, "usage_type": "call" }, { "api_name": "os.system", "line_number": 27, "usage_type": "call" }, { "api_name": "os.system", "line_number": 67, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 43...
166341657
import autograd.numpy as np from neural_structural_optimization import topology2 import tensorflow as tf import xarray def trainer(model, max_iterations, optimizer=tf.keras.optimizers.Adam(1e-2)): tvars = model.trainable_variables losses = [] frames = [] for i in range(max_iterations + 1): with...
null
train.py
train.py
py
1,079
python
en
code
null
code-starcoder2
66
[ { "api_name": "tensorflow.keras.optimizers.Adam", "line_number": 6, "usage_type": "call" }, { "api_name": "tensorflow.keras", "line_number": 6, "usage_type": "attribute" }, { "api_name": "tensorflow.GradientTape", "line_number": 11, "usage_type": "call" }, { "api_...
560674983
import sys, os import argparse from mini_installer import file_read from mini_installer import version #!/usr/bin/env python -c # -*- coding: utf-8 -*- file_name="installation.yaml" def main(): parser = argparse.ArgumentParser(description='Does an installation according to installation.yaml file in th...
null
installer/mini_installer/main.py
main.py
py
1,145
python
en
code
null
code-starcoder2
66
[ { "api_name": "argparse.ArgumentParser", "line_number": 12, "usage_type": "call" }, { "api_name": "mini_installer.version.replace_version_from_cmd", "line_number": 19, "usage_type": "call" }, { "api_name": "mini_installer.version", "line_number": 19, "usage_type": "name" ...
447979898
import base64 import logging import sys, subprocess, getopt from logging.handlers import RotatingFileHandler from splunk.clilib.bundle_paths import make_splunkhome_path logPath = make_splunkhome_path(['var', 'log', 'splunk']) # keys we'll be using when talking with splunk. USERNAME = "username" # secure inputs con...
null
auth/scripts/commonAuth.py
commonAuth.py
py
2,063
python
en
code
null
code-starcoder2
66
[ { "api_name": "splunk.clilib.bundle_paths.make_splunkhome_path", "line_number": 7, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 25, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 26, "usage_type": "attribute" }, { ...
597200643
import json,requests #changeable #change the urls on prod PLATE_NO = "TEJ123" web_status="https://" website="acarjsystem.herokuapp.com" def get_user_number(): #this method is for getting user's number global cont_no url = web_status + website + "/userdata/" req_info = { 'plate_no':PLATE_NO } re...
null
for rpi/reqrec.py
reqrec.py
py
4,196
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.post", "line_number": 16, "usage_type": "call" }, { "api_name": "requests.post", "line_number": 35, "usage_type": "call" }, { "api_name": "requests.post", "line_number": 62, "usage_type": "call" }, { "api_name": "requests.post", "line_n...
148275967
# Python Lib Modules import re from datetime import datetime, timedelta import time import logging import json # Community Modules import requests import requests_cache # SMOREs Internal Imports from smores.utility.errors import smores_error import smores.utility.Authenticate as auth import smores.utility.util as util ...
null
smores/api.py
api.py
py
24,969
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 15, "usage_type": "call" }, { "api_name": "smores.utility.util.get_util_base", "line_number": 20, "usage_type": "call" }, { "api_name": "smores.utility.util", "line_number": 20, "usage_type": "name" }, { "api_name"...
522161813
# -*- coding: utf-8 -*- from odoo import models, fields, api class City(models.Model): _name = 'oe.city' _description = u'城市' pid = fields.Many2one('oe.province', string='省份') name = fields.Char('名称', requried=True) child_ids = fields.One2many('oe.district', 'pid', string='区') @api.model_...
null
models/oe_city.py
oe_city.py
py
532
python
en
code
null
code-starcoder2
66
[ { "api_name": "odoo.models.Model", "line_number": 6, "usage_type": "attribute" }, { "api_name": "odoo.models", "line_number": 6, "usage_type": "name" }, { "api_name": "odoo.fields.Many2one", "line_number": 11, "usage_type": "call" }, { "api_name": "odoo.fields", ...
252850881
# -*- coding: utf-8 -*- """ Created on Tue Apr 3 14:44:59 2018 @author: mbray201 """ import time import json import pandas as pd import pyodbc import sqlalchemy from urllib import parse cnxn = sqlalchemy.create_engine('mssql+pyodbc:///?odbc_connect={}' .format(parse.quote_plus('DRIVER...
null
Pramata/api/archives/pramata_parse.py
pramata_parse.py
py
14,351
python
en
code
null
code-starcoder2
66
[ { "api_name": "sqlalchemy.create_engine", "line_number": 15, "usage_type": "call" }, { "api_name": "urllib.parse.quote_plus", "line_number": 16, "usage_type": "call" }, { "api_name": "urllib.parse", "line_number": 16, "usage_type": "name" }, { "api_name": "pandas....
24458400
# uncompyle6 version 3.7.4 # Python bytecode 2.7 (62211) # Decompiled from: Python 3.6.9 (default, Apr 18 2020, 01:56:04) # [GCC 8.4.0] # Embedded file name: build/bdist.linux-x86_64/egg/test/fixtures.py # Compiled at: 2014-08-31 04:18:26 import shutil, subprocess, tempfile, logging, time, hashlib, uuid from OpenSSL i...
null
pycfiles/python_nats-0.1.0.beta.2-py2.7/fixtures.py
fixtures.py
py
1,385
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 20, "usage_type": "call" }, { "api_name": "tempfile.mkdtemp", "line_number": 21, "usage_type": "call" }, { "api_name": "subprocess.Popen", "line_number": 27, "usage_type": "call" }, { "api_name": "time.sleep", ...
603002553
# Copyright (C) 2015-2019 by Vd. # This file is part of RocketGram, the modern Telegram bot framework. # RocketGram is released under the MIT License (see LICENSE). import enum class UpdateType(enum.Enum): message = enum.auto() edited_message = enum.auto() channel_post = enum.auto() edited_channel_p...
null
rocketgram/update.py
update.py
py
25,804
python
en
code
null
code-starcoder2
66
[ { "api_name": "enum.Enum", "line_number": 9, "usage_type": "attribute" }, { "api_name": "enum.auto", "line_number": 10, "usage_type": "call" }, { "api_name": "enum.auto", "line_number": 11, "usage_type": "call" }, { "api_name": "enum.auto", "line_number": 12, ...
246682129
# coding=utf-8 """ Copyright (c) 2018-present, Ant Financial Service Group 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 Un...
null
anthunder/listener/base_listener.py
base_listener.py
py
3,752
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 26, "usage_type": "call" }, { "api_name": "anthunder.mesh.mesh_client.MeshClient", "line_number": 66, "usage_type": "call" }, { "api_name": "anthunder.mesh.mesh_client.ApplicationInfo", "line_number": 66, "usage_type": "ca...
347329431
import sys import logging from mongoengine import connect def connect_to_mongodb(dbname): try: connect(dbname, host='mongodb://172.17.128.101') logging.info("Successfully connect mongodb") except Exception as e: logging.error("Failed to connect mongodb, %s", e) sys.exit(1)
null
OrgUsers/config/mongoExe.py
mongoExe.py
py
320
python
en
code
null
code-starcoder2
66
[ { "api_name": "mongoengine.connect", "line_number": 8, "usage_type": "call" }, { "api_name": "logging.info", "line_number": 10, "usage_type": "call" }, { "api_name": "logging.error", "line_number": 14, "usage_type": "call" }, { "api_name": "sys.exit", "line_nu...
234719476
# How Flask gives access to the information the user sent to the server? ##### METHOD NOT ALLOWED ##### # This happens because browser is sending GET request but script only handles POST request at the /echo URL # Solution: use curl request (curl --data 'text=world' http://127.0.0.1:5000/echo) # Reference: http://c...
null
flask_examples/Example_Get_Post_Request/app_post.py
app_post.py
py
1,775
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.Flask", "line_number": 15, "usage_type": "call" }, { "api_name": "flask.request.form", "line_number": 41, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 41, "usage_type": "name" } ]
337853501
# import requests # # r = requests.get('https://www.yxgj.net/') # # print(r.status_code) import requests import random import json import urllib3 import sys from bs4 import BeautifulSoup urllib3.disable_warnings() def get_question_number(temp_headers, message, category_id): question_number_url = 'https://www.yxgj...
null
YaoXueGongJu/test/get_question_number.py
get_question_number.py
py
2,048
python
en
code
null
code-starcoder2
66
[ { "api_name": "urllib3.disable_warnings", "line_number": 13, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 41, "usage_type": "call" } ]
344606862
""" i interruption w work rev Revise curent entry by adding more tags << Revise last entry, using last entry's timestamp ls View entries rm 0 edit 0 #tag """ from datetime import datetime, timedelta from nose.tools import eq_ from events import WorkEvent, WorkEventLog, EventsAnalyzer class TestParsing(object...
null
testtrack.py
testtrack.py
py
1,186
python
en
code
null
code-starcoder2
66
[ { "api_name": "datetime.datetime", "line_number": 24, "usage_type": "call" }, { "api_name": "events.WorkEvent.parse", "line_number": 25, "usage_type": "call" }, { "api_name": "events.WorkEvent", "line_number": 25, "usage_type": "name" }, { "api_name": "nose.tools....
249347376
import re from setuptools import setup, find_packages description = 'Version-bump your software with a single command!' long_description = re.sub( "\`(.*)\<#.*\>\`\_", r"\1", str(open('README.md', 'rb').read()).replace(description, '') ) setup( name='bumpv', version='0.3.0', url='https://github.com...
null
pypi_install_script/bumpv-0.3.0.tar/setup.py
setup.py
py
1,066
python
en
code
null
code-starcoder2
66
[ { "api_name": "re.sub", "line_number": 6, "usage_type": "call" }, { "api_name": "setuptools.setup", "line_number": 12, "usage_type": "call" }, { "api_name": "setuptools.find_packages", "line_number": 19, "usage_type": "call" } ]
176605898
import socket import pyautogui from pynput.mouse import Controller, Button TEST = False master = input('master ip: ') mouse = Controller() class MouseAction: MOVE = 0 CLICK = 1 SCROLL = 2 def on_move(x, y): x_ = x * self_resolution[0] / master_resolution[0] y_ = y * self_resolution[1] / master_r...
null
tcp/slave.py
slave.py
py
1,836
python
en
code
null
code-starcoder2
66
[ { "api_name": "pynput.mouse.Controller", "line_number": 8, "usage_type": "call" }, { "api_name": "pyautogui.size", "line_number": 44, "usage_type": "call" }, { "api_name": "socket.socket", "line_number": 46, "usage_type": "call" }, { "api_name": "socket.AF_INET", ...
202404088
# # Copyright (c) 2015 Red Hat # Licensed under The MIT License (MIT) # http://opensource.org/licenses/MIT # """ Checks for automatic documentation generators. It verifies no errors are logged. This test should not be part of main test suite as it will run pretty much all viewsets without checking anything but the doc...
null
tests/check_api_doc.py
check_api_doc.py
py
1,024
python
en
code
null
code-starcoder2
66
[ { "api_name": "rest_framework.test.APITestCase", "line_number": 21, "usage_type": "name" }, { "api_name": "django.urls.reverse", "line_number": 23, "usage_type": "call" }, { "api_name": "mock.patch", "line_number": 25, "usage_type": "call" } ]
14717225
"""Stacked Attention model to combine visual and question embeddings. """ import torch import torch.nn as nn import torch.nn.functional as F class StackedAttention(nn.Module): """Model to combine image and question embeddings. Can be stacked together. """ def __init__(self, input_image_dim=1024, in...
null
models/stacked_attention.py
stacked_attention.py
py
2,637
python
en
code
null
code-starcoder2
66
[ { "api_name": "torch.nn.Module", "line_number": 9, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 9, "usage_type": "name" }, { "api_name": "torch.nn.Linear", "line_number": 26, "usage_type": "call" }, { "api_name": "torch.nn", "line_numb...
51724305
#!/usr/bin/env python # coding=utf-8 """ Author: Fanchong Jian, Pengbo Song Created Date: 2021/09/28 Last Modified: 2021/09/30 """ from warnings import warn from sklearn import linear_model import os import numpy as np import matplotlib.pyplot as plt class MLChemLab1: """Template class for Lab1 -*- Linea...
null
homework02/workdir/ridge_regression_template_new.py
ridge_regression_template_new.py
py
6,541
python
en
code
null
code-starcoder2
66
[ { "api_name": "warnings.warn", "line_number": 43, "usage_type": "call" }, { "api_name": "sklearn.linear_model.Ridge", "line_number": 56, "usage_type": "call" }, { "api_name": "sklearn.linear_model", "line_number": 56, "usage_type": "name" }, { "api_name": "warning...
631464084
#!/usr/bin/env python # Copyright 2015 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import base64 import os import sys import unittest _BUILD_PATH = os.path.abspath(os.path.join( os.path.dirname(__file__), os.path....
null
scripts/slave/recipe_modules/auto_bisect_staging/resources/fetch_file_test.py
fetch_file_test.py
py
1,223
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.abspath", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path", "line_number": 11, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path.dirname", "line...
264103044
# Converts a GDB object (referring to a Babeltrace object) and converts # it to a bt-analysis model object. # # The MIT License (MIT) # # Copyright (c) 2016 Philippe Proulx <eepp.ca> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (t...
null
python/bt_gdb_obj.py
bt_gdb_obj.py
py
32,970
python
en
code
null
code-starcoder2
66
[ { "api_name": "enum.Enum", "line_number": 32, "usage_type": "attribute" }, { "api_name": "gdb.lookup_type", "line_number": 44, "usage_type": "call" }, { "api_name": "gdb.lookup_type", "line_number": 54, "usage_type": "call" }, { "api_name": "gdb.lookup_type", ...
262749450
from Gans.Models import MLP_D as Disc from Gans.Models import MLP_G as Gen from Gans.cramerGan import train_gans from data import mnist import numpy as np import argparse import torch, os class DataIterator: def __init__(self, train_gen): ''' data: a hdf5 opened pointer Index: one array in...
null
mnist_CramerGans.py
mnist_CramerGans.py
py
3,444
python
en
code
null
code-starcoder2
66
[ { "api_name": "argparse.ArgumentParser", "line_number": 30, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 69, "usage_type": "attribute" }, { "api_name": "torch.cuda.is_available", "line_number": 70, "usage_type": "call" }, { "api_name": "torch...
566254066
import pytest from middlewared.test.integration.utils import call, ssh from auto_config import dev_test # comment pytestmark for development testing with --dev-test pytestmark = pytest.mark.skipif(dev_test, reason='Skipping for test development testing') @pytest.fixture(autouse=True, scope="module") def stop_collect...
null
tests/api2/test_reporting__configure.py
test_reporting__configure.py
py
3,120
python
en
code
null
code-starcoder2
66
[ { "api_name": "pytest.mark.skipif", "line_number": 6, "usage_type": "call" }, { "api_name": "auto_config.dev_test", "line_number": 6, "usage_type": "argument" }, { "api_name": "pytest.mark", "line_number": 6, "usage_type": "attribute" }, { "api_name": "middlewared...
76639361
from behave import * from dateutil.parser import parse from decimal import Decimal from base.models import Expense import logging logger = logging.getLogger('default') @given(u'a new expense') def impl(context): row = context.table[0] context.bmo = Expense(company_id=row['company'], ...
null
savor/testsuite/features/steps/expense_gl_entries.py
expense_gl_entries.py
py
730
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 8, "usage_type": "call" }, { "api_name": "base.models.Expense", "line_number": 15, "usage_type": "call" }, { "api_name": "decimal.Decimal", "line_number": 16, "usage_type": "call" } ]
187850582
# -*- coding: utf-8 -*- import json import logging from django.views.decorators.http import require_GET, require_POST from luckycommon.notification.model.notification import NOTIFY_TYPE from luckycommon.tips import handler as tips_handler from luckycommon.push import handler as push_handler from luckycommon.cache im...
null
luckyapi/views/notification.py
notification.py
py
7,705
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 24, "usage_type": "call" }, { "api_name": "luckycommon.utils.api.parse_p", "line_number": 31, "usage_type": "call" }, { "api_name": "luckycommon.notification.db.notification.get_user_notifications", "line_number": 39, "usa...
426929252
import torch import torch.nn as nn import torchvision.models as models import sys class _vgg16Deconv(nn.Module): def __init__(self): super(_vgg16Deconv, self).__init__() self.features = nn.Sequential( # deconv1 nn.AvgPool2d(kernel_size=1, stride=1), nn.MaxUnpoo...
null
vgg16_deconv.py
vgg16_deconv.py
py
3,607
python
en
code
null
code-starcoder2
66
[ { "api_name": "torch.nn.Module", "line_number": 7, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 7, "usage_type": "name" }, { "api_name": "torch.nn.Sequential", "line_number": 11, "usage_type": "call" }, { "api_name": "torch.nn", "line_...
508988541
""" Plots the steady-state force coefficients of an inclined flat-plate with aspect-ratio 2 at Reynolds number 100 for angles of attack between 0 and 90 degrees. Compares with experimental results reported in Taira et al. (2007). _References:_ * Taira, K., Dickson, W. B., Colonius, T., Dickinson, M. H., & Rowley, C. ...
null
examples/decoupledibpm/flatplate3dRe100_GPU/scripts/plotForceCoefficients.py
plotForceCoefficients.py
py
3,939
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.dirname", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path", "line_number": 19, "usage_type": "attribute" }, { "api_name": "os.path.realpath", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path.dirname", "...
102422703
#!/usr/bin/env python import rospy import tf import cv2 import yaml import math import sys from std_msgs.msg import Int32 from geometry_msgs.msg import PoseStamped, Pose from styx_msgs.msg import TrafficLightArray, TrafficLight from styx_msgs.msg import Lane from sensor_msgs.msg import Image from cv_bridge import CvBr...
null
ros/src/tl_detector/tl_detector.py
tl_detector.py
py
9,086
python
en
code
null
code-starcoder2
66
[ { "api_name": "math.sqrt", "line_number": 18, "usage_type": "call" }, { "api_name": "math.sqrt", "line_number": 34, "usage_type": "call" }, { "api_name": "rospy.init_node", "line_number": 38, "usage_type": "call" }, { "api_name": "cv_bridge.CvBridge", "line_nu...
87999989
# -*- coding: utf-8 -*- """Test utility functions.""" #------------------------------------------------------------------------------------------------- # Imports #------------------------------------------------------------------------------------------------- import json import logging import os.path as op from ...
null
podoc/tests/test_utils.py
test_utils.py
py
3,381
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 22, "usage_type": "call" }, { "api_name": "pytest.mark.skipif", "line_number": 24, "usage_type": "call" }, { "api_name": "pytest.mark", "line_number": 24, "usage_type": "name" }, { "api_name": "utils.has_pandoc", ...