id stringlengths 1 265 | text stringlengths 6 5.19M | dataset_id stringclasses 7
values |
|---|---|---|
1759824 | <reponame>kagemeka/atcoder-submissions<filename>jp.atcoder/abc062/arc074_b/9045925.py
import sys
from heapq import *
n, *a = map(int, sys.stdin.read().split())
def optimize(arr):
res = arr[:n]
heapify(res)
sum_arr = [sum(res)]
for x in arr[n:]:
y = heappop(res)
heappush(re... | StarcoderdataPython |
158797 | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | StarcoderdataPython |
1786923 | # Generated by Django 2.2.13 on 2021-02-09 07:28
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("occurrences", "0025_palvelutarjotinevent_payment_instruction"),
]
operations = [
migrations.RemoveField(
model_name="palvelutarjotineve... | StarcoderdataPython |
102628 | <filename>music/migrations/0002_auto_20200816_0917.py<gh_stars>0
# Generated by Django 3.0.6 on 2020-08-16 09:17
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('music', '0001_initial'),
]
operations = [
migrations.AlterField(
... | StarcoderdataPython |
3266791 | <gh_stars>0
#!/usr/bin/env python
"""
authors: stanbaek, apullin
"""
from lib import command
import time,sys,os,traceback
import serial
# Path to imageproc-settings repo must be added
sys.path.append(os.path.dirname("../../imageproc-settings/"))
sys.path.append(os.path.dirname("../imageproc-settings/")) # Some p... | StarcoderdataPython |
94384 | __author__ = "<NAME>"
__copyright__ = "Copyright 2015, <NAME>"
from abc import ABCMeta, abstractstaticmethod
from collections import defaultdict, Counter
class ReorderingTransform(metaclass=ABCMeta):
@abstractstaticmethod
def iter_byte_indexes(len_bytes):
"""
:param len_bytes:
:type... | StarcoderdataPython |
4819667 | <filename>setup.py<gh_stars>1-10
from setuptools import find_packages, setup
setup(
name="synthetic-signs",
version="0.0.0",
author="DAS",
url="https://gitlab.mobilityservices.io/am/roam/perception/experiments/"
"synthetic-signs",
description="Synthetic sign dataset generation and training tool... | StarcoderdataPython |
184418 | <filename>daily coding problem/11.py
def take_List(li,Qu_st):
r=[]
for i in range(len(li)):
if(Qu_st in li[i] ):
r.append(li[i])
print(r)
li=['sser','ser','song']
q='ss'
take_List(li,q)
| StarcoderdataPython |
1749152 | <gh_stars>0
from __future__ import unicode_literals
import frappe
from frappe import _, throw
from ets.utils import update_budjet_cost
def validate(doc,method):
# ets_logger.debug(f"{doc} - {method}")
# ets_logger.debug(doc.items)
# for item in doc.items:
# pass
pass
def on_update(doc,state):
# ets_logger.deb... | StarcoderdataPython |
3240046 | <reponame>VictorXLR/cog
# Prediction interface for Cog ⚙️
# Reference: https://github.com/replicate/cog/blob/main/docs/python.md
import cog
# import torch
class Predictor(cog.Predictor):
def setup(self):
"""Load the model into memory to make running multiple predictions efficient"""
# self.model = tor... | StarcoderdataPython |
1712708 | <reponame>pierfra-ro/astrobase<gh_stars>10-100
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# transits.py
# <NAME> and <NAME> - Feb 2017
# (<EMAIL> and <EMAIL>)
'''Fitting routines for planetary transits:
- :py:func:`astrobase.lcfit.transits.traptransit_fit_magseries`: fit a
trapezoid-shaped transit signal to the... | StarcoderdataPython |
1677716 | <filename>psdaq/psdaq/control/ControlDef.py
from datetime import datetime, timezone
class ControlDef:
# transitionId is a subset of the TransitionId.hh enum
transitionId = {
'ClearReadout' : 0,
'Reset' : 1,
'Configure' : 2,
'Unconfigure' : 3,
... | StarcoderdataPython |
1777877 | '''
Created on May 13, 2019
@author: <NAME>
@mail: <EMAIL>
'''
from flask_restful import Resource
class HealthHandler(Resource):
def get(self):
return '', 200 | StarcoderdataPython |
50550 | import praw
import prawcore
import requests
import pprint
import json
import time
from crawler_lib import send_message, keyword_match
import ConfigParser
config = ConfigParser.ConfigParser()
config.read('/etc/reddit-crawler/config.ini')
reddit = praw.Reddit(user_agent=config.get('reddit','user_agent'),
... | StarcoderdataPython |
3208590 | first_name = ' albert '
last_name = 'einstein '
famous_person = first_name + last_name
message = famous_person.title()
print (message)
print ("\t" + message.lstrip() + "\n\t" + message.rstrip() + "\n\t" + message.strip()) | StarcoderdataPython |
3395866 | <gh_stars>10-100
scope = "Interconnect_tb.dut"
inputs = [
"SB_T0_EAST_SB_IN_B1",
"SB_T0_EAST_SB_IN_B16",
"SB_T0_NORTH_SB_IN_B1",
"SB_T0_NORTH_SB_IN_B16",
"SB_T0_SOUTH_SB_IN_B1",
"SB_T0_SOUTH_SB_IN_B16",
"SB_T0_WEST_SB_IN_B1",
"SB_T0_WEST_SB_IN_B16",
"SB_T1_EAST_SB_IN_B1",
"SB_T1... | StarcoderdataPython |
3366200 | n, k = map(int, input().split())
r = list(map(int, input().split()))
r.sort()
ans = 0
for i in range(k):
ans = (ans + r[-k + i]) / 2
print(ans)
| StarcoderdataPython |
3212844 | <gh_stars>0
# Generated by Django 3.1.7 on 2021-03-31 17:57
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('user', '0011_auto_20210331_2327'),
]
operations = [
migrations.AlterField(
model_name='user',
name='invi... | StarcoderdataPython |
3307238 | # Time: O(n)
# Space: O(logn)
# Definition for singly-linked list.
# class ListNode:
# def __init__(self, x):
# self.val = x
# self.next = None
# Definition for a binary tree node.
# class TreeNode:
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right... | StarcoderdataPython |
3306301 | from __future__ import division
from cctbx.examples.g_exp_i_alpha_derivatives \
import parameters, gradients, pack_gradients, g_exp_i_alpha_sum
from cctbx.examples.exp_i_alpha_derivatives import least_squares
from libtbx.test_utils import approx_equal
import random
import math
import copy
from cStringIO import String... | StarcoderdataPython |
1651733 | #-*-coding:utf-8-*-
import sys
from flask import Flask,request,render_template
import json
from etc.settings import DEBUG,receiver_file,register_server_port,web_log,LOG_DIRECTORY,RESOURCES_DIRECTORY
from threading import Lock
from os import remove, devnull
from shutil import move
from logger import *
app=Flask(__name... | StarcoderdataPython |
1704272 | <reponame>rt-ispace/SNC<gh_stars>1-10
'''
////////////////////////////////////////////////////////////////////////////
//
// This file is part of SNC
//
// Copyright (c) 2014-2021, <NAME>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documenta... | StarcoderdataPython |
57046 | import threading
import numpy as np
import time
import rospy
from sensor_msgs import point_cloud2
from std_msgs.msg import Header
from sensor_msgs.msg import PointCloud2, PointField
from stella_nav_core.geometry_utils import GeometryUtils
from stella_nav_core.config import CostConfig, MotionConfig
class State(object)... | StarcoderdataPython |
4835190 | <reponame>uclaml/Frank-Wolfe-AdvML<gh_stars>10-100
import tensorflow as tf
import numpy as np
import random
import time
import sys
import pickle
import json
from classifier import classifier
from utils import *
from FW import FW
import argparse
def generate_data(data, samples, targeted=True, start=0, num_attacks =... | StarcoderdataPython |
3241052 | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | StarcoderdataPython |
3380406 | <reponame>TolimanStaR/AtomicJudge<gh_stars>0
import os
import psycopg2
import time
from multiprocessing import Queue
import threading
import datetime
from typing import List
from .config import *
from .models import SingletonMixin, Solution, Status, DataBase, CodeFile, Event, Test, SolutionEventType
from .service i... | StarcoderdataPython |
45872 | <filename>api/stats.py
from flask import request
from flask_jwt_extended import get_jwt_identity, jwt_required
from flask_restx import Namespace, Resource, fields
from models import Stats
stats_ns = Namespace('stats', description='A namespace for stats.')
stats_model = stats_ns.model('Stats', {
'id': fields.Inte... | StarcoderdataPython |
3270468 | <filename>PDF_FILES_MANIPULATING/A.PdfFileReader Class/Problems_Reader_Class.py
from PyPDF2 import PdfFileReader
from PyPDF2.generic import Destination
from PyPDF2.generic import PdfObject
file1 = open('pdf1.pdf','rb')
filer = PdfFileReader(file1)
"""
dest = Destination(PdfObject(),25,'/Fit')#'Jointe au CV'
print(filer... | StarcoderdataPython |
3230415 | from keras.engine import Layer
import tensorflow as tf
class LetterBoxLayer(Layer):
def __init__(self,net_size,**kwargs):
super(LetterBoxLayer, self).__init__(**kwargs)
self.net_size = net_size
# save config to save and load the keras model correctly
def get_config(self):
... | StarcoderdataPython |
3247820 | <gh_stars>0
# Python code for Ten Games for the Circuit Playground Express
# by <NAME>
# Copyright (c) 2020 <NAME> All rights reserved
# Buy the book at https://www.amazon.com/author/rleander
#
# Whack-a-Pixel
from adafruit_circuitplayground import cp
import random
import time
#constants
max_moles... | StarcoderdataPython |
61387 | # Display the ip's from all network interfaces on the display
import time
import Adafruit_Nokia_LCD as LCD
import Adafruit_GPIO.SPI as SPI
import netifaces
from PIL import Image
from PIL import ImageDraw
from PIL import ImageFont
# Raspberry Pi hardware SPI config:
DC = 23
RST = 24
SPI_PORT = 0
SPI_DEVICE = 0
# Ra... | StarcoderdataPython |
1661777 | from django import template
from django.template.loader import render_to_string
register = template.Library()
import settings
@register.simple_tag
def cms_facebook_likebox(likebox_name):
from cms_facebook.models import LikeBox
try:
likebox = settings.CMS_FACEBOOK_LIKEBOX[likebox_name]
except Looku... | StarcoderdataPython |
3343887 | # Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import abc
import argparse
from dataclasses import dataclass, field, make_dataclass, fields
import inspect
from typing import List
from cli im... | StarcoderdataPython |
1741427 | <filename>icekit/plugins/image/migrations/0020_auto_20170317_1655.py<gh_stars>10-100
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('icekit_plugins_image', '0019_merge'),
]
operati... | StarcoderdataPython |
182555 | import os
import shutil
path_list = [
'../ip/ahi/src/ahi.c',
'../ip/ahi/src/ahi_task.c',
'../ip/ea/src/ea.c',
'../ip/hci/src/hci.c',
'../ip/hci/src/hci_fc.c',
'../ip/hci/src/hci_msg.c',
'../ip/hci/src/hci_tl.c',
'../ip/hci/src/hci_util.c',
'../ip/ble/hl/src/gap/gapc/gapc.c',
'..... | StarcoderdataPython |
1695034 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-04-04 07:21
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('cohapp', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='textdata',
nam... | StarcoderdataPython |
1625815 | # Copyright 2012 Google 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
#
# Unless required by applicable law or ... | StarcoderdataPython |
1633351 | <filename>config/api_router.py
from django.conf import settings
from rest_framework.routers import DefaultRouter, SimpleRouter
from ssa412.users.api.views import UserViewSet
from ssoffices.api.views import SsOfficeViewSet, SsStaffViewSet
from matters.api.views import MatterViewSet
from products.api.views import Produc... | StarcoderdataPython |
70352 | from direct.directnotify import DirectNotifyGlobal
from toontown.toonbase import ToontownBattleGlobals
from toontown.suit import SuitDNA
BattleExperienceAINotify = DirectNotifyGlobal.directNotify.newCategory('BattleExprienceAI')
def getSkillGained(toonSkillPtsGained, toonId, track):
exp = 0
expList = toonSkill... | StarcoderdataPython |
3309269 | <filename>5 kyu/Simple Fun 188 Slogans.py
def slogans(p,r):
combo=set()
for i in range(len(p)):
for j in range(i, len(p)):
combo.add(p[i:j+1])
total=0
index=0
while True:
flag=True
for i in range(index, len(r)):
if r[index:i+1] not in combo:
... | StarcoderdataPython |
1752508 | from subprocess import Popen, PIPE, signal
import os
import re
from modules.webrequests import GetCPUHardwareData, UpdateSupportedDevices
from modules.deviceCacher import GetCachedDeviceData, CacheDevice
from modules.deviceInfoFormat import PrintError
CPUHardwareData = {}
def SetCPUHardwareData():
global CPUHar... | StarcoderdataPython |
1617719 | <reponame>eunchong/infra
# 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.
"""Provides a JSON endpoint for builder data as Trace Viewer Events
Given a master, builder, and build ID, queries chrome-build-ext... | StarcoderdataPython |
1710536 | name = 'i love JEHOVAH'
print(name.find('love'))
print(name.replace('love', 'honor'))
print('love' in name)
print(name.title())
| StarcoderdataPython |
4801567 | #!/usr/bin/env python3.6
# -*- coding: utf-8 -*-
import discord
from discord.ext import commands
from discord import utils
import asyncio
import random
import json
import time
with open('CYBORGBASEDATA.json') as json_data:
database = json.load(json_data)
prefix = database['prefixes']
greetings = ["Sup!", "Wass... | StarcoderdataPython |
140967 | <gh_stars>0
from pathlib import Path
from typing import Dict, Optional, Sequence, Tuple
from warnings import simplefilter
import epimargin.plots as plt
import numpy as np
import pandas as pd
from epimargin.estimators import analytical_MPVS, linear_projection
from epimargin.models import SIR, NetworkedSIR
from epimargi... | StarcoderdataPython |
3232766 | from rest_framework import serializers
from rest_framework.views import APIView
from rest_framework.permissions import IsAuthenticated
from drf_yasg import openapi
from drf_yasg.utils import swagger_auto_schema
from common.response import create_response, create_response_dict
from ..services import room_create_room
... | StarcoderdataPython |
1789175 | <gh_stars>1-10
#!/usr/bin/env python3
from jsonschema import Draft6Validator
import fastjsonschema
import os
from pathlib import Path
import json
import glob
import re
class Validator:
""" Parent Validator will hold the core validation and error interpreting, while the children
classes will handle versions o... | StarcoderdataPython |
4814119 | import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
def plot_attention(attention, sentence, predicted_sentence):
fig = plt.figure(figsize=(10, 10))
ax = fig.add_subplot(1, 1, 1)
ax.matshow(attention, cmap='viridis')
fontdict = {'fontsize': 14}
ax.set_xticklabels([''] + ... | StarcoderdataPython |
54877 | <reponame>RadostW/stochastic
import pychastic # solving sde
import pygrpy.jax_grpy_tensors # hydrodynamic interactions
import pywrithe # computing writhe of closed curve
import jax.numpy as jnp # jax array operations
import jax #... | StarcoderdataPython |
3320250 | <gh_stars>1-10
# -*- coding: utf-8 -*-
"""
Created on Sun Sep 22 11:50:20 2019
@author: abhis
"""
import cv2
import numpy as np
import math
from scipy.spatial import distance
import ctypes
import time
SendInput = ctypes.windll.user32.SendInput
def releaseall():
ReleaseKey(A)
ReleaseKey(D)
Rele... | StarcoderdataPython |
1726436 | <filename>sensirion_i2c_svm40/commands/__init__.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# flake8: noqa
from __future__ import absolute_import, division, print_function
from .generated import \
Svm40I2cCmdGetSerialNumber, \
Svm40I2cCmdDeviceReset, \
Svm40I2cCmdStartContinuousMeasurement, \
Svm... | StarcoderdataPython |
126277 | <filename>python/testData/mover/lastLine.py<gh_stars>1-10
print "first"
print "second"<caret> | StarcoderdataPython |
192156 | ALLELE_COLUMNS_START = 5
NUMBERS_COLUMN = 2
| StarcoderdataPython |
3275358 | <filename>testing/vaegan_test.py
import sys
sys.path.append('../')
from generator.vaegan_generator import celeba_image_generator, humanm_image_generator
from keras.models import load_model
from models.vaegan_models import build_test_encoder, build_encoder
from utils.utils import count_celeba_data, count_humanm_data
im... | StarcoderdataPython |
120772 | <reponame>ChiChou/wiggle
from django.apps import AppConfig
class WiggleConfig(AppConfig):
name = 'wiggle'
| StarcoderdataPython |
3318358 | <gh_stars>1-10
# -*- coding: utf-8 -*-
"""
Created on Fri Sep 18 16:56:47 2015
@author: prakhar
"""
from urllib2 import urlopen
from bs4 import BeautifulSoup
import requests
import urlparse
import sqlite3
import re
import tweepy
import subprocess
import datetime
#mainURL
url = 'http://www.news18.com/search-result.... | StarcoderdataPython |
4829602 | # -*- coding: utf-8 -*-
# Author: <NAME> <<EMAIL>>
# License: BSD 3 clause
"""
Prepare Dapi images for nuclei segmentation.
"""
import os
import argparse
import shutil
from utils import check_directories, initialize_script, end_script
from loader import get_fov_names
import bigfish.stack as stack
if __name__ == "_... | StarcoderdataPython |
118164 | <reponame>artem-astafyev/plate-recognition
import time
import cv2
import numpy as np
from numpy.linalg import norm
import helper as hp
class StatModel(object):
def load(self, fn):
self.model.load(fn)
def save(self, fn):
self.model.save(fn)
class SVM(StatModel):
def __init__(self, C=1,... | StarcoderdataPython |
149202 | import sys
[_, fai, window] = sys.argv
window = int(window)
with open(fai, 'r') as f:
for line in f:
dat = line.split("\t")
CHR = dat[0]
END = int(dat[1])
i = 1
while True:
print(CHR + '\t' + str(i) + '\t' + str(i + window - 1))
i += window
... | StarcoderdataPython |
132740 | from pyecharts import options as opts
from pyecharts.charts import Tree
data = [
{
"children": [
{"name": "B"},
{
"children": [{"children": [{"name": "I"}], "name": "E"}, {"name": "F"}],
"name": "C",
},
{
"chil... | StarcoderdataPython |
1757892 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Copyright (c) 2014-2019, <NAME> <EMAIL>
from os.path import join, dirname, basename
from vunit import VUnit, ROOT
fr... | StarcoderdataPython |
116851 | #!/usr/bin/env python
# Created 01/26/15 by <NAME>
# Program to create VPD images from input template files
# IBM_PROLOG_BEGIN_TAG
# This is an automatically generated prolog.
#
# OpenPOWER HostBoot Project
#
# Contributors Listed Below - COPYRIGHT 2010,2014
# [+] International Business Machines Corp.
#
#
# Licensed u... | StarcoderdataPython |
3205219 | # Copyright 2016 PerfKitBenchmarker Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | StarcoderdataPython |
1609603 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import gi
try:
gi.require_version('Gtk', '3.0')
except ValueError:
exit(1)
from gi.repository import Gtk
if __name__ == '__main__':
dialog = Gtk.Dialog.new()
dialog.set_title('https://www.atareao.es')
dialog.add_button('Si', Gtk.ResponseType.YES)
... | StarcoderdataPython |
190120 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
from tests.test_api.utils import TestBaseApi
from polyaxon_client.api.base import BaseApiHandler
from polyaxon_client.exceptions import ERRORS_MAPPING
class DummyConfig(object):
@staticmethod
def from_dict(value):
... | StarcoderdataPython |
1630945 | #!/usr/bin/python
from gimpfu import *
import datetime
def python_cut_selection_to_jpg(timg, tdrawable):
pdb.gimp_edit_cut(timg.active_layer)
tempImage = pdb.gimp_edit_paste_as_new()
layer = pdb.gimp_image_flatten(tempImage)
timeText = datetime.datetime.now().strftime("%Y-%m-%d--%H-%M-%S")
output... | StarcoderdataPython |
59183 | class DatabaseNotConnectedException(Exception):
"""This exception is raised when collection is accessed however database is
not connected.
"""
def __init__(self, message: str):
self.message = message
super().__init__(self.message)
| StarcoderdataPython |
3245474 | default_app_config = 'NewPee.apps.NewPeeConfig' | StarcoderdataPython |
3293566 | AUTHOR = '<EMAIL>'
DESCRIPTION = 'Measurement and parental lineage'
# MONGODB_VIEW_NAME = 'measurement_view'
| StarcoderdataPython |
8642 | """
第二版:多进程二手房信息爬虫
1. 将爬虫分解为下载任务和解析任务(可以继续分解,但在本案中意义不大)两部分,两部分各使用一个子进程,相互通过数据管道通信
2. 下载任务内部不使用队列,使用任务管道实现(在多进程:主进程、子进程、子进程内部进程池等场景下,队列并不好用)任务管理和通信
3. 解析任务从与下载任务间的管道中获取数据,解析并保存
问题:当目标被爬完后,怎样让爬虫停止?
"""
import csv
import datetime
import logging
import multiprocessing as mp
import re
import time
from collections import O... | StarcoderdataPython |
3353348 | # # -*- coding: utf-8 -*-
import logging
from django.http import HttpResponse, HttpResponseNotFound, HttpResponseNotAllowed
from django.views.decorators.csrf import csrf_exempt
from trello_webhooks.models import Webhook
logger = logging.getLogger(__name__)
@csrf_exempt
def api_callback(request, auth_token, trello_... | StarcoderdataPython |
3338695 | # Copyright (C) 2020-Present the hyssop authors and contributors.
#
# This module is part of hyssop and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
'''
File created: August 21st 2020
Modified By: hsky77
Last Updated: February 6th 2021 16:30:33 pm
'''
import os
import sys
i... | StarcoderdataPython |
1783294 | <gh_stars>1-10
from fastprogress.fastprogress import master_bar, progress_bar
from time import sleep
mb = master_bar(range(10))
for i in mb:
for j in enumerate(progress_bar(range(100), parent=mb)):
sleep(0.01)
# mb.child.comment = f'second bar stat'
# mb.main_bar.comment = f'first bar stat'
... | StarcoderdataPython |
1767493 | <reponame>mommy79/AuDi-GIT-turtlebot3_autorace
#!/usr/bin/env python
# -*-coding:utf-8-*-
import numpy as np
import cv2
import copy
class RectangleDetector:
def __init__(self):
self.process = list()
self.roi = list()
# HSV Range 관련 변수 (H:색상, S:채도, V:명도)
self.lower = {'blue': np.ar... | StarcoderdataPython |
68239 | <reponame>alignan/python-msp430-tools
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2002-2012 <NAME> <<EMAIL>>
# All Rights Reserved.
# Simplified BSD License (see LICENSE.txt for full text)
"""\
JTAG programmer for the TI MSP430 embedded processor.
Requires Python 2+, ctypes and MSP430mspgcc.dll/li... | StarcoderdataPython |
4825664 | <filename>examples/scienceworld-web-server-example.py
# scienceworld-web-server-example.py
#
# Uses pywebio to open a simple web-based interface for running ScienceWorld in the web browser.
# After running, open a web browser and point to 'localhost:8080'.
# It may take a 5-10 seconds to initialize the server on ... | StarcoderdataPython |
1775300 | <gh_stars>1-10
"""
grades.py: Logic for storing points/comments while grading
"""
import os
import sys
import json
from typing import Set, Dict, Union, Optional, Tuple
import common.utils as utils
DEFAULT_LATE_PENALTY = .2
# Probably better to just look at a grades.json
GradesDictType = Dict[str, # Submitter
... | StarcoderdataPython |
154858 | from ._tier0 import *
from ._tier1 import *
from ._tier2 import *
from ._tier3 import *
from ._tier4 import *
from ._tier5 import *
from ._tier8 import *
from ._tier9 import *
from ._tier10 import *
from ._tier11 import *
__version__ = "0.12.0"
__common_alias__ = "cle"
| StarcoderdataPython |
3263596 | from django.urls import re_path, include
from . import views
urlpatterns = [
re_path(r'^my-courses/$', views.ManageCourseListView.as_view(), name='manage_course_list'),
re_path(r'^create/$', views.CourseCreateView.as_view(), name='course_create'),
re_path(r'^(?P<pk>\d+)/edit/$', views.CourseUpdateView.as_v... | StarcoderdataPython |
1653487 | from project.baked_food.bread import Bread
from project.baked_food.cake import Cake
from project.drink.tea import Tea
from project.drink.water import Water
from project.table.inside_table import InsideTable
from project.table.outside_table import OutsideTable
class Bakery:
def __init__(self, name):
self.n... | StarcoderdataPython |
1699666 | import json
f = open('US.txt')
lines = f.readlines()
countyArray = []
for l in lines:
l = l.split('\t')
countyArray.append({'name': l[2], 'state': l[4], 'countyName': l[5], 'countyCode': l[6]})
f = open('population.txt')
countyPop = {}
lines = f.readlines()
for l in lines:
l = l.split(',')
countyPop[l[0]] = l[1]
... | StarcoderdataPython |
3391595 | <reponame>valera-rozuvan/blender-demos<gh_stars>0
import bpy
import os
# format integer with leading zeros
def formatNumbers(number, length):
return '%0*d' % (length, number)
# get the scene
scn = bpy.context.scene
# get the output path
output_path = scn.render.filepath
# set filename
filename = ""
# set rende... | StarcoderdataPython |
1748691 | <filename>keystone/common/policies/trust.py
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... | StarcoderdataPython |
1776931 | # Copyright 2020 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | StarcoderdataPython |
3267278 | <reponame>Kiptim54/Personal-Blog
from flask import Flask
from config import config_options
from flask_bootstrap import Bootstrap
from flask_sqlalchemy import SQLAlchemy
from flask_login import LoginManager
from flask_admin import Admin
from flask_mail import Mail
from flask_uploads import UploadSet,configure_uploads,IM... | StarcoderdataPython |
152218 | """
Encoding = UTF-8
By <NAME>, 2019/3/18
Usage: Generate unique id for each image
"""
from datetime import datetime
def generate_unique_id():
time_now = str(datetime.now()).split('.')
time_now[0] = time_now[0].split(' ')
time_now[0][1] = time_now[0][1].split(':')
id = time_now[0][0] + '_' + time_now[0... | StarcoderdataPython |
3309589 | from setuptools import setup
setup(
name='django-oldfiles',
version='0.1',
packages=['oldfiles', 'oldfiles.management', 'oldfiles.management.commands'],
license='MIT License'
)
| StarcoderdataPython |
3333889 | from dialRL.utils.objects import SupervisionDataset,MemoryDataset, objdict
from dialRL.utils import utils
from dialRL.utils.utils import (image_coordonates2indices,
indice2image_coordonates,
heatmap2image_coord,
label2heatma... | StarcoderdataPython |
1646892 | #!/bin/bash
#Generates the report from the pmon data
#https://www.xmodulo.com/plot-bar-graph-gnuplot.html
#https://realpython.com/python-formatted-output/
#http://www.bersch.net/gnuplot-doc/histograms.html
#https://docs.datadoghq.com/integrations/amazon_rds/?tab=standard
import psycopg2
import os
import json
def set... | StarcoderdataPython |
1702523 | <reponame>LiorAvrahami/arcade<filename>tests/unit2/test_drawing_dimensions.py<gh_stars>1-10
import arcade
SCREEN_WIDTH = 800
SCREEN_HEIGHT = 600
class MyGame(arcade.Window):
""" Main application class. """
def __init__(self, width, height):
"""
Initializer
"""
super().__init_... | StarcoderdataPython |
1680687 | import os
import pickle
def save_pkl(instances, pickle_dict, is_training):
if is_pickle_dict_valid(pickle_dict):
os.makedirs(pickle_dict["path"], exist_ok=True)
with open(get_pkl_path(pickle_dict, is_training), "wb") as dataset_file:
pickle.dump(instances, dataset_file)
def load_pkl(... | StarcoderdataPython |
3208300 | # coding: utf-8
import os
import re
from selenium.webdriver.remote.webelement import WebElement
from utils.global_holder import GlobalHolder
class ElementAccessor(object):
@staticmethod
def __set_value(element: WebElement, value: str):
if element is None:
return
GlobalHolder.Brow... | StarcoderdataPython |
88121 | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HugginFace Inc. team.
# Copyright (c) 2018, <NAME>PORATION. 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 ... | StarcoderdataPython |
33174 | """
Python Interchangeable Virtual Instrument Library
Copyright (c) 2012-2017 <NAME>
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
... | StarcoderdataPython |
199497 | #!/usr/bin/env python
import json
import serial
import time
import csv
import os
import sys
import argparse
import logging
import atexit
from database_logger import DatabaseLogger
from mqtt_logger import LogToMQtt
from remeha_core import Frame
FORMAT = ('%(asctime)-15s %(threadName)-15s '
'%(levelname)-8s ... | StarcoderdataPython |
3219989 | <reponame>dotnes/mitmproxy
from mitmproxy import contentviews
from mitmproxy.test import tflow
from mitmproxy.test import tutils
from mitmproxy.test import taddons
from mitmproxy.net.http import Headers
from ..mitmproxy import tservers
example_dir = tutils.test_data.push("../examples")
class TestScripts(tservers.Ma... | StarcoderdataPython |
185259 | import os
from substance.logs import *
from substance import (Command, Box, EngineProfile)
from substance.exceptions import (InvalidOptionError)
class Create(Command):
def getUsage(self):
return "substance engine init [options] [ENGINE NAME]"
def getHelpTitle(self):
return "Create a new engi... | StarcoderdataPython |
4800424 | expected_output = {
'vrfs': {
'default': {
'neighbors': {
'192.168.199.137': {
'priority': '1',
'state': 'FULL/DR',
'dead_time': '0:00:31',
'address': '172.31.80.37',
'interface': ... | StarcoderdataPython |
59920 | import pickle
import pandas as pd
method_columns = ['model_class', 'config', 'loss_function', 'q_dist', 'sample_from_q',
'detach', 'add_noise', 'noise_type', 'warm_up', 'is_loaded', 'method_name']
hparam_columns = ['grad_l1_penalty', 'grad_weight_decay',
'lamb', 'loss_function_par... | StarcoderdataPython |
3271422 | from flask_restplus import Namespace, Resource
from origin_takehome.schemas.risk_api import RiskProfileCalculationSchema, RiskProfileSchema
from origin_takehome.services.risk_profile import RiskProfileService
from origin_takehome.utils.validations import check_body
risk_profile_ns = Namespace("risk_profile")
@risk_... | StarcoderdataPython |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.