id stringlengths 1 8 | text stringlengths 6 1.05M | dataset_id stringclasses 1
value |
|---|---|---|
3559698 | <gh_stars>0
from finq import FINQ
def test_pairs():
a = [1, 2, 5, 7]
expected = [(0, 1), (1, 2), (2, 5), (3, 7)]
a_f = FINQ(a)
assert a_f.enumerate().to_list() == expected
def test_pairs_from_1():
a = [1, 2, 5, 7]
expected = [(1, 1), (2, 2), (3, 5), (4, 7)]
a_f = FINQ(a)
assert a... | StarcoderdataPython |
6469745 | class FlashCard(object):
def __init__(self, title, content, media, hierarchy):
self.title = title
self.content = content
self.media = media
self.hierarchy = hierarchy
| StarcoderdataPython |
11366949 | <reponame>chapman-mcd/Flip-Sign<filename>FlipDotSign.py
"""
Since this is basically firmware, it should be able to handle a lot of hard coding. Some of the elements,
especially the events to add, will be difficult to allow the user to send.
1. ???
2. List of message objects
3. Pop random element off list of messag... | StarcoderdataPython |
1828774 | import json, hashlib, requests
from django.test import TestCase, Client
# class QAResponseTest(TestCase):
# def test_response(self):
# # c = Client()
# qa_list = [
# {
# "question":"My child is sick where can he get measles vaccine ?",
# "answer":"Please... | StarcoderdataPython |
9712013 | <reponame>maximg/vcs-archeo
#import re
import sqlite3
import pprint
import pydot
import sys
nodes = {}
maxNodes = 300
if len(sys.argv) > 1:
proj = sys.argv[1]
else:
proj = 'svnplot'
#proj = 'hadoop-common'
#proj = 'squirrelmail'
#proj = 'squirrel-sql'
#proj = 'notepad-plus'
#proj = 'zero-instal... | StarcoderdataPython |
284394 | """The package juman defines Japanese spacy.Language with JUMAN tokenizer."""
import itertools
from collections import namedtuple
from typing import Any, Callable, Dict, Iterator, List, Optional, Type
from spacy.compat import copy_reg
from spacy.language import Language
from spacy.tokens import Doc, Token
from camphr... | StarcoderdataPython |
3346175 | <gh_stars>0
# -*- coding: utf-8 -*-
# Copyright 2017 GIG Technology NV
#
# 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 b... | StarcoderdataPython |
8036225 | from flask import Flask, request, jsonify
from UtterenceModel import predictUtterence
from DeepLearntFeatures import featureMean,feature20BinMeans
from ConversationModel import predictConversationOffline, predictConversationOnline
from flask_cors import CORS
app = Flask(__name__)
cors = CORS(app)
utterence_folder = '... | StarcoderdataPython |
11222870 | <gh_stars>1-10
from tools.iterators.simple import SimpleIterator
from tools.run.reader import ParallelMatrix3dInputRunner, RunnerDataReader
import tools.linear_algebra.__init__ as linalg
| StarcoderdataPython |
62797 | """
test_question.py
サンプルテストケース
"""
import pytest
import run as myApp
from datetime import datetime, timedelta
from models import Question
@pytest.fixture
def api():
return myApp.api
class TestQuestionModel:
def test_was_published_recently_with_future_question(self, api):
"""
未来の質問に対してwas_... | StarcoderdataPython |
1827391 | <filename>raiden/tests/unit/network/rtc/test_web_rtc_manager.py
import pytest
from raiden.constants import ICEConnectionState
from raiden.network.transport.matrix.rtc.aiogevent import yield_future
from raiden.network.transport.matrix.rtc.web_rtc import WebRTCManager
from raiden.tests.utils.factories import make_signer... | StarcoderdataPython |
1693138 | <reponame>fughilli/nanopb
def nanopb_library(name, srcs = []):
if (len(srcs) != 1):
fail("srcs must have one element")
native.genrule(
name = name + "_nanopb_gen",
srcs = srcs,
outs = [name + ".nanopb.h", name + ".nanopb.c"],
cmd = ("$(location @com_github_nanopb_nanopb/... | StarcoderdataPython |
1845714 | <filename>urls.py
from django.conf.urls.defaults import *
from django.contrib import admin
from django.conf import settings
admin.autodiscover()
urlpatterns = patterns('',
(r'^admin/(.*)', admin.site.root),
(r'^', include('blangoblog.blango.urls')),
)
handler500 = 'blango.views.server_error'
handler404 = 'bla... | StarcoderdataPython |
3540669 | # OpenWeatherMap API Key
api_key = 'a2042807a0dd790b7ee58363d8cb65da'
| StarcoderdataPython |
1777493 | import numpy as np
import gym
from gym import wrappers
from gym.envs.registration import register
import matplotlib.pylab as plt
evaluate_v = []
def run_episode(env, policy, gamma = 1.0, render = False):
""" Runs an episode and return the total reward """
obs = env.reset()
total_reward = 0
step_idx = ... | StarcoderdataPython |
5096754 | <filename>realms.py
'''
WoW Realms with their name and connected-realm ids
'''
realms = [
('Kilrogg', 4),
('Winterhoof', 4),
('Proudmoore', 5),
("Kil'jaeden", 9),
('Tichondrius', 11),
('<NAME>', 12),
('<NAME>', 12),
('Farstriders', 12),
('Eitrigg', 47),
("Shu'halo", 47),
('Al... | StarcoderdataPython |
5158812 | <reponame>allo-media/eventail<filename>scripts/resurrect.py
#!/usr/bin/env python
#
# MIT License
#
# Copyright (c) 2018-2019 Groupe Allo-Media
#
# 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 Softwa... | StarcoderdataPython |
9673828 | <gh_stars>1-10
# Importing Application, Scene and Rectangle
from mithril import Application, Scene
from mithril.graphics.base_shapes import Rectangle
# Creating a empty scene
scene = Scene()
# Creating a 100 x 50 white rectangle
rect = Rectangle(100, 100, 100, 50, (255, 255, 255))
# Adding rectangle to scene
scene.a... | StarcoderdataPython |
1920726 | <gh_stars>0
from ermaket.api.scripts import ReturnContext, UserScript
__all__ = ['script']
script = UserScript(id=4)
@script.register
def add(context):
return ReturnContext({"data2": "EXAMPLE_DATA2"})
| StarcoderdataPython |
8173360 | #########################################################################
#
# Date: Apr 2006 Authors: <NAME>, <NAME>
#
# <EMAIL>
# <EMAIL>
#
# The Scripps Research Institute (TSRI)
# Molecular Graphics Lab
# La Jolla, CA 92037, USA
#
# Copyright: <NAME>, <NAME> and TSRI
#
#######################... | StarcoderdataPython |
3295062 | import os
import pytest
import shutil, tempfile
nbdir = os.path.join('notebooks')
testdir = tempfile.mkdtemp()
def get_notebooks():
return [f for f in os.listdir(nbdir) if f.endswith('.ipynb')]
def get_jupyter_kernel():
try:
jklcmd = ('jupyter', 'kernelspec', 'list')
b = subprocess.Popen(jkl... | StarcoderdataPython |
6643140 | <reponame>tanggai/robotframework_selenium2library<filename>src/Selenium2Library/keywords/__init__.py
from _logging import _LoggingKeywords
from _runonfailure import _RunOnFailureKeywords
from _browsermanagement import _BrowserManagementKeywords
from _element import _ElementKeywords
from _tableelement import _TableE... | StarcoderdataPython |
9797197 | #!/usr/bin/env python
from livereload import Server, shell
server = Server()
dirs = ("templates", "../build")
server.watch("templates/*.html",
shell(["bagel", "--file-type", "html", dirs[0], dirs[1]]))
server.watch("app/static/*.css", shell("rsync -a static/ ../build"))
server.serve(root=dirs[1], port=808... | StarcoderdataPython |
3381644 | # Assignment #1 - Basic Python
# Yanuar <NAME>
# Soal no 3
# Variable input
teori = float(input("NamaNilai ujian teori :"))
praktek = float(input("Nilai ujian praktek :"))
# Condition
if teori < 70 and praktek < 70 :
print("Anda harus mengulang ujian teori dan praktek")
elif teori < 70 and praktek >=70 :
prin... | StarcoderdataPython |
3418903 | <gh_stars>1-10
#!/usr/bin/python
# Copyright (C) 2013 <NAME>, FoldedSoft e.U.
#
# 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 re... | StarcoderdataPython |
4895354 | <reponame>luismartins-td/vizceral-example<filename>get_data.py
#!/usr/local/bin/python
import requests
import sys
import json
import socketio
sio = socketio.Client()
@sio.event
def connect():
print('connection established')
@sio.event
def my_message(data):
print('message received with ', data)
sio.emit(... | StarcoderdataPython |
9796525 | <reponame>Hacker-1202/Selfium<gh_stars>10-100
import discord
from app.vars.client import client
from app.helpers import Notify, getUser, getGuild
@client.command()
async def inviteInfo(ctx, link):
notify = Notify(ctx=ctx, title='Invite information')
notify.prepair()
linkData = await client.fetch_invite(url... | StarcoderdataPython |
4811186 | # Return value of 2 arguments using function
def avg(num1,num2):
x = (num1+num2)/2
return x
y = int(input("Insert first value: "))
z = int(input("Insert second value: "))
average = avg(y,z)
print(round(average,2)) | StarcoderdataPython |
3415425 | """This module defines the asynchronous forward reliable workflow."""
import asyncio
from typing import Tuple, Optional
import utilities.integration_adaptors_logger as log
from comms import queue_adaptor
from exceptions import MaxRetriesExceeded
from isodate import isoerror
from utilities import timing, config
from ut... | StarcoderdataPython |
6471564 | from setuptools import setup, find_packages
setup(
name='qface-store',
version='1.1',
description='Generator based on the QFace library for redux store concept',
url='https://github.com/Pelagicore/qface-store',
author='jryannel',
author_email='<EMAIL>',
license='MIT',
classifiers=[
... | StarcoderdataPython |
6429390 | # -*- coding: utf-8 -*-
"""ML-2-MultipleLinearRegression.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1EZQTodMmsYb308buM0PZjk0nU3Poim4J
"""
#importing libraries
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
#importi... | StarcoderdataPython |
4829112 | #!/usr/bin/env python
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# <NAME>
# (C) 1998-2001 All Rights Reserved
#
# <LicenseText>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
from ... | StarcoderdataPython |
9605535 | # Generated by Django 3.1.2 on 2021-09-13 21:28
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('booking', '0004_auto_20210906_0829'),
]
operations = [
migrations.AddField(
model_name='appointment',
name='client_p... | StarcoderdataPython |
9691194 | <filename>recommender/src/helper.py
from tqdm import tqdm
from ast import literal_eval
from collections import defaultdict
from scipy.sparse import coo_matrix, csr_matrix
from sklearn.metrics.pairwise import cosine_similarity
import os
import heapq
import zipfile
import pandas as pd
import numpy as np
import scipy.spa... | StarcoderdataPython |
8157536 | import logging
from flask_restful import Api
from .job import MonitorJob
from .base import MsiScheduler
from .handlers import init_api
from .db import db
class JobManager:
singleton = None
def __init__(self, app=None):
if JobManager.singleton is None:
self.app = app
self.api =... | StarcoderdataPython |
11356512 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import mysql.connector
class databaseManager:
def __init__(self):
self.conn = mysql.connector.connect(host="localhost",user="root",password="<PASSWORD>", database="cerbere_db")
self.cursor = self.conn.cursor()
def createTables(self):
self.cursor.execute(""" C... | StarcoderdataPython |
194852 | <filename>exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/scripts/inventory/lxc_inventory.py
#!/usr/bin/env python
#
# (c) 2015-16 <NAME>, hastexo Professional Services GmbH
# <<EMAIL>>
# Based in part on:
# libvirt_lxc.py, (c) 2013, <NAME> <<EMAIL>>
#
# This file is... | StarcoderdataPython |
220954 | <reponame>kelesi/coedcop
class Digit(object):
def __init__(self, representation):
self._digit_representation = representation
def scale(self, scale_factor=1):
if scale_factor == 1:
return self
scaled_lines = []
for line in self._digit_representation:
scal... | StarcoderdataPython |
12863777 | '''
Collection of Windows-specific I/O functions
'''
import msvcrt
import time
import ctypes
from platforms import winconstants, winclipboard
EnumWindows = ctypes.windll.user32.EnumWindows
EnumWindowsProc = ctypes.WINFUNCTYPE(ctypes.c_bool, ctypes.POINTER(ctypes.c_int), ctypes.POINTER(ctypes.c_int))
GetWindowText = c... | StarcoderdataPython |
5171380 | <reponame>polyfemos/atavism<filename>atavism/video.py
from errno import EPERM, EACCES
import os
import sys
import subprocess
from tempfile import mkdtemp
import re
import math
def find_ffmpeg(binary_name='ffmpeg', skip_list=None, paths=None, silent=False):
""" Function to find and return the full path to a suitab... | StarcoderdataPython |
4925059 | <filename>pypoptools/pypoptesting/framework/test_util.py
import datetime
import logging
import multiprocessing as mp
import os
import pathlib
import sys
import tempfile
import time
from typing import Callable
from .node import Node
CreateNodeFunction = Callable[[int, pathlib.Path], Node]
TEST_EXIT_PASSED = 0
TEST_EX... | StarcoderdataPython |
11235272 | <filename>zfit/models/physics.py
# Copyright (c) 2019 zfit
from typing import Type, Any
import tensorflow as tf
import tensorflow_probability.python.distributions as tfd
import numpy as np
import zfit
from zfit import ztf
from ..core.basepdf import BasePDF
from ..core.limits import ANY_UPPER, ANY_LOWER, Space
fro... | StarcoderdataPython |
6614790 | from __future__ import print_function
import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), os.pardir, os.pardir))
import config
from utils.parsers.transnet_parser import TransnetParser
from utils.scrapers.osm_nodes_scraper import OsmNodesScraper
def scrape_nodes():
region = config.conf... | StarcoderdataPython |
3245985 | # Generated by Django 2.0.1 on 2018-04-09 05:59
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('board', '0003_auto_20180226_2047'),
]
operations... | StarcoderdataPython |
9789181 | <reponame>dimitar-daskalov/TopStore
from datetime import datetime
from django.contrib.auth import get_user_model
from django.test import TestCase
from django.urls import reverse
from TopStore.store.models import Order
UserModel = get_user_model()
class SignUpUserTests(TestCase):
def setUp(self):
self.u... | StarcoderdataPython |
1691589 | # -*- coding: utf-8 -*-
"""
SlideSpeechConverter.py
a component of SlideSpeech.py
Extract speaker notes from .odp or .ppt file
Prepare script.txt for SlideSpeech
Prepare convert.bat to generate audio via text-to-speech
Output HTML wrappers for slide images and audio
Prepare makeVid.bat to generate video
Copyright (c)... | StarcoderdataPython |
12859022 | #!/usr/bin/env python
#
# Copyright 2019 <NAME>
#
# This file is part of a Python candidate reference implementation of
# the optimade API [https://www.optimade.org/]
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software")... | StarcoderdataPython |
3575861 | <gh_stars>1-10
#!/usr/bin/env python
#
# This script runs a set of black-box tests on Mailpile using the test
# messages found in `testing/`.
#
# If run with -i as the first argument, it will then drop to an interactive
# python shell for experimenting and manual testing.
#
import os
import sys
import traceback
# Set... | StarcoderdataPython |
8113113 | from model.group import Group
import random
def test_delete_first(app, db, chech_ui):
if len(db.get_group_list()) == 0:
app.group.create(Group(name="test"))
old_groups = db.get_group_list()
group = random.choice(old_groups)
app.group.delete_group_by_id(group.id)
new_groups = db.get_group_l... | StarcoderdataPython |
5081840 | # Find the Median
# Find the Median in a list of numbers.
#
# https://www.hackerrank.com/challenges/find-the-median/problem
#
def findMedian(arr):
# la valeur médiane est celle qui partage la liste triée en 2
return sorted(arr)[len(arr) // 2]
if __name__ == "__main__":
n = int(input().strip())
arr = l... | StarcoderdataPython |
5131030 | <filename>asab/task.py<gh_stars>10-100
import logging
import asyncio
import asab
#
L = logging.getLogger(__name__)
#
class TaskService(asab.Service):
'''
Task service is for managed execution of fire-and-forget, one-off, background tasks.
The task is a coroutine, future (asyncio.ensure_future) or task (asynci... | StarcoderdataPython |
123415 | <filename>agent/python/perper/protocol/task_collection.py
import asyncio
import functools
class TaskCollection:
def __init__(self):
self.tasks = set()
self.tasks_left = 0
self.cancelled = False
self.future = asyncio.get_running_loop().create_future()
def remove(self, task):
... | StarcoderdataPython |
4924182 | <gh_stars>1-10
# -*- coding: utf-8 -*-
# (c) Copyright IBM Corp. 2020,2021
# Apache License, Version 2.0 (see https://opensource.org/licenses/Apache-2.0)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
class ModuleDocFragment(object):
COMMON = r'''
options:
cmci_host:
... | StarcoderdataPython |
8788 | <reponame>vnaskos/Website
from django.contrib import admin
# Register your models here.]
from website.sites.models import Post
@admin.register(Post)
class TestAdmin2(admin.ModelAdmin):
pass | StarcoderdataPython |
9603512 | <filename>orm_sqlfan/libreria/migrations/0002_libro.py
# Generated by Django 2.2.7 on 2019-11-25 05:13
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('libreria', '0001_initial'),
]
operations = [
migrations.CreateModel(
name... | StarcoderdataPython |
1685841 | <filename>synapse/rest/client/v2_alpha/devices.py<gh_stars>0
# -*- coding: utf-8 -*-
# Copyright 2015, 2016 OpenMarket 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.a... | StarcoderdataPython |
6671535 | import random
import pickle
import sys
if(len(sys.argv) != 3):
print("Usage: python {} TokenName NumTokens".format(sys.argv[0]))
sys.exit(1)
f = open(sys.argv[1], "w")
tokenlist = []
for i in range(int(sys.argv[2])):
h = random.getrandbits(128)
h = "%032x" % h
tokenlist.append(h +... | StarcoderdataPython |
6604518 | <gh_stars>10-100
# coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
class EskaGoIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?eskago\.pl/radio/(?P<id>[^/\s?#]+)'
_TESTS = [{
'url': 'https://www.eskago.pl/radio/eska-rock',
'info_dict': {
... | StarcoderdataPython |
12814125 | <reponame>snjoetw/appdaemon_apps<gh_stars>0
from datetime import datetime, timedelta
from lib.core.monitored_callback import monitored_callback
from lib.triggers import TriggerInfo
from lighting.motion_lighting import MotionLighting
CHECK_FREQUENCY = 900
TIMER_ACTION_TURN_ON = 'timer_action_turn_on'
TIMER_ACTION_TUR... | StarcoderdataPython |
3283096 | <gh_stars>0
from selenium import webdriver
browser = webdriver.Firefox()
browser.get('http://seleniumhq.org/') | StarcoderdataPython |
349320 | import setuptools
with open('requirements.txt', 'r') as f:
install_requires = f.read().splitlines()
setuptools.setup(name='my_project',
packages=['my_project'],
install_requires=install_requires)
| StarcoderdataPython |
12842565 | <gh_stars>1-10
#!/usr/bin/env python
'''
Copyright (c) 2016, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions o... | StarcoderdataPython |
11323600 | import warnings
class WarningTestCaseMixin:
"""
TestCase mixin to catch warnings
"""
def assertWarning(self, warning, callable, *args, **kwargs):
with warnings.catch_warnings(record=True) as warning_list:
warnings.simplefilter(action="always")
callable(*args, **kwargs)... | StarcoderdataPython |
151135 | <filename>awokado/exceptions/__init__.py
from .auth import AuthError
from .base import BaseApiException
from .not_found import NotFound, RelationNotFound, ResourceNotFound
from .bad_request import (
BadFilter,
BadLimitOffset,
BadRequest,
MethodNotAllowed,
IdFieldMissingError,
)
from .forbidden imp... | StarcoderdataPython |
1708406 | from setuptools import setup
setup(
name='cpsk',
description='an unofficial api for grabbing data from cp.sk',
author='<NAME>',
author_email='<EMAIL>',
version='0.1.5',
url='https://github.com/Adman/python-cpsk-api',
install_requires=['requests', 'lxml', 'json'],
include_package_data... | StarcoderdataPython |
3544193 | # An example of the Holdout Cross-Validation split
import pandas
from sklearn import datasets
from sklearn.model_selection import train_test_split
# The percentage (as a decimal) of our data that will be training data
TRAIN_SPLIT = 0.8
# The diabetes dataset contains the following columns:
columns = ['age', 'sex', '... | StarcoderdataPython |
220812 | import csv
import json
import sys
from tqdm import tqdm
from preproc import run_emtsv_all, run_emtsv_tok
def parse_row(row):
doc_id_x, doc_id, doc_type, title, author, author_id, content, date_created, date_added, context, url, domain, sentiment, sent_points, comments, views, shares, wow, love, like, haha, sad,... | StarcoderdataPython |
12848356 | # -*- coding: utf-8 -*-
"""
Linear algebra operations and helpers.
Inspired by <NAME>'s transformation.py <http://www.lfd.uci.edu/~gohlke/>
This module is not directly exported by the `crystals` library. Use it with caution.
"""
import math
import numpy as np
# standard basis
e1, e2, e3 = np.eye(3)
def affine_ma... | StarcoderdataPython |
9653954 | #!/usr/bin/env python
from argparse import ArgumentParser
import sys
parser = ArgumentParser(description="Run the test suite.")
parser.add_argument(
"--failfast",
action="store_true",
default=False,
dest="failfast",
help="Stop the test suite after the first failed test.",
)
parser.add_argument(
... | StarcoderdataPython |
3487992 | from typing import Callable
from PyQt5 import QtWidgets
from PyQt5.QtGui import QMovie
from gui.main_window import Ui_main_window
from gui.tutorial_window import Ui_tutorial_window
from gui.window_with_close_listener import WindowWithCloseListener
_tutorial_path = "tutorials/media/"
def _gui_init_tutorial(tutoria... | StarcoderdataPython |
9732797 | <reponame>michaelhkw/impala
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the... | StarcoderdataPython |
6536034 | <filename>youbot_gazebo_publisher/src/youbot_ros_hello_world.py
#!/usr/bin/env python
# @brief python_file
from __future__ import print_function
import roslib
# roslib.load_manifest('teleop')
import rospy
from numpy import inf, zeros
from geometry_msgs.msg import Twist
import trajectory_msgs.msg as tm
import sys, s... | StarcoderdataPython |
3273409 | from gremlin_python import statics
from gremlin_python.process.anonymous_traversal import traversal
from gremlin_python.process.graph_traversal import __
from gremlin_python.process.strategies import *
from gremlin_python.driver.driver_remote_connection import DriverRemoteConnection
from gremlin_python.process.traversa... | StarcoderdataPython |
1808809 | <gh_stars>1-10
"""Support for monitoring a Sense energy sensor device."""
import logging
from homeassistant.components.binary_sensor import BinarySensorDevice
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from homeassistant.core import callback
from . import SENSE_DATA, SENSE_DEVICE_UPDATE
_L... | StarcoderdataPython |
1774430 | <filename>src/test/cc_binary_test.py<gh_stars>1-10
# Copyright (c) 2011 Tencent Inc.
# All rights reserved.
#
# Author: Michaelpeng <<EMAIL>>
# Date: October 20, 2011
"""
This is the test module for cc_binary target.
"""
import blade_test
class TestCcBinary(blade_test.TargetTest):
"""Test cc_binary """
... | StarcoderdataPython |
9681467 | <reponame>Botomatik/JackBot
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
This is a script written to add the template "orphan" to the pages that aren't linked by other pages.
It can give some strange Errors sometime, I hope that all of them are fixed in this version.
These command line parameters can be used to speci... | StarcoderdataPython |
3422564 | # Float
# Write a program that takes a float from the user
# and stores it in a variable. Cast the number to an
# integer and store in another variable.
# Then print: (floating point number) = (integer number).
# For example, if the user enters 5, the output would be:
# 5.0 = 5
# Also print the type of the floating poi... | StarcoderdataPython |
4824537 | <gh_stars>0
#!/usr/bin/python
#
# Copyright 2018-2021 Polyaxon, Inc.
#
# 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... | StarcoderdataPython |
6631215 | <gh_stars>1-10
def foo(*a):
pass
foo<caret>(1, 2, 3 | StarcoderdataPython |
1734394 | # -*- coding: utf-8 -*-
from setuptools import setup, find_packages
import libkge
VERSION = libkge.__version__
NAME = 'libkge'
DESCRIPTION = 'A library for knowledge graph embedding models'
with open('README.md') as f:
LONG_DESCRIPTION = f.read()
long_description_content_type = 'text/markdown'
AUTHOR = '<NAME>'... | StarcoderdataPython |
1663205 | <reponame>sguzman/bamboo-scrape
import functools
from typing import Dict
from . import __log as log
from . import __exit as exit
from . import __greet as greet
from . import __json as json
@functools.cache
def exec() -> Dict:
log.exec()
greet.exec()
exit.exec()
return json.exec()
| StarcoderdataPython |
4851768 | <gh_stars>0
from filtering import *
#from ui import *
from views import * | StarcoderdataPython |
6488665 | from xaircraft.envs.lvaircraft_pitch import LVAircraftPitch
from gym.envs.registration import register
register(
id='LVAircraftAltitude-v0',
entry_point='xaircraft.envs.lvaircraft_altitude:LVAircraftAltitudeV0'
)
register(
id='LVAircraftPitch-v0',
entry_point='xaircraft.envs.lvaircraft_pitch:LVAircr... | StarcoderdataPython |
125441 | <reponame>mfreiwald/FromMotionToEmotion<filename>MakeTimelineTest.py
from module.Configuration import Configuration
from module.Evaluation import Evaluation
from dask.distributed import Client
import logging
import math
import pandas as pd
def transform(df, parts=1):
newdfs = []
for idx, group in df.groupby(l... | StarcoderdataPython |
6665475 | # Definition for singly-linked list.
# class ListNode:
# def __init__(self, x):
# self.val = x
# self.next = None
class Solution:
# @param A : head node of linked list
# @return the first node in the cycle in the linked list
def detectCycle(self, A):
if A.next is None:
... | StarcoderdataPython |
11336215 | #!/usr/bin/python
#
# Copyright 2018-2021 Polyaxon, Inc.
#
# 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 ... | StarcoderdataPython |
1657455 | import androidhelper
import urllib.request
import time
import requests
from bs4 import BeautifulSoup
import datetime
droid = androidhelper.Android()
republic1="Republic Day is a national holiday in India. It honours the date on which the Constitution of India came into effect on 26 January 1950 replacing the Govern... | StarcoderdataPython |
11257390 | """Sweeps throught the depth image showing 100 range at a time"""
from kin_emb.depth_processing import get_depth_in_threshhold
from kin_emb import kinect_proxy
import cv2
import matplotlib.pyplot as pplot
import signal
import time
def display_threshhold(lower, upper):
depth = get_depth_in_threshhold(lower, upper)... | StarcoderdataPython |
3228948 | #!/usr/bin/env python3
import sys
import requests
from requests.cookies import RequestsCookieJar
from lxml import etree
DOMAIN = 'http://dj.cs.ustc.edu.cn'
USERNAME = ''
PASSWORD = ''
def main():
# Check username and password
global USERNAME, PASSWORD
if not USERNAME: USERNAME = input('请输入学号:')
if not PASSWORD:... | StarcoderdataPython |
5140663 | # -*- coding: utf-8 -*
'''
堆排序
'''
import sort_helper
from max_heap import Maxheap
import quick_3_sort
@sort_helper.test_sort
def heap_sort(arr):
heap = Maxheap(len(arr),arr)
for i in range(len(arr) - 1,-1,-1):
arr[i] = heap.extractMax()
def __shifDown(arr,n,k):
while (2 * k + 1 < n ):
... | StarcoderdataPython |
5050835 | <gh_stars>1-10
from __future__ import print_function
import sys
class Color(object):
"""A printable and mixable color."""
# A dictionary of all colors, keyed by their numeric value
colors = {}
def __init__(self, value, name, code):
self.value = value
self.name = name
self.code = code
Color.colors[value]... | StarcoderdataPython |
3250251 | # Generated by Django 3.2.9 on 2021-12-09 11:44
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Audience'... | StarcoderdataPython |
277994 | <gh_stars>100-1000
"""
Some correct syntax for variable annotation here.
More examples are in test_grammar and test_parser.
"""
from typing import no_type_check, ClassVar
i: int = 1
j: int
x: float = i/10
def f():
class C: ...
return C()
f().new_attr: object = object()
class C:
def __... | StarcoderdataPython |
11330614 | <gh_stars>0
from django.shortcuts import render,render_to_response
from login import models
from django.http import HttpResponseRedirect
from pub_form.form_login import UserForm
from django.core.paginator import Paginator
# Create your views here.
def index(request):
#Paginator
current_page=request.GET.get("p... | StarcoderdataPython |
3431918 | <gh_stars>10-100
from unittest import TestCase
from src import core_printer
class TestCorePrinters(TestCase):
p = core_printer.CorePrinters()
def test_blue_text(self):
msg1 = self.p.blue_text("test")
msg2 = "\x1b[34m [*] \x1b[0mtest"
self.assertEqual(msg1, msg2)
def test_green_te... | StarcoderdataPython |
3317511 | from ..factory import Type
class fileTypeAnimation(Type):
pass
| StarcoderdataPython |
285716 | <filename>dynamic/wrapper_generators/generate_bindings.py
#!/usr/bin/env python
"""Copyright (c) 2005-2016, University of Oxford.
All rights reserved.
University of Oxford means the Chancellor, Masters and Scholars of the
University of Oxford, having an administrative office at Wellington
Square, Oxford OX1 2JD, UK.
... | StarcoderdataPython |
6447499 | <reponame>mirestrepo/voxels-at-lems<filename>dbrec3d/bof/taylor/learn_codebook/k_means/save_cluster_id_scene_raw.py
import dbrec3d_batch
import multiprocessing
import Queue
import time
import optparse
import sys
import os
from xml.etree.ElementTree import ElementTree
class dbvalue:
def __init__(self, index, type):
... | StarcoderdataPython |
9701000 | #!/usr/bin/env python
import os
import sys
import warnings
import django
if django.VERSION[:2] == (1, 6):
# This is only necessary for Django 1.6
from django.contrib.auth.tests import custom_user
custom_user.AbstractUser._meta.local_many_to_many = []
custom_user.PermissionsMixin._meta.local_many_to_man... | StarcoderdataPython |
4807134 | <reponame>JiaqiYao/dynamic_multi_label<gh_stars>1-10
import tensorflow as tf
import numpy as np
from gensim.models.keyedvectors import KeyedVectors
import pickle
import json
import os
class DataProcessor(object):
"""Base class for data converters for sequence classification data sets."""
def __ini... | StarcoderdataPython |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.