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
176876172
# floyd run --gpu2 --env tensorflow-1.13 --data svidrigajlov/datasets/bach_limited_normalized/1:mount_point 'python train_wgan.py --side floyd --logs_dir from_ckp --ckp_from_seq 5 --first_restore_flag True' if __name__ == '__main__': from s2b import * import argparse parser = argparse.ArgumentParser('') ...
null
train_wgan.py
train_wgan.py
py
12,843
python
en
code
null
code-starcoder2
66
[ { "api_name": "argparse.ArgumentParser", "line_number": 8, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 60, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 61, "usage_type": "attribute" }, { "api_name": "os.environ", ...
9230385
from django.shortcuts import render,loader from django.http import HttpResponse,HttpResponseRedirect from django.contrib.auth.decorators import login_required from django.contrib.auth import get_user_model from api import models from django.core.files.storage import FileSystemStorage #custom_decoraters def admin_val...
null
jobadmin/views.py
views.py
py
16,684
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.contrib.auth.get_user_model", "line_number": 15, "usage_type": "call" }, { "api_name": "django.http.HttpResponseRedirect", "line_number": 20, "usage_type": "call" }, { "api_name": "django.http.HttpResponseRedirect", "line_number": 22, "usage_type": "...
474083781
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import pandas as pd import torch import os import sys import numpy as np import argparse parser = argparse.ArgumentParser() parser.add_argument("--net_name", type=str, required=True, help="Name of network (ex. vgg11, sticknet8)") parser.add_argument("--dataset", type=str,...
null
gen_dataframes.py
gen_dataframes.py
py
2,611
python
en
code
null
code-starcoder2
66
[ { "api_name": "argparse.ArgumentParser", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 22, "usage_type": "call" }, { "api_name": "os.path", "line_number": 22, "usage_type": "attribute" }, { "api_name": "os.walk", "line...
229087257
import requests from requests.packages import urllib3 urllib3.disable_warnings() import json import re class salt_api(object): def __init__(self): #self.__url = 'https://192.168.57.11:8888' self.__url = 'http://10.10.50.89:8888' self.__token = self.__get_token() def __get_token(self)...
null
lib/test.py
test.py
py
1,946
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.packages.urllib3.disable_warnings", "line_number": 3, "usage_type": "call" }, { "api_name": "requests.packages.urllib3", "line_number": 3, "usage_type": "name" }, { "api_name": "requests.post", "line_number": 28, "usage_type": "call" }, { "...
396820236
import sys import re import logging import random import yaml from flask import Flask, render_template from flask_ask import Ask, statement, question, session # print things to the command window def trace(string): sys.stderr.write(string+'\n') sys.stderr.flush() return app = Flask(__name__) ask = Ask(app...
null
interview.py
interview.py
py
5,162
python
en
code
null
code-starcoder2
66
[ { "api_name": "sys.stderr.write", "line_number": 11, "usage_type": "call" }, { "api_name": "sys.stderr", "line_number": 11, "usage_type": "attribute" }, { "api_name": "sys.stderr.flush", "line_number": 12, "usage_type": "call" }, { "api_name": "sys.stderr", "l...
373087681
from urlparse import urlparse import falcon from cerberus import Validator class CustomValidator(Validator): def _validate_url_or_blank(self, url_or_blank, field, value): if url_or_blank and value != '': parsed = urlparse(value) valid_scheme = parsed.scheme in ['http', 'https'] ...
null
app/utils/validation.py
validation.py
py
1,009
python
en
code
null
code-starcoder2
66
[ { "api_name": "cerberus.Validator", "line_number": 6, "usage_type": "name" }, { "api_name": "urlparse.urlparse", "line_number": 10, "usage_type": "call" }, { "api_name": "falcon.HTTPBadRequest", "line_number": 22, "usage_type": "call" } ]
93353754
"""convenient default functions for use with rt1.rtfits.processfunc()""" import sys import pandas as pd import traceback from pathlib import Path from .rtfits import load class rt1_processing_config(object): """ a class that provides convenient default functions that can be used with `rt1.rtprocess.RTpro...
null
rt1/processing_config.py
processing_config.py
py
13,952
python
en
code
null
code-starcoder2
66
[ { "api_name": "pathlib.Path", "line_number": 82, "usage_type": "call" }, { "api_name": "pandas.date_range", "line_number": 191, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 193, "usage_type": "call" }, { "api_name": "pandas.DataFrame", ...
443665402
import logging import logging.config logger = logging.getLogger(__name__) # error messages ERR_MSG = "error_message" class HXException(Exception): def __init__(self, message): return_msg = self.process_exception(message) super(HXException, self).__init__(return_msg) @staticm...
null
hyperflexsizer-NewVersions/sizer/sizer/hyperconverged/exception.py
exception.py
py
15,331
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 3, "usage_type": "call" } ]
645033580
############### ### IMPORTS ### import pandas as pd import numpy as np import os, sys, site, math, time, pickle, gzip from glob import glob from tqdm import tqdm, trange import geopandas as gpd import xarray as xr import zephyr projpath = zephyr.settings.projpath datapath = zephyr.settings.datapath extdatapath = zep...
null
vresc_merra_1-reshape.py
vresc_merra_1-reshape.py
py
3,235
python
en
code
null
code-starcoder2
66
[ { "api_name": "zephyr.settings", "line_number": 14, "usage_type": "attribute" }, { "api_name": "zephyr.settings", "line_number": 15, "usage_type": "attribute" }, { "api_name": "zephyr.settings", "line_number": 16, "usage_type": "attribute" }, { "api_name": "os.pat...
298418521
#!/usr/bin/env python # -*- coding: utf-8 -*- """ 中国大学MOOC 课程下载 """ import os import re import time import requests # 创建一个全局的 requests 的会话 CONNECTION = requests.Session() # 模拟浏览器 HEADER = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537....
null
icourse.py
icourse.py
py
9,459
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.Session", "line_number": 12, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 20, "usage_type": "call" }, { "api_name": "re.search", "line_number": 29, "usage_type": "call" }, { "api_name": "re.findall", "line_number":...
64894802
#!/usr/bin/python3 """Paint many circles on a canvas concurrently. Expects a module 'particle' with a class 'Particle'. You do not need to read this module, just implement the particle module. """ import time import tkinter as tk from threading import Event, Lock from PIL import ImageTk RADIUS = 2 WIDTH, HEIGHT = 4...
null
PyPrgs/Blatt7/canvas.py
canvas.py
py
8,985
python
en
code
null
code-starcoder2
66
[ { "api_name": "threading.Event", "line_number": 30, "usage_type": "call" }, { "api_name": "time.time", "line_number": 37, "usage_type": "call" }, { "api_name": "time.time", "line_number": 42, "usage_type": "call" }, { "api_name": "tkinter.Canvas", "line_number...
469153205
# -*- coding: utf-8 -*- from django import forms from django.contrib import admin from django.contrib.contenttypes.forms import BaseGenericInlineFormSet from django.contrib.contenttypes.admin import GenericStackedInline from django.contrib.contenttypes.models import ContentType from django.utils.encoding import smart_s...
null
djangoseo/admin.py
admin.py
py
12,820
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.contrib.admin.ModelAdmin", "line_number": 28, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 28, "usage_type": "name" }, { "api_name": "django.contrib.admin.ModelAdmin", "line_number": 44, "usage_type": "attribute" ...
239617392
# -*- coding:UTF-8 -*- import unittest import os import sys sys_path = os.path.join(os.path.dirname(__file__), '..') sys.path.append(sys_path) from utils import HTMLTestReportCN from utils.config_utils import local_config from nb_log import LogManager logger = LogManager('PopOn-School_API_TEST').get_logger_and_add_h...
null
test_runner/run_all_case.py
run_all_case.py
py
1,766
python
en
code
null
code-starcoder2
66
[ { "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": "sys.path.append", "line_nu...
357009968
"""CompMusic Raga Dataset Loader .. admonition:: Dataset Info :class: dropdown Rāga datasets from CompMusicomprise two sizable datasets, one for each music tradition, Carnatic and Hindustani. These datasets comprise full length audio recordings and their associated rāga labels. These two datasets ca...
null
mirdata/datasets/compmusic_raga.py
compmusic_raga.py
py
14,564
python
en
code
null
code-starcoder2
66
[ { "api_name": "mirdata.core.Index", "line_number": 70, "usage_type": "call" }, { "api_name": "mirdata.core", "line_number": 70, "usage_type": "name" }, { "api_name": "mirdata.download_utils.RemoteFileMetadata", "line_number": 74, "usage_type": "call" }, { "api_nam...
61016452
import sys import os sys.path.insert(0, os.path.abspath('..')) import numpy as np import cv2 import matplotlib.pyplot as plt from birdview import BirdViewTransform from scipy import signal import matplotlib.pyplot as plt from detect_peaks import detect_peaks from frametracking import FrameTracking, g_frame_tracking ...
null
locatelanepixels.py
locatelanepixels.py
py
15,186
python
en
code
null
code-starcoder2
66
[ { "api_name": "sys.path.insert", "line_number": 4, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 4, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 4, "usage_type": "call" }, { "api_name": "os.path", "line_number...
234053808
from functools import reduce from operator import mul def load(filename): with open(filename, 'r') as f: for line in f.readlines(): yield [int(x) for x in line.split(' ')] def product(sequence): return reduce(mul, sequence, 1) def max_product(grid, length=4): num_rows = len(grid) ...
null
problems/011/p011.py
p011.py
py
1,366
python
en
code
null
code-starcoder2
66
[ { "api_name": "functools.reduce", "line_number": 12, "usage_type": "call" }, { "api_name": "operator.mul", "line_number": 12, "usage_type": "argument" } ]
50008660
import cv2 import numpy as np cap = cv2.VideoCapture("img/book.mp4") widthImg = 405 heightImg = 480 def preProcessing(img): gray_img = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY) #模糊化 blur_img = cv2.GaussianBlur(gray_img,(5,5),1) #輪廓線 canny_img = cv2.Canny(blur_img,200,200) kernel = np.ones((5,5)) ...
null
scan_video.py
scan_video.py
py
4,604
python
en
code
null
code-starcoder2
66
[ { "api_name": "cv2.VideoCapture", "line_number": 4, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 10, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2GRAY", "line_number": 10, "usage_type": "attribute" }, { "api_name": "cv2.GaussianBlur...
616365059
from django.db import models from django.utils import timezone from django.utils.translation import ugettext, ugettext_lazy as _ # Create your models here. class Order(models.Model): ORDER_STATUS = [ ('new', 'Новый заказ'), ('created', 'Создан, ожидает оплаты'), ('payed', '...
null
apps/order/models.py
models.py
py
5,086
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.db.models.Model", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 7, "usage_type": "name" }, { "api_name": "django.db.models.CharField", "line_number": 23, "usage_type": "call" }, { "api_name": ...
159496886
import pygame import sys import random import tkinter as tk from vfx import CircleDrop, ParticleContainer from gui import Button, ButtonContainer class TodoMenu: def __init__(self, parent): self.parent = parent self.last_time = pygame.time.get_ticks() self.button_font = pygame.font.Sys...
null
timathon/menus/todo_menu.py
todo_menu.py
py
7,715
python
en
code
null
code-starcoder2
66
[ { "api_name": "pygame.time.get_ticks", "line_number": 15, "usage_type": "call" }, { "api_name": "pygame.time", "line_number": 15, "usage_type": "attribute" }, { "api_name": "pygame.font.SysFont", "line_number": 17, "usage_type": "call" }, { "api_name": "pygame.fon...
151724012
#!encoding utf-8 from csv import DictWriter import numpy as np from django.utils import timezone from facebook_feeds.management.commands.kikar_base_commands import KikarBaseCommand from facebook_feeds.models import Facebook_Feed, Facebook_Status DELIMITER = ',' class Command(KikarBaseCommand): def add_argume...
null
kikar_hamedina/reporting/management/commands/export_statuses_descriptive_statistics_for_feeds.py
export_statuses_descriptive_statistics_for_feeds.py
py
3,523
python
en
code
null
code-starcoder2
66
[ { "api_name": "facebook_feeds.management.commands.kikar_base_commands.KikarBaseCommand", "line_number": 15, "usage_type": "name" }, { "api_name": "facebook_feeds.models.Facebook_Feed.objects.filter", "line_number": 41, "usage_type": "call" }, { "api_name": "facebook_feeds.models....
211561018
# -*- coding: utf-8 -*- """ Created on Wed Sep 20 20:28:36 2017 @author: Cyril """ # se mettre dans l'environnement weather_py36 # D:\violettes\Software\Central\Data Preprocessing Template\gpxpy-master # doc https://pyowm.readthedocs.io/en/latest/ # doc https://github.com/csparpa/pyowm/blob/master/pyowm/docs/usage-e...
null
Central/Data Preprocessing Template/gpxpy-master/gpxpy/owm_et_gpxpy.py
owm_et_gpxpy.py
py
1,360
python
en
code
null
code-starcoder2
66
[ { "api_name": "pyowm.OWM", "line_number": 18, "usage_type": "call" }, { "api_name": "gpxpy.parse", "line_number": 29, "usage_type": "call" } ]
647158756
import redis from flask import Flask app = Flask(__name__) try: # Create a redis connection pool and pass to flask instance pool = redis.ConnectionPool(host='redis', port=6379, max_connections=10, db=0) db = redis.Redis(connection_pool=pool) except Exception as e: print('Redis connection error: %s' % ...
null
src/api/python/api/__init__.py
__init__.py
py
343
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.Flask", "line_number": 4, "usage_type": "call" }, { "api_name": "redis.ConnectionPool", "line_number": 8, "usage_type": "call" }, { "api_name": "redis.Redis", "line_number": 9, "usage_type": "call" } ]
46245253
from pprint import pprint from telegram.ext import Updater, CommandHandler, MessageHandler, CallbackQueryHandler import requests from telegram import InlineKeyboardButton, InlineKeyboardMarkup, ReplyKeyboardMarkup import random updater = Updater(token='Token') dispatcher = updater.dispatcher def limoo_start(bot, up...
null
limooweather.py
limooweather.py
py
1,795
python
en
code
null
code-starcoder2
66
[ { "api_name": "telegram.ext.Updater", "line_number": 8, "usage_type": "call" }, { "api_name": "random.shuffle", "line_number": 24, "usage_type": "call" }, { "api_name": "telegram.InlineKeyboardButton", "line_number": 29, "usage_type": "call" }, { "api_name": "tele...
641027363
import datetime import matplotlib matplotlib.use('TkAgg') import numpy as np from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg from matplotlib.figure import Figure from tkinter import * import time, threading WAIT_SECONDS = 1#每隔多久(秒)更新一次 class mclass: def __init__(self, window): super().__in...
null
time.py
time.py
py
1,247
python
en
code
null
code-starcoder2
66
[ { "api_name": "matplotlib.use", "line_number": 3, "usage_type": "call" }, { "api_name": "time.ctime", "line_number": 32, "usage_type": "call" }, { "api_name": "threading.Timer", "line_number": 33, "usage_type": "call" } ]
649127109
from PyQt5.QtWidgets import QDialog, QLabel, QVBoxLayout, QTextBrowser, QPushButton class help_dialog(QDialog): def __init__(self): super().__init__() def initUI(self): layoutMain = QVBoxLayout() txtHelpContent = QTextBrowser() txtHelpContent.setOpenExternalLinks(True) ...
null
ui/help_dialog.py
help_dialog.py
py
965
python
en
code
null
code-starcoder2
66
[ { "api_name": "PyQt5.QtWidgets.QDialog", "line_number": 3, "usage_type": "name" }, { "api_name": "PyQt5.QtWidgets.QVBoxLayout", "line_number": 9, "usage_type": "call" }, { "api_name": "PyQt5.QtWidgets.QTextBrowser", "line_number": 10, "usage_type": "call" }, { "ap...
408489380
import numpy as np from hexrd import imageseries from hexrd.imageseries import stats from .common import ImageSeriesTest, make_array, make_array_ims class TestImageSeriesStats(ImageSeriesTest): def test_stats_average(self): """Processed imageseries: median""" a = make_array() is_a = im...
null
hexrd/imageseries/tests/test_stats.py
test_stats.py
py
2,793
python
en
code
null
code-starcoder2
66
[ { "api_name": "common.ImageSeriesTest", "line_number": 9, "usage_type": "name" }, { "api_name": "common.make_array", "line_number": 14, "usage_type": "call" }, { "api_name": "hexrd.imageseries.open", "line_number": 15, "usage_type": "call" }, { "api_name": "hexrd....
513947358
# Solution to Project Euler problem 5 # Aditya Kalari June 20 2017 import fractions def compute(): answer = 1 for i in range(1, 21): answer = answer*i // fractions.gcd(i, answer) return str(answer) if __name__ == "__main__": print(compute())
null
000s/p005.py
p005.py
py
251
python
en
code
null
code-starcoder2
66
[ { "api_name": "fractions.gcd", "line_number": 9, "usage_type": "call" } ]
12934268
import logging from concurrent.futures.thread import ThreadPoolExecutor from camunda.external_task.external_task import ExternalTask from camunda.external_task.external_task_worker import ExternalTaskWorker from camunda.utils.log_utils import log_with_context logger = logging.getLogger(__name__) default_config = { ...
null
examples/retry_task_example.py
retry_task_example.py
py
1,780
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 8, "usage_type": "call" }, { "api_name": "camunda.external_task.external_task.ExternalTask", "line_number": 21, "usage_type": "name" }, { "api_name": "camunda.utils.log_utils.log_with_context", "line_number": 26, "usage_ty...
66234228
import json from com.pajk.plazass.utils import DictUtil, RegistryDao,ScheduleDao, ValidateUtil, AllHttpClientWriter, RocketMQWriter, LogUtil,DateTimeUtil,TairUtil,StopedOrderDao # import_script 武汉大学人民医院/Abstract.py ## 武汉大学人民医院 停诊订单 class StopOrder(Abstract): def __init__(self): self.tair_timeout = 60 * 60...
null
whrm/StopOrder.py
StopOrder.py
py
5,152
python
en
code
null
code-starcoder2
66
[ { "api_name": "json.loads", "line_number": 13, "usage_type": "call" }, { "api_name": "com.pajk.plazass.utils.DictUtil.getDictValue", "line_number": 16, "usage_type": "call" }, { "api_name": "com.pajk.plazass.utils.DictUtil", "line_number": 16, "usage_type": "name" }, ...
293804545
""" url = http://www.tmsf.com/newhouse/property_searchall.htm city:杭州 CO_INDEX: 15 小区数:2066 """ from retry import retry from backup.crawler_base import Crawler from backup.comm_info import Comm, Building, House from backup.get_page_num import AllListUrl from backup.producer import ProducerListUrl import requests, re u...
null
hilder_gv/crawler/hangzhou_15.py
hangzhou_15.py
py
6,108
python
en
code
null
code-starcoder2
66
[ { "api_name": "backup.crawler_base.Crawler", "line_number": 21, "usage_type": "name" }, { "api_name": "backup.get_page_num.AllListUrl", "line_number": 29, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 40, "usage_type": "call" }, { "api_name"...
407912601
import requests import json import twilio.rest #from twilio.rest import Client def make_request_params(**kwargs): try: apiUrl = kwargs["apiUrl"] except: return ({"testing_apis function": "The main url for the API is missing"}) try: apiEndpoint = kwargs["apiEndpoint"] # Add ...
null
api_relay/making_requests.py
making_requests.py
py
1,198
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.get", "line_number": 21, "usage_type": "call" }, { "api_name": "twilio.rest.rest.Client", "line_number": 33, "usage_type": "call" }, { "api_name": "twilio.rest.rest", "line_number": 33, "usage_type": "attribute" }, { "api_name": "twilio.res...
597589695
# import necessary library from urllib.request import urlopen from bs4 import BeautifulSoup import csv import re # make page request and beautifulsoup object page=urlopen("http://www.jnu.ac.in") html=BeautifulSoup(page.read(),"lxml") link_set=set() # find only those link that start from http! for link i...
null
hello.py
hello.py
py
1,035
python
en
code
null
code-starcoder2
66
[ { "api_name": "urllib.request.urlopen", "line_number": 9, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 10, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 14, "usage_type": "call" }, { "api_name": "csv.writer", "...
509514822
import time import cv2 import numpy as np from flask import Flask, render_template, Response class VideoCamera(object): def __init__(self): # 通过opencv获取实时视频流 self.video = cv2.VideoCapture(0) def __del__(self): self.video.release() # def get_frame(self): # # success, ima...
null
main.py
main.py
py
1,584
python
en
code
null
code-starcoder2
66
[ { "api_name": "cv2.VideoCapture", "line_number": 12, "usage_type": "call" }, { "api_name": "flask.Flask", "line_number": 25, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 31, "usage_type": "call" }, { "api_name": "time.sleep", "...
56801702
#!/usr/bin/env python # coding: utf-8 # In[386]: import numpy as np import matplotlib as plt import csv import os import re import pandas as pd from matplotlib import cycler # In[387]: # colors = cycler('color', # ['#EE6666', '#3388BB', '#9988DD', # '#EECC55', '#88BB44', '#FFBBBB...
null
XPS/plotxps.py
plotxps.py
py
3,210
python
en
code
null
code-starcoder2
66
[ { "api_name": "matplotlib.style.use", "line_number": 26, "usage_type": "call" }, { "api_name": "matplotlib.style", "line_number": 26, "usage_type": "attribute" }, { "api_name": "os.getcwd", "line_number": 51, "usage_type": "call" }, { "api_name": "os.listdir", ...
654347526
from django.contrib.auth.decorators import login_required from django.shortcuts import get_object_or_404 from django.urls import reverse from django.http import HttpResponse, HttpResponseRedirect from django.template import loader from django.utils.translation import gettext_lazy as _ from django.core.paginator import ...
null
apart/v_price.py
v_price.py
py
3,705
python
en
code
null
code-starcoder2
66
[ { "api_name": "models.Apart.objects.filter", "line_number": 20, "usage_type": "call" }, { "api_name": "models.Apart.objects", "line_number": 20, "usage_type": "attribute" }, { "api_name": "models.Apart", "line_number": 20, "usage_type": "name" }, { "api_name": "dj...
146991600
import base64 import json from datetime import datetime from urllib.parse import urlparse, urljoin import mysql.connector import requests import mysql.connector from bs4 import BeautifulSoup conn = mysql.connector.connect( host="167.86.120.98", port="3307", database="test_portales", user="eze_ellena", passw...
null
ScrapPrincipalDeWordpress.py
ScrapPrincipalDeWordpress.py
py
13,329
python
en
code
null
code-starcoder2
66
[ { "api_name": "mysql.connector.connector.connect", "line_number": 11, "usage_type": "call" }, { "api_name": "mysql.connector.connector", "line_number": 11, "usage_type": "attribute" }, { "api_name": "mysql.connector", "line_number": 11, "usage_type": "name" }, { "...
357166959
from aiohttp import web import json from basic.schema.football import FootballRequest, FootballResponse from basic.model.football_poisson import calc_mw async def post(request): try: data = await request.json() try: jreq = FootballRequest(data) jreq.validate() ...
null
basic-distributed/rest-gateway.py
rest-gateway.py
py
1,334
python
en
code
null
code-starcoder2
66
[ { "api_name": "basic.schema.football.FootballRequest", "line_number": 12, "usage_type": "call" }, { "api_name": "basic.model.football_poisson.calc_mw", "line_number": 16, "usage_type": "call" }, { "api_name": "basic.schema.football.FootballResponse", "line_number": 21, "u...
91032434
import time import json from mpl_visualization import MPLWebDisplay from spider_web import Spider from record_web_data import morph_gather_points_dict_to_something_useable, direction_map from record_data_for_spider_locating import assign_each_point_in_web_a_radial_fraction # from learning_model import SpiderModel fro...
null
spider_locating_visualization.py
spider_locating_visualization.py
py
25,694
python
en
code
null
code-starcoder2
66
[ { "api_name": "collections.OrderedDict", "line_number": 18, "usage_type": "call" }, { "api_name": "record_web_data.direction_map.items", "line_number": 18, "usage_type": "call" }, { "api_name": "record_web_data.direction_map", "line_number": 18, "usage_type": "name" }, ...
229575312
from django.shortcuts import render # Create your views here. from django.http import HttpResponse from django.utils import timezone def homepage(request): now = timezone.now() html = """ <!DOCTYPE html> <html> <head></head> <body> <h1>Sample Django page</h1> <...
null
sample_app/views.py
views.py
py
417
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.utils.timezone.now", "line_number": 9, "usage_type": "call" }, { "api_name": "django.utils.timezone", "line_number": 9, "usage_type": "name" }, { "api_name": "django.http.HttpResponse", "line_number": 20, "usage_type": "call" } ]
331598475
# -*- coding: utf-8 -*- """ Author: John Hawkins Spring 2019 Code modified from online resource Original author: JTay Link: https://github.com/JonathanTay/CS-7641-assignment-1 """ import numpy as np import sklearn.model_selection as ms import pandas as pd from helpers import basicResults,makeTimingCurve,iterationLC ...
null
SVM_Lin.py
SVM_Lin.py
py
9,858
python
en
code
null
code-starcoder2
66
[ { "api_name": "sklearn.base.BaseEstimator", "line_number": 27, "usage_type": "name" }, { "api_name": "sklearn.base.ClassifierMixin", "line_number": 27, "usage_type": "name" }, { "api_name": "sklearn.utils.validation.check_X_y", "line_number": 37, "usage_type": "call" },...
96300364
from pyspark import SparkContext from pyspark import SparkConf def CreateSparkContext(): ''' spark配置: 1.显示在spark或 hadoop-yarn UI界面的App名称 2.设置不显示spark执行进度以免界面太乱 ''' sparkConf = SparkConf().setAppName('FilmRecommend') \ .set('spark.ui.showConsoleProgress','false') sc = SparkCont...
null
projects/电影信息推荐系统【HADOOP+SPARK】/SparkContext.py
SparkContext.py
py
1,729
python
en
code
null
code-starcoder2
66
[ { "api_name": "pyspark.SparkConf", "line_number": 10, "usage_type": "call" }, { "api_name": "pyspark.SparkContext", "line_number": 12, "usage_type": "call" } ]
149742557
import numpy as np import datetime as dt from datetime import timedelta, datetime import sqlalchemy from sqlalchemy.ext.automap import automap_base from sqlalchemy.orm import Session from sqlalchemy import create_engine, func, distinct, text, desc from flask import Flask, jsonify ##################################...
null
climate_app.py
climate_app.py
py
6,184
python
en
code
null
code-starcoder2
66
[ { "api_name": "sqlalchemy.create_engine", "line_number": 18, "usage_type": "call" }, { "api_name": "sqlalchemy.ext.automap.automap_base", "line_number": 20, "usage_type": "call" }, { "api_name": "flask.Flask", "line_number": 31, "usage_type": "call" }, { "api_name...
425949979
from threading import Thread import requests from queue import Queue import time from fake_useragent import UserAgent from lxml import etree class XiaomiSpider(): def __init__(self): self.url=' http://app.mi.com/categotyAllListApi?page={}&categoryId={}&pageSize=30' #存放所有url地址队列 self.q=Queue(...
null
spider/spider-5-多线程-增量爬取-动态加载网站数据/05_xiaomi_spider.py
05_xiaomi_spider.py
py
2,863
python
en
code
null
code-starcoder2
66
[ { "api_name": "queue.Queue", "line_number": 11, "usage_type": "call" }, { "api_name": "fake_useragent.UserAgent", "line_number": 12, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 20, "usage_type": "call" }, { "api_name": "lxml.etree.HTML", ...
182591782
import unittest import logging import os from parameterized import parameterized from bikesim.simulation.suspension_simulation import simulate_damper_sweep logging.getLogger().setLevel(logging.WARN) class TestKinematics(unittest.TestCase): """ Test a bunch of different arrangements of kinematics. eg: VPP...
null
tests/test_simulation.py
test_simulation.py
py
1,011
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 7, "usage_type": "call" }, { "api_name": "logging.WARN", "line_number": 7, "usage_type": "attribute" }, { "api_name": "unittest.TestCase", "line_number": 10, "usage_type": "attribute" }, { "api_name": "os.path.join...
458556972
#! /usr/bin/env python3 import os import requests path = "/data/feedback/" IP = "34.122.34.64" files = os.listdir(path) for f in files: data = {} with open(os.path.join(path, f)) as fd: lines = fd.readlines() data = { 'title': lines[0], 'name': lines[1], 'date' : lines[2], 'feedback': lines[3] } res...
null
upload_feedback.py
upload_feedback.py
py
456
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.listdir", "line_number": 9, "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": "requests.post", "line_number"...
465118369
#!/usr/bin/env python # ignore z axis # x is y and y is x!! import rospy from math import * from race.msg import drive_param from geometry_msgs.msg import PoseStamped from std_msgs.msg import Float64MultiArray import numpy as np from sympy import Point, Segment #from tf.transformations import euler_from_quaternion #...
null
navigation/Path_planning/pid_control.py
pid_control.py
py
3,989
python
en
code
null
code-starcoder2
66
[ { "api_name": "rospy.Publisher", "line_number": 17, "usage_type": "call" }, { "api_name": "race.msg.drive_param", "line_number": 17, "usage_type": "argument" }, { "api_name": "sympy.Point", "line_number": 45, "usage_type": "call" }, { "api_name": "sympy.Point", ...
110263638
import sys import pandas as pd from pathlib import Path from helpers import (find_text_file, find_csv_file, find_header, check_length, calculate_profile_fraction) if len(sys.argv) != 3: print(f"Use: python {sys.argv[0]} <country> <...
null
curves/demand/buildings/space_heating/script/buildings_space_heating.py
buildings_space_heating.py
py
3,536
python
en
code
null
code-starcoder2
66
[ { "api_name": "sys.argv", "line_number": 10, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 11, "usage_type": "attribute" }, { "api_name": "sys.exit", "line_number": 12, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 15...
50138314
from __future__ import division, print_function, unicode_literals from sacred import Experiment from sacred.observers import FileStorageObserver from utils.custom_observer import CustomObserver import itertools from config import ingredient_config from utils.path_utils import filelist, remove_files import lo...
null
code/step218_event_detect_active_learn_summary.py
step218_event_detect_active_learn_summary.py
py
20,842
python
en
code
null
code-starcoder2
66
[ { "api_name": "matplotlib.use", "line_number": 12, "usage_type": "call" }, { "api_name": "sacred.Experiment", "line_number": 47, "usage_type": "call" }, { "api_name": "config.ingredient_config", "line_number": 47, "usage_type": "name" }, { "api_name": "os.path.joi...
284288259
from flask import Flask from flask import url_for from flask import redirect from flask import render_template from DataStore.MySQL import MySQL dns = { 'user': 'mysql', 'host': 'localhost', 'password': 'NewPassword', 'database': 'kaggle' } db = MySQL(**dns) app = Flask(__name__) @app.route('/') def ...
null
step4/index.py
index.py
py
1,319
python
en
code
null
code-starcoder2
66
[ { "api_name": "DataStore.MySQL.MySQL", "line_number": 13, "usage_type": "call" }, { "api_name": "flask.Flask", "line_number": 15, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 20, "usage_type": "call" }, { "api_name": "flask.render_...
391735757
# -*- coding: utf-8 -*- """ Created on Wed Sep 07 08:50:42 2016 @author: Lh Long """ import pyodbc def connect_db(): cnxn = pyodbc.connect('DRIVER={SQL Server};SERVER=xxxx.database.windows.net;DATABASE=DS_Crawling;UID=ds_crawling;PWD=xxxxx;CHARSET=UTF8') cursor = cnxn.cursor() return cursor def insert_Li...
null
connect_sql.py
connect_sql.py
py
1,503
python
en
code
null
code-starcoder2
66
[ { "api_name": "pyodbc.connect", "line_number": 10, "usage_type": "call" } ]
380392022
import logging import sys from django.core.mail import send_mail from django.http import HttpResponseRedirect, JsonResponse, Http404 from django.urls import reverse from django.utils import timezone from django.shortcuts import render from django.views.decorators.csrf import csrf_exempt from akutepov import settings...
null
main/views.py
views.py
py
4,445
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 16, "usage_type": "call" }, { "api_name": "main.models.Post.objects.filter", "line_number": 25, "usage_type": "call" }, { "api_name": "main.models.Post.objects", "line_number": 25, "usage_type": "attribute" }, { "a...
195669670
from os import listdir from os.path import isfile, join import cherrypy import click import pandas as pd class ReviewService(object): def __init__(self, folder_dir): csv_files = [f for f in listdir(folder_dir) if isfile(join(folder_dir, f)) and f.endswith('.csv')] self.date_df_dict = {} ...
null
reviewservice.py
reviewservice.py
py
2,090
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.listdir", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path.isfile", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 12, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_nu...
646024939
""" Created by: Nathan Starkweather Created on: 04/09/2016 Created in: PyCharm Community Edition """ import string import itertools from cext import type_slots from . import srcindenter, parse __author__ = 'Nathan Starkweather' import logging logger = logging.getLogger(__name__) _h = logging.StreamHandler() _f =...
null
cext/c_types.py
c_types.py
py
14,759
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 19, "usage_type": "call" }, { "api_name": "logging.StreamHandler", "line_number": 20, "usage_type": "call" }, { "api_name": "logging.Formatter", "line_number": 21, "usage_type": "call" }, { "api_name": "logging.DEB...
539955188
import warnings warnings.filterwarnings("ignore", category=FutureWarning) import joblib import logging import numpy as np import pandas as pd from typing import List, Tuple, Dict, Union import matplotlib.pyplot as plt # Models import umap import hdbscan from sentence_transformers import SentenceTransformer from sklea...
null
bertopic/model.py
model.py
py
26,986
python
en
code
null
code-starcoder2
66
[ { "api_name": "warnings.filterwarnings", "line_number": 2, "usage_type": "call" }, { "api_name": "utils.create_logger", "line_number": 21, "usage_type": "call" }, { "api_name": "typing.Union", "line_number": 91, "usage_type": "name" }, { "api_name": "typing.Tuple"...
622978843
# Copyright 2015 Brocade Communications System, Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # #...
null
networking_brocade/vyatta/common/utils.py
utils.py
py
3,724
python
en
code
null
code-starcoder2
66
[ { "api_name": "collections.namedtuple", "line_number": 23, "usage_type": "call" }, { "api_name": "eventlet.greenthread.sleep", "line_number": 37, "usage_type": "call" }, { "api_name": "eventlet.greenthread", "line_number": 37, "usage_type": "name" }, { "api_name":...
456735612
from __future__ import division # %env CUDA_VISIBLE_DEVICES=0 import os import argparse import sys import numpy as np import tensorflow as tf import keras.backend as K from termcolor import colored from keras.models import Model from keras.losses import categorical_crossentropy from keras.optimizers import Adam, SGD ...
null
scripts/cifra100.py
cifra100.py
py
5,665
python
en
code
null
code-starcoder2
66
[ { "api_name": "PIL.ImageFile.LOAD_TRUNCATED_IMAGES", "line_number": 27, "usage_type": "attribute" }, { "api_name": "PIL.ImageFile", "line_number": 27, "usage_type": "name" }, { "api_name": "argparse.ArgumentParser", "line_number": 31, "usage_type": "call" }, { "ap...
249320217
from django import template from django.template.defaultfilters import stringfilter from django.utils.html import conditional_escape from django.utils.safestring import mark_safe import markdown register = template.Library() @register.filter(name="markdown", needs_autoescape=True) @stringfilter def markdown_filter(va...
null
utils/markdown_tags.py
markdown_tags.py
py
1,041
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.template.Library", "line_number": 7, "usage_type": "call" }, { "api_name": "django.template", "line_number": 7, "usage_type": "name" }, { "api_name": "django.utils.html.conditional_escape", "line_number": 13, "usage_type": "name" }, { "api_na...
48821790
#coding:utf-8 from elasticsearch import Elasticsearch,RequestsHttpConnection from datetime import datetime message = '2018-01-21 13:02:58 UTC:115.193.185.169(56040):root@web:[27117]:LOG:'\ 'duration: 18010.405 ms statement: select R.group_id, product_id, R.count' #message = '2018-01-21 13:02:58 UTC:115.193.18...
null
leopard/put_aws_es.py
put_aws_es.py
py
2,505
python
en
code
null
code-starcoder2
66
[ { "api_name": "datetime.datetime.now", "line_number": 10, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 10, "usage_type": "name" }, { "api_name": "elasticsearch.Elasticsearch", "line_number": 14, "usage_type": "call" }, { "api_name": "e...
235008324
# coding: utf-8 from django.conf import settings def admin_template_path(request): # default templates for "grappelli standalone" template_path = "admin/_grappelli/" if getattr(settings, 'ADMIN_TOOLS_INDEX_DASHBOARD', False): apps = getattr(settings, 'INSTALLED_APPS') if apps.count("admi...
null
3rd_party_apps/grappelli/context_processors.py
context_processors.py
py
791
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.conf.settings", "line_number": 10, "usage_type": "argument" }, { "api_name": "django.conf.settings", "line_number": 11, "usage_type": "argument" } ]
104963406
#!/usr/bin/env python3 from itertools import * from operator import * from functools import * from collections import defaultdict import re d = defaultdict(set) kd = defaultdict(set) tst = """ Step C must be finished before step A can begin. Step C must be finished before step F can begin. Step A must be finished be...
null
2018/python/day7.py
day7.py
py
2,692
python
en
code
null
code-starcoder2
66
[ { "api_name": "collections.defaultdict", "line_number": 9, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 10, "usage_type": "call" }, { "api_name": "re.findall", "line_number": 23, "usage_type": "call" } ]
324814428
import os import pygame size = width, height = 600, 300 screen = pygame.display.set_mode(size) def load_image(name, colorkey=None): fullname = os.path.join('data', name) try: image = pygame.image.load(fullname) except pygame.error as message: print('Cannot load image:', name) rais...
null
ср/gameover.py
gameover.py
py
1,478
python
en
code
null
code-starcoder2
66
[ { "api_name": "pygame.display.set_mode", "line_number": 5, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 5, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "...
554593196
#-*- coding: UTF-8 -*- import pytest from page.BookMeetings_page import Meetings from test_case import test_ALogin from selenium.webdriver.common.action_chains import ActionChains class TestBookmeeting: @pytest.mark.parametrize( "title", [("测试会议")], ids=["case5"] ) def test_book...
null
test_case/test_Bookmeetings.py
test_Bookmeetings.py
py
1,723
python
en
code
null
code-starcoder2
66
[ { "api_name": "page.BookMeetings_page", "line_number": 15, "usage_type": "name" }, { "api_name": "page.BookMeetings_page.Meetings", "line_number": 15, "usage_type": "call" }, { "api_name": "test_case.test_ALogin.Testlogin.test_login", "line_number": 16, "usage_type": "cal...
515071344
# -*- coding: utf-8 -*- """ Created on Thu Oct 1 23:01:26 2020 @author: sabbi """ #will set up a demo ProHS in LF set to run continuously at ~1kHz. #event will be hooked #Upon live acquisition, live fft will update as data comes in, if there #are enough samples (this example only does a single pixel) im...
null
LFAutomation/PythonWebinar/LiveFFT.py
LiveFFT.py
py
4,832
python
en
code
null
code-starcoder2
66
[ { "api_name": "sys.path.append", "line_number": 33, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 33, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 33, "usage_type": "attribute" }, { "api_name": "sys.path.append", "...
149597892
#%% import time import math import sys import argparse import cPickle as pickle import numpy as np from chainer import cuda, Variable, FunctionSet import chainer.functions as F from CharRNN import CharRNN, make_initial_state import codecs import MeCab #%% arguments parser = argparse.ArgumentParser() parser.add_argu...
null
sample.py
sample.py
py
2,730
python
en
code
null
code-starcoder2
66
[ { "api_name": "argparse.ArgumentParser", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.random.seed", "line_number": 30, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 30, "usage_type": "attribute" }, { "api_name": "MeCab.Tag...
201588411
#!/usr/bin/python3 -W ignore import argparse import json import requests import sys from os.path import expanduser home = expanduser("~") credsfile = home + "/.isilon_api_creds" try: cf = open(credsfile,'r') s = cf.readline().strip('\n') except OSError: print("Cannot open", credsfile ) headerstring = "Basic "...
null
job_start.py
job_start.py
py
1,002
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.expanduser", "line_number": 9, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 20, "usage_type": "call" }, { "api_name": "requests.post", "line_number": 35, "usage_type": "call" } ]
94748482
""" A collection of utility functions used to work with Graphs and Translations using real data. """ from .interval import Interval from .graphcreators import * from .genematcher import GeneMatchings import csv from offsetbasedgraph import CriticalPathsMultiPathInterval,\ FuzzyMultipathInterval from collections im...
null
offsetbasedgraph/graphutils.py
graphutils.py
py
11,269
python
en
code
null
code-starcoder2
66
[ { "api_name": "interval.Interval", "line_number": 40, "usage_type": "call" }, { "api_name": "offsetbasedgraph.GRCH38.AltLoci.from_file", "line_number": 44, "usage_type": "call" }, { "api_name": "offsetbasedgraph.GRCH38.AltLoci", "line_number": 44, "usage_type": "name" }...
147178386
import sys, math import numpy as np import Box2D from Box2D.b2 import (edgeShape, circleShape, fixtureDef, polygonShape, revoluteJointDef, contactListener) import gym from gym import spaces from gym.utils import seeding, EzPickle import pyglet from pyglet import gl FPS = 50 SCALE = 30.0 # affects how fast-paced th...
null
laser_hockey_env.py
laser_hockey_env.py
py
26,244
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.sqrt", "line_number": 30, "usage_type": "call" }, { "api_name": "numpy.sum", "line_number": 30, "usage_type": "call" }, { "api_name": "numpy.asarray", "line_number": 30, "usage_type": "call" }, { "api_name": "Box2D.b2.contactListener", "li...
125565608
import requests import unittest url = 'http://localhost:8000/api/user' command = {'data': {'user': {'name': 'bob', 'email': 'bob@gmail.com'}}, 'meta': {'token': 123}, 'type': 'user create'} for i in range(10): requests.post(url, json=command) responses = [] for i in range(10): responses.append(requests.get(u...
null
server/app/test.py
test.py
py
424
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.post", "line_number": 7, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 12, "usage_type": "call" } ]
324756535
import os import datetime import argparse import sys import pandas as pd import slack def main(arguments): parser = argparse.ArgumentParser( description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter) parser.add_argument('--date', help='task execution da...
null
tasks/post_result_to_slack.py
post_result_to_slack.py
py
1,228
python
en
code
null
code-starcoder2
66
[ { "api_name": "argparse.ArgumentParser", "line_number": 10, "usage_type": "call" }, { "api_name": "argparse.RawDescriptionHelpFormatter", "line_number": 12, "usage_type": "attribute" }, { "api_name": "datetime.datetime.strptime", "line_number": 16, "usage_type": "call" ...
487235386
# -*- coding: utf-8 -*- """ sphinx.util.i18n ~~~~~~~~~~~~~~~~ Builder superclass for all builders. :copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ import gettext import io from os import path from collections import namedtuple from babe...
null
pkgs/sphinx-1.3.5-py27_0/lib/python2.7/site-packages/Sphinx-1.3.5-py2.7.egg/sphinx/util/i18n.py
i18n.py
py
3,752
python
en
code
null
code-starcoder2
66
[ { "api_name": "collections.namedtuple", "line_number": 23, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 38, "usage_type": "call" }, { "api_name": "os.path", "line_number": 38, "usage_type": "name" }, { "api_name": "os.path.join", "line_...
146455590
from haystack.inputs import AutoQuery from haystack.query import SearchQuerySet from rest_framework.permissions import IsAuthenticated from rest_framework.views import APIView from rest_framework import generics from rest_framework import renderers as api_renderers from rest_framework.response import Response from rest...
null
contacts/api/views.py
views.py
py
2,615
python
en
code
null
code-starcoder2
66
[ { "api_name": "rest_framework.views.APIView", "line_number": 13, "usage_type": "name" }, { "api_name": "rest_framework.permissions.IsAuthenticated", "line_number": 15, "usage_type": "name" }, { "api_name": "rest_framework.renderers.JSONRenderer", "line_number": 18, "usage...
180270302
# coding: utf-8 # @Editorial Workflow # https://forum.omz-software.com/topic/2429/editorial-reminders/7 from __future__ import print_function import re import editor import dialogs import datetime import workflow import reminders action_in = workflow.get_input() for line in action_in.split('\n'): for name, s_ti...
null
editorial/editorial-reminders.py
editorial-reminders.py
py
3,248
python
en
code
null
code-starcoder2
66
[ { "api_name": "workflow.get_input", "line_number": 15, "usage_type": "call" }, { "api_name": "re.findall", "line_number": 17, "usage_type": "call" }, { "api_name": "reminders.Reminder", "line_number": 21, "usage_type": "call" }, { "api_name": "datetime.datetime", ...
234603420
import os import numpy as np import pandas as pd from PIL import Image import img_preprocess as imgUtils from rect_util import Rect class Parameters(object): #useful for individual testing... ''' FER+ reader parameters ''' def __init__(self, num_classes, height, width, determinisitc = False, shuffle = ...
null
resources/ai/src/loadData.py
loadData.py
py
7,746
python
en
code
null
code-starcoder2
66
[ { "api_name": "img_preprocess.compute_norm_mat", "line_number": 41, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 48, "usage_type": "call" }, { "api_name": "os.path", "line_number": 48, "usage_type": "attribute" }, { "api_name": "os.path.joi...
451528894
# Data Preprocessing Template # Importing the libraries import numpy as np import matplotlib.pyplot as plt import pandas as pd import datetime import time import gc import sklearn from sklearn.model_selection import GridSearchCV from sklearn.preprocessing import LabelEncoder from sklearn.preprocessing import Standa...
null
exercise/secondSheet/xgboost_month.py
xgboost_month.py
py
9,212
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.sum", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.abs", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.finfo", "line_number": 22, "usage_type": "call" }, { "api_name": "sklearn.preprocessing.StandardScaler"...
382773401
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ This program contains procedures for compiling and benchmarking all the functions in this project """ import os import numpy as np import matplotlib.pyplot as plt # Set fontsizes in figures params = {'legend.fontsize': 'large', 'axes.labelsize': 'large', ...
null
IN4200_HE1_15244/benchmark_automation.py
benchmark_automation.py
py
3,672
python
en
code
null
code-starcoder2
66
[ { "api_name": "matplotlib.pyplot.rcParams.update", "line_number": 20, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.rcParams", "line_number": 20, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot", "line_number": 20, "usage_type": "name" }, { ...
503321095
# Copyright (c) 2022 AllSeeingEyeTolledEweSew # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH # REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERC...
null
tests/tdummy.py
tdummy.py
py
7,601
python
en
code
null
code-starcoder2
66
[ { "api_name": "random.getrandbits", "line_number": 30, "usage_type": "call" }, { "api_name": "hashlib.sha1", "line_number": 37, "usage_type": "call" }, { "api_name": "hashlib.sha1", "line_number": 44, "usage_type": "call" }, { "api_name": "libtorrent.bencode", ...
115719300
""" Utility to plot the layers of the just ram network of the Deep q-network. Usage: plot_filters.py PICKLED_NN_FILE """ import matplotlib.pyplot as plt import cPickle import argparse import numpy as np import lasagne.layers parser = argparse.ArgumentParser() parser.add_argument('filename', type=str, nargs=1) args ...
null
deep_q_rl/plot_just_ram.py
plot_just_ram.py
py
1,034
python
en
code
null
code-starcoder2
66
[ { "api_name": "argparse.ArgumentParser", "line_number": 15, "usage_type": "call" }, { "api_name": "cPickle.load", "line_number": 20, "usage_type": "call" }, { "api_name": "lasagne.layers.layers.get_all_layers", "line_number": 21, "usage_type": "call" }, { "api_nam...
218283029
""" Copyright 2014-2016 Jiří Janoušek <janousek.jiri@gmail.com> Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the fo...
null
nuvolasdk/newproject.py
newproject.py
py
6,976
python
en
code
null
code-starcoder2
66
[ { "api_name": "argparse.ArgumentParser", "line_number": 34, "usage_type": "call" }, { "api_name": "nuvolasdk.utils.validate_app_id", "line_number": 60, "usage_type": "call" }, { "api_name": "nuvolasdk.utils", "line_number": 60, "usage_type": "name" }, { "api_name"...
429008754
# -*- coding: utf-8 -*- from odoo import api, fields, models, _ from odoo.addons.base.res.res_partner import FormatAddress from odoo.exceptions import UserError import datetime from dateutil.relativedelta import relativedelta class CrmTeam(models.Model): _inherit = "crm.team" @api.model @api.returns('se...
null
crm_sales_team/models/sales_team.py
sales_team.py
py
7,867
python
en
code
null
code-starcoder2
66
[ { "api_name": "odoo.models.Model", "line_number": 10, "usage_type": "attribute" }, { "api_name": "odoo.models", "line_number": 10, "usage_type": "name" }, { "api_name": "odoo.api.model", "line_number": 13, "usage_type": "attribute" }, { "api_name": "odoo.api", ...
119148750
import math import torch from torch import nn import torch.nn.functional as F from torch.distributions import Categorical from MCQ.layers import GumbelSoftmax from MCQ.models import PolicyTransformer, ValueTransformer class SharedNet(nn.Module): def __init__(self, m, k, d, hiddenDim, rate=0.1): super()....
null
src/MCQ/models/GumbelActorCritic.py
GumbelActorCritic.py
py
5,657
python
en
code
null
code-starcoder2
66
[ { "api_name": "torch.nn.Module", "line_number": 12, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 12, "usage_type": "name" }, { "api_name": "torch.nn.Linear", "line_number": 18, "usage_type": "call" }, { "api_name": "torch.nn", "line_nu...
590472663
import sys, time, codecs, re from selenium import webdriver from bs4 import BeautifulSoup DRIVER_PATH = './phantomjs' # You should change these. URL = 'http://english.chosun.com/site/data/html_dir/2016/01/29/2016012901539.html' SELECTOR = '#news_body_id > div > p' driver = webdriver.PhantomJS(DRIVER_PATH) driver.ge...
null
selector_checker.py
selector_checker.py
py
667
python
en
code
null
code-starcoder2
66
[ { "api_name": "selenium.webdriver.PhantomJS", "line_number": 12, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 12, "usage_type": "name" }, { "api_name": "bs4.BeautifulSoup", "line_number": 14, "usage_type": "call" } ]
568245480
import subprocess import setup_util import multiprocessing import os bin_dir = os.path.expanduser('~/FrameworkBenchmarks/installs/py2/bin') NCPU = multiprocessing.cpu_count() CIRCUS_INI = """\ [watcher:app] cmd = {BIN}/chaussette --fd=$(circus.sockets.app) --backend=meinheld hello.app use_sockets = True numprocesses ...
null
wsgi/setup.py
setup.py
py
990
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.expanduser", "line_number": 6, "usage_type": "call" }, { "api_name": "os.path", "line_number": 6, "usage_type": "attribute" }, { "api_name": "multiprocessing.cpu_count", "line_number": 7, "usage_type": "call" }, { "api_name": "subprocess.che...
401929436
""" cloudalbum/util/blacklist_helper.py ~~~~~~~~~~~~~~~~~~~~~~~ Handling JWT token for signed out user. :description: CloudAlbum is a fully featured sample application for 'Moving to AWS serverless' training course :copyright: © 2019 written by Dayoungle Jun, Sungshik Jou. :license: MIT, see LI...
null
LAB03/03-Cognito/backend/cloudalbum/util/jwt_helper.py
jwt_helper.py
py
3,516
python
en
code
null
code-starcoder2
66
[ { "api_name": "sqlalchemy.orm.exc.NoResultFound", "line_number": 46, "usage_type": "name" }, { "api_name": "flask.current_app.config", "line_number": 52, "usage_type": "attribute" }, { "api_name": "flask.current_app", "line_number": 52, "usage_type": "name" }, { "...
47569686
import uuid import pytest from elasticmagic import Document, Field from elasticmagic.types import Text class Car(Document): __doc_type__ = 'car' name = Field(Text()) @pytest.fixture def index_name(): return 'test-{}'.format(str(uuid.uuid4()).split('-')[0]) @pytest.fixture def car_docs(): yield ...
null
tests_integ/conftest.py
conftest.py
py
876
python
en
code
null
code-starcoder2
66
[ { "api_name": "elasticmagic.Document", "line_number": 9, "usage_type": "name" }, { "api_name": "elasticmagic.Field", "line_number": 12, "usage_type": "call" }, { "api_name": "elasticmagic.types.Text", "line_number": 12, "usage_type": "call" }, { "api_name": "uuid....
633178380
from PyQt5 import QtCore, QtGui, QtWidgets from PyQt5.QtWidgets import QApplication, QMainWindow, QMessageBox import sys from view.StepJudge_Fm import Ui_StepJudge class StepJudge_P(QtWidgets.QDialog, Ui_StepJudge): def __init__(self, Dialog=None, NeedShow=True): super(StepJudge_P, self).__init__() ...
null
featech/Top/Presenter/StepJudge_P.py
StepJudge_P.py
py
5,611
python
en
code
null
code-starcoder2
66
[ { "api_name": "PyQt5.QtWidgets.QDialog", "line_number": 6, "usage_type": "attribute" }, { "api_name": "PyQt5.QtWidgets", "line_number": 6, "usage_type": "name" }, { "api_name": "view.StepJudge_Fm.Ui_StepJudge", "line_number": 6, "usage_type": "name" }, { "api_name...
296540049
""" Building model utility function definitions MIT License Copyright (c) 2019 TUMCREATE <https://tum-create.edu.sg/> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, includi...
null
legacy/flexibility_model/model_building/building_utils.py
building_utils.py
py
8,614
python
en
code
null
code-starcoder2
66
[ { "api_name": "sqlite3.connect", "line_number": 54, "usage_type": "call" }, { "api_name": "glob.glob", "line_number": 72, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 72, "usage_type": "call" }, { "api_name": "os.path", "line_number": 7...
47880555
# ------------------------------------------------------------------------------ # Lux material shader node for Maya # # by Doug Hammond 05/2008 # # This file is licensed under the GPL # http://www.gnu.org/licenses/gpl-3.0.txt # # $Id$ # # ------------------------------------------------------------------------------ #...
null
luxPlugin/Lux/LuxNodes/ShaderNodes/carpaintShader.py
carpaintShader.py
py
4,071
python
en
code
null
code-starcoder2
66
[ { "api_name": "maya.OpenMayaMPx.MPxNode", "line_number": 25, "usage_type": "attribute" }, { "api_name": "maya.OpenMayaMPx", "line_number": 25, "usage_type": "name" }, { "api_name": "Lux.LuxNodes.ShaderNode.ShaderNode", "line_number": 25, "usage_type": "name" }, { ...
39095539
import matplotlib.pyplot as plt import numpy as np figmain, axmain = plt.subplots() figzoom, axzoom = plt.subplots() axmain.set(xlim=(-5, 5), ylim=(-75, 175), autoscale_on=False, title='Click to zoom') axzoom.set(xlim=(-2, 2), ylim=(-75, 175), autoscale_on=False, title='Zoom window') x = np.aran...
null
ToolDemo/TestMouseEvent.py
TestMouseEvent.py
py
1,423
python
en
code
null
code-starcoder2
66
[ { "api_name": "matplotlib.pyplot.subplots", "line_number": 4, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 4, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.subplots", "line_number": 5, "usage_type": "call" }, { "api_name": "...
156797233
""" File name: Loader.py Date created: 10/22/2015 Date last modified: 05/31/2016 Python version: 3.5.1 Description: A class containing a list of profiles, loaded in by file. Handle all file checking. """ ############### ### IMPORTS ### ############### from bin.Profile import Profile import os import a...
null
bin/Loader.py
Loader.py
py
5,867
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.isfile", "line_number": 63, "usage_type": "call" }, { "api_name": "os.path", "line_number": 63, "usage_type": "attribute" }, { "api_name": "os.access", "line_number": 66, "usage_type": "call" }, { "api_name": "os.F_OK", "line_number": 66...
368380551
# coding=utf-8 # Copyright (c) 2016 Janusz Skonieczny # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modi...
null
django_email_queue/models.py
models.py
py
5,876
python
en
code
null
code-starcoder2
66
[ { "api_name": "enum.IntEnum", "line_number": 37, "usage_type": "name" }, { "api_name": "django.utils.translation.ugettext_lazy", "line_number": 42, "usage_type": "call" }, { "api_name": "django.db.models.Model", "line_number": 59, "usage_type": "attribute" }, { "a...
517993565
import requests from bs4 import BeautifulSoup import json def get_title(): title_list = [] r = requests.get('http://news.163.com/rank/') soup = BeautifulSoup(r.text,'html.parser') infos = soup.find_all('a') for info in infos: if (len(info.text) > 5 and info.text != 'About Ne...
null
aproject/wc/toppc/wy.py
wy.py
py
543
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.get", "line_number": 7, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 8, "usage_type": "call" } ]
122563826
import data_sync.libs.constant import data_sync.libs.utils from awsglue.context import GlueContext from pyspark.context import SparkContext from pyspark.sql import SQLContext from awsglue.dynamicframe import DynamicFrame from awsglue.transforms import * from pyspark.sql.functions import lit ...
null
sample/data_sync/resource/activity_timeline/snap_comment.py
snap_comment.py
py
3,343
python
en
code
null
code-starcoder2
66
[ { "api_name": "pyspark.context.SparkContext.getOrCreate", "line_number": 22, "usage_type": "call" }, { "api_name": "pyspark.context.SparkContext", "line_number": 22, "usage_type": "name" }, { "api_name": "awsglue.context.GlueContext", "line_number": 23, "usage_type": "cal...
289850431
import json import os ''' Load all countries into memory as json ''' def load(fpath='./factbook.json'): countries = {} for root, dirs, files in os.walk(fpath): for filename in files: if '.json' in filename and len(filename) == 7: #print(root+'/'+filename) wit...
null
load.py
load.py
py
510
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.walk", "line_number": 9, "usage_type": "call" }, { "api_name": "json.load", "line_number": 14, "usage_type": "call" } ]
314444349
from copy import deepcopy from collections import defaultdict, namedtuple from random import choice, sample class Node(): def __init__(self, parent=None, rank=0): self.parent = parent if parent is not None else self self.rank = rank Edge = namedtuple('Edge', ('src', 'dst')) def random_select(_...
null
Algorithm/Course 1/week4.py
week4.py
py
1,898
python
en
code
null
code-starcoder2
66
[ { "api_name": "collections.namedtuple", "line_number": 12, "usage_type": "call" }, { "api_name": "random.sample", "line_number": 16, "usage_type": "call" }, { "api_name": "copy.deepcopy", "line_number": 71, "usage_type": "call" } ]
202481206
import os from os import listdir from os.path import isfile, join from datetime import datetime import subprocess class job: def __init__(self, dir, cmd, params): self.watchdir = dir self.cmd = cmd self.switches = params def execute(self, file): cmdText = "\"" + self.cmd + "\...
null
job.py
job.py
py
675
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.devnull", "line_number": 20, "usage_type": "attribute" }, { "api_name": "datetime.datetime.now", "line_number": 21, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 21, "usage_type": "name" }, { "api_name": "subprocess.ca...
294651659
#!/home/bam4d/anaconda3/envs/griddly/bin/python3 from timeit import default_timer as timer import numpy as np import gym import os import psutil from gym import register from griddly.util.wrappers import InvalidMaskingRTSWrapper process = psutil.Process(os.getpid()) def griddly(gdy_file): from griddly import Gy...
null
python/benchmarks/benchmark.py
benchmark.py
py
2,202
python
en
code
null
code-starcoder2
66
[ { "api_name": "psutil.Process", "line_number": 11, "usage_type": "call" }, { "api_name": "os.getpid", "line_number": 11, "usage_type": "call" }, { "api_name": "griddly.GymWrapperFactory", "line_number": 17, "usage_type": "call" }, { "api_name": "griddly.gd.Observe...
334460124
############################################################################## # # Copyright (C) Zenoss, Inc. 2018, all rights reserved. # # This content is made available according to terms specified in # License.zenoss under the directory where your Zenoss product is installed. # #####################################...
null
Products/ZenUtils/Auth0/Auth0Callback.py
Auth0Callback.py
py
2,775
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 21, "usage_type": "call" }, { "api_name": "Products.Five.browser.BrowserView", "line_number": 24, "usage_type": "name" }, { "api_name": "Products.ZenUtils.Auth0.getAuth0Conf", "line_number": 30, "usage_type": "call" }, ...
106860651
import os, cleverbot, Algorithmia, time import RPi.GPIO as GPIO from clarifai.client import ClarifaiApi cb1 = cleverbot.Cleverbot() os.system('fswebcam -r 1280x720 --no-banner face.jpg') #Clarifai's Authentication '''export CLARIFAI_APP_ID=Od35n5ZenyxFAj6AL0LCpH6r6uBkIQK0xeccxrIS export CLARIFAI_APP_SECRET=SIZNRJUO_...
null
app.py
app.py
py
1,645
python
en
code
null
code-starcoder2
66
[ { "api_name": "cleverbot.Cleverbot", "line_number": 5, "usage_type": "call" }, { "api_name": "os.system", "line_number": 7, "usage_type": "call" }, { "api_name": "clarifai.client.ClarifaiApi", "line_number": 14, "usage_type": "call" }, { "api_name": "Algorithmia.c...
152718777
from config import emotion_config as config from in_out.hdf5datasetwriter import HDF5DatasetWriter import numpy as np #Open the input file for reading (skipping header) then #Initialize the list of data and labels for the training #validation and testing sets print("[INFO] loading input data...") f = open(config.INPUT...
null
emotion_recognition/build_dataset.py
build_dataset.py
py
2,196
python
en
code
null
code-starcoder2
66
[ { "api_name": "config.emotion_config.INPUT_PATH", "line_number": 9, "usage_type": "attribute" }, { "api_name": "config.emotion_config", "line_number": 9, "usage_type": "name" }, { "api_name": "config.emotion_config.NUM_CLASSES", "line_number": 24, "usage_type": "attribute...
508410257
""" Created on Sep 5, 2014 @author: David Brookes This module builds a functioning Single Nucleotide Polymorphism effect predictor, which classifies input SNPs as either tolerated or deleterious to the mutated protein. It uses SNP properties (such as substitution score and hydrophobicity index of the mutated amino ac...
null
dbm/src/snp_predictor.py
snp_predictor.py
py
15,621
python
en
code
null
code-starcoder2
66
[ { "api_name": "dbfiles.Effect", "line_number": 79, "usage_type": "attribute" }, { "api_name": "dbfiles.Effect", "line_number": 81, "usage_type": "attribute" }, { "api_name": "Bio.SubsMat.MatrixInfo.available_matrices", "line_number": 195, "usage_type": "attribute" }, ...