id stringlengths 1 265 | text stringlengths 6 5.19M | dataset_id stringclasses 7
values |
|---|---|---|
1710933 | <filename>src/medius/mediuspackets/getallclanmessagesresponse.py
from enums.enums import MediusEnum, CallbackStatus
from utils import utils
from enums.enums import MediusIdEnum
class GetAllClanMessagesResponseSerializer:
data_dict = [
{'name': 'mediusid', 'n_bytes': 2, 'cast': None}
]
@classmetho... | StarcoderdataPython |
4813778 | import re
import json
import requests
import logging
logging.basicConfig(
format='%(asctime)s %(levelname)-8s %(message)s',
level=logging.INFO,
datefmt='%Y-%m-%d %H:%M:%S')
url = "https://raw.githubusercontent.com/jupyter-incubator/sparkmagic/master/sparkmagic/example_config.json"
class CreateSparkMagicC... | StarcoderdataPython |
34217 | <filename>devlin2/modular_square/rtl/gen_reduction_lut.py<gh_stars>10-100
#!/usr/bin/python3
################################################################################
# Copyright 2019 Supranational LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in comp... | StarcoderdataPython |
3369597 | #!/usr/bin/python
# -*- coding: UTF-8 -*-
#
# Copyright 2010 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... | StarcoderdataPython |
1775243 | ## Imports
import picamera
import picamera.array
import cv2
import cv2.cv as cv
import tesseract
import serial
from time import sleep as wait
## GVARS
cells = []
chars = []
confs = []
## Functions
def initCamera():
camera = picamera.PiCamera()
camera.resolution = (320, 240)
camera.start_preview()
wait(2)
return... | StarcoderdataPython |
1712146 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
from setuptools import find_packages
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
if sys.argv[-1] == "publish":
os.system("python setup.py sdist upload")
sys.exit()
if sys.argv[-1] == "test"... | StarcoderdataPython |
3372220 | from django.db import models
from django.contrib.auth.models import User
from tinymce.models import HTMLField
from cloudinary.models import CloudinaryField
# Create your models here.
Priority=(
('All farmers','All farmers'),
)
servicer=(
('Dennis','Dennis'),
('Jalody','Jalody'),
('Melby','Melby'),
... | StarcoderdataPython |
6881 | <reponame>Hades01/Addons<filename>repo/script.module.liveresolver/lib/liveresolver/resolvers/finecast.py<gh_stars>1-10
# -*- coding: utf-8 -*-
import re,urlparse,cookielib,os,urllib
from liveresolver.modules import client,recaptcha_v2,control,constants, decryptionUtils
from liveresolver.modules.log_utils import log
c... | StarcoderdataPython |
1775825 | <filename>palo_alto_pan_os/komand_palo_alto_pan_os/actions/set/action.py<gh_stars>1-10
import komand
from .schema import SetInput, SetOutput
from komand.exceptions import PluginException
# Custom imports below
class Set(komand.Action):
def __init__(self):
super(self.__class__, self).__init__(
... | StarcoderdataPython |
1707130 | <reponame>regularApproximation/newton<filename>gen_eqs.py
import numpy.random
import itertools
import random
import sys
# run with: python gen_eqs.py [#vars] [sparseness-parameter in (0,1] ], e.g. "python gen_eqs.py 14 0.7"
N = int(sys.argv[1])
tol = float(sys.argv[2])
# generate a (sparse) probabilistic system of ... | StarcoderdataPython |
185282 | <filename>dmc/time.py
from __future__ import absolute_import
# -*- coding: utf-8 -*-
"""
This module contains the set of dmcs's exceptions
:copyright: (c) 2014 by <NAME>.
:license: ISC, see LICENSE for more details.
"""
import datetime
import time
import math
import sys
import pytz
import dateutil.tz
import iso860... | StarcoderdataPython |
72422 | <reponame>gchers/modelchimp-client
class ClientEvent(object):
AUTH = 1
MODEL_PARAM = 2
EVAL_PARAM = 3
DURATION_PARAM = 4
EXPERIMENT_START = 5
EXPERIMENT_END = 6
CODE_FILE = 7
COMPLETED = 10
GET_EXPERIMENT_METRIC_FILTER = 8
GET_EXPERIMENT_METRIC_DATA = 9
GET_EXPERIMENT_DURATIO... | StarcoderdataPython |
3388077 | from __future__ import unicode_literals
from django.contrib.auth.models import User
from django.db import models
# My models.
class Person(models.Model):
"""Is a person with its likes, friends and shared content"""
user = models.OneToOneField(User, on_delete=models.CASCADE)
partner = models.ForeignKey('se... | StarcoderdataPython |
1629967 | from setuptools import setup
setup(
name='dataclass-xml',
version='0.1',
packages=['dataclass_xml'],
url='https://github.com/Ricyteach/dataclass-xml',
license='MIT',
author='<NAME>',
author_email='<EMAIL>',
description='A simple library for combining dataclasses and xml functionality',
... | StarcoderdataPython |
1778342 | import enum
class ID3TagPositionMode(enum.Enum):
TIME = 'TIME'
FRAME = 'FRAME'
| StarcoderdataPython |
4823029 | <gh_stars>0
#!/usr/bin/env python3
from setuptools import setup, find_packages
with open('README.md') as f:
readme = f.read()
with open('LICENSE') as f:
license = f.read()
setup(
name='episimmer',
version='0.1.0',
description='Epidemic Simulation Platform',
long_description=readme,
autho... | StarcoderdataPython |
3342779 | <gh_stars>0
from pyasv.loss.triplet_loss import batch_hard_triplet_loss
from pyasv.loss.triplet_loss import batch_all_triplet_loss | StarcoderdataPython |
1697770 | from django.urls import path
from . import views
app_name = "classes"
urlpatterns = [
path("", views.get_classes.as_view(), name="get_classes"),
path("open", views.get_open_classes.as_view(), name="get_open_classes"),
path("<int:class_id>", views.get_class.as_view(), name="get_class"),
path("enrolled"... | StarcoderdataPython |
3375300 | # All rights reserved by forest fairy.
# You cannot modify or share anything without sacrifice.
# If you don't agree, keep calm and don't look at code bellow!
"""
Todo:
- check empty --tests without --self-test
- check empty case delimiter "," in --test
- check spaces in options help
- check duplicate ... | StarcoderdataPython |
179202 | ## coding=utf-8
from sqlalchemy import create_engine
from sqlalchemy.orm import scoped_session, sessionmaker
from sqlalchemy.ext.declarative import declarative_base
import json
"""
Ce script se permet d'établir une connexion à la base de données.
Il est utilisé les infos de connexion enregistré dans ... | StarcoderdataPython |
1790843 | import asyncio
import logging
import os
import threading
from time import sleep
from unittest.mock import MagicMock
from dotenv import load_dotenv
from Collectors.EdgeOS.Collector import EdgeOSCollector
from Collectors.Environment.Collector import EnvironmentCollector
from DB.InfluxDBCloud import InfluxDBCloud
_loop... | StarcoderdataPython |
1748991 | <reponame>mrh1997/headlock
import weakref
from .core import CProxyType, CProxy, InvalidAddressSpaceError
from .void import CVoidType
from ..address_space import AddressSpace
from typing import Union, TextIO, List
from functools import partial
class CFuncType(CProxyType):
PRECEDENCE = 20
def __init__(self, r... | StarcoderdataPython |
3263521 | <gh_stars>1-10
from models.User import UserFactory
from tests.base import BaseTestCase
class UserTestCase(BaseTestCase):
def setUp(self):
BaseTestCase.setUp(self)
self.user = UserFactory.create()
self.user.save()
def test_get_profile(self):
url = '/api/user'
response =... | StarcoderdataPython |
1773129 | <gh_stars>0
from itertools import permutations
numbers = range(0, 10)
permuted_nums = list(permutations(numbers))
print permuted_nums[999999]
| StarcoderdataPython |
1718402 | import logging
import asyncio
from aiohttp import web
from argparse import ArgumentParser
import os
import getpass
import Globals
from account import Account
import kademlia.network as kad
from rpc import RPCDispatcher
# from kademlia.network import Server
# import json
# import rlp
# from rlp.sedes import text, big_e... | StarcoderdataPython |
1771119 | from .nauta import Nauta
from .constants import LogLevel | StarcoderdataPython |
3303223 | <gh_stars>100-1000
import unittest
from bark.core.world import *
from bark.core.world.evaluation.ltl import *
from bark.runtime.commons.parameters import ParameterServer
from bark.runtime.scenario.scenario_generation.deterministic import DeterministicScenarioGeneration
class EvaluatorLTLTests(unittest.TestCase):
... | StarcoderdataPython |
1756626 | <gh_stars>1-10
#!/usr/bin/env python3
import os, sys, re
import json
import getopt
from pprint import pprint
import pyvbcc
import pyvbcc.config
class Validator( object ):
def __init__( self, valmap, **opt ):
if 'debug' in opt and opt['debug'] in (True, False):
self._debug = opt['debug']
... | StarcoderdataPython |
1729177 | <gh_stars>1-10
# -*- coding: utf-8 -*-
"""
Created on Mon Aug 5 15:06:43 2019
@author: Dong
"""
import numpy as np
class KNNClassifier:
def __init__(self, X, y):
self.X = self._check_input(X)
self.y = self._check_input(y)
def _check_input(self, arr):
if list == type(ar... | StarcoderdataPython |
116297 | <reponame>buschNT/KISS_camera
import PySpin
class Interface:
def __init__(self, interface):
self.interface = interface
# nodemap from interface
self.nodemap_interface = interface.GetTLNodeMap()
def __del__( self ):
del self.interface
def interface_display_name( se... | StarcoderdataPython |
3354029 | import webapp2
class Redirect(webapp2.RequestHandler):
def get(self, path):
self.redirect(uri='https://www.webcomponents.org/%s' % path, permanent=True)
# pylint: disable=invalid-name
app = webapp2.WSGIApplication([
webapp2.Route(r'/<path:.*>', handler=Redirect),
], debug=True)
| StarcoderdataPython |
1777718 | <gh_stars>0
import networkx as nx
import matplotlib.pyplot as plt
import re
"""
Major issue to deal with (that's really difficult!): What about 'jr $ra', which is typically used to return to the instruction after the last jal or jalr instruction?
"""
class ProgramSection:
def __init__(self, label):
self.lab... | StarcoderdataPython |
3265934 | <gh_stars>1-10
"""EatFirst FileSystem tests."""
from io import BytesIO
from uuid import uuid4
import pytest
from botocore.exceptions import ClientError
from faker import Faker
from efs import EFS
fake = Faker()
TEST_FILE = 'test_file_{0}.txt'.format(uuid4())
RANDOM_DATA = BytesIO(fake.sha256().encode())
def test_c... | StarcoderdataPython |
1615883 | from django.db import models
from django.conf import settings
class Image(models.Model):
"""
Image model, really just a default, a more reasonable one
would create some thumbnails based on the need of the site.
"""
title = models.CharField(max_length=255, blank=True, null=True)
image = models.... | StarcoderdataPython |
111909 | # -*- encoding: utf-8 -*-
"""Testing Unittest facilities offered.
This doesn't test ``cmd`` command, but the ``self.cmd`` provided to
tests inheriting ``BaseShTest``.
"""
from .. import ShellError, BaseShTest
class CmdSimpleTest(BaseShTest):
def test_shell_call(self):
res = self.cmd("true")
... | StarcoderdataPython |
3366074 | from . import STDR
class ATR(STDR):
def __init__(self, version=None, endian=None, record = None):
self.id = 'ATR'
self.local_debug = False
# Version
if version==None or version=='V4':
self.version = 'V4'
self.info= '''
Audit Trail Record
------------------... | StarcoderdataPython |
3365343 | from django import forms
from .models import *
class ProfileForm(forms.ModelForm):
class Meta:
model=Profile
fields=['first_name', 'last_name', 'profile_pic', 'username', 'bio', 'location', 'mobile_number', 'email']
class UpdateProfileForm(forms.ModelForm):
class Meta:
... | StarcoderdataPython |
1758812 | from django.contrib import admin
from .models import Product, LikeButton, SavedProduct
# Register your models here.
admin.site.register(Product)
admin.site.register(LikeButton)
admin.site.register(SavedProduct)
| StarcoderdataPython |
1677475 | import logging
import sys
import re
from termcolor import colored
from datetime import datetime
if sys.platform == 'win32':
import colorama
colorama.init()
ansi_escape = re.compile(r'\x1b[^m]*m')
def antiansi_emit(self, record):
if self.stream is None:
self.stream = self._open()
record.msg ... | StarcoderdataPython |
1613898 | <reponame>comp-neural-circuits/tctx
"""
Code to generate new simulations.
"""
import logging
import numpy as np
import pandas as pd
from tctx.analysis import simbatch as sb
import datetime
#########################################################################################
# Generate new simulation protocols
... | StarcoderdataPython |
1631050 | <filename>Plots/Bar/NCL_bar_14.py
"""
NCL_bar_14.py
=============
This script illustrates the following concepts:
- Drawing an XY curve on top of filled bars
- Filling the bars in a bar plot with different colors
- Setting the minimum/maximum value of the X and Y axis in a bar plot
- Rotating the Y axis... | StarcoderdataPython |
4828535 | # -*- coding: utf-8 -*-
# Copyright (c) 2018, <NAME> and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class ReadingCode(Document):
'''
Class that test the Reading Code class objects
'''
def run_funct... | StarcoderdataPython |
1720778 | # :coding: utf-8
# :copyright: Copyright (c) 2015 ftrack
import copy
import uuid
import mock
import pytest
import ftrack_api.collection
import ftrack_api.symbol
import ftrack_api.inspection
import ftrack_api.exception
import ftrack_api.operation
def create_mock_entity(session):
'''Return new mock entity for *s... | StarcoderdataPython |
3350286 | from conans import ConanFile, CMake, tools
import os, shutil
class ConanFileDefault(ConanFile):
name = "gsoap"
description = "The gSOAP toolkit is a C and C++ software development toolkit for SOAP and " \
"REST XML Web services and generic C/C++ XML data bindings."
topics = ("conan", "gs... | StarcoderdataPython |
3208387 | #!/usr/bin/env python
##
## See COPYING file distributed along with the ncanda-data-integration package
## for the copyright and license terms
##
#
# Variables from surveys needed for UPPS
#
input_fields = { 'youthreport2' : [ 'youth_report_2_complete', 'youthreport2_.*_ssq1bn' ] }
#
# This determines the name... | StarcoderdataPython |
3206563 | import numpy as np
import matplotlib.pyplot as plt
x_data = np.array([35., 38., 31., 20., 22., 25., 17., 60., 8., 60.])
y_data = 2 * x_data + 50 + 5 * np.random.random(10)
bb = np.arange(0, 100, 1)
ww = np.arange(-5, 5, 0.1)
Z = np.zeros((len(bb), len(ww)))
# Create landscape
for i in range(len(bb)):
for j in rang... | StarcoderdataPython |
4822049 | <filename>sources/rnt/mediane/algorithms/lri/BioCo.py
from mediane.algorithms.lri.BioConsert import BioConsert
from mediane.algorithms.misc.borda_count import BordaCount
from mediane.distances.enumeration import GENERALIZED_INDUCED_KENDALL_TAU_DISTANCE, GENERALIZED_KENDALL_TAU_DISTANCE
class BioCo(BioConsert):
de... | StarcoderdataPython |
70353 | <reponame>shloak17107/WhatsApp-Key-Database-Extractor
import datetime
import os
try:
from termcolor import colored, cprint
except ImportError:
try:
os.system('pip3 install termcolor')
except:
os.system('python3 -m pip install termcolor')
def CustomInput(textToInput, color='green', attr=[]... | StarcoderdataPython |
3279009 | <reponame>peterzernia/wanderlist
# Generated by Django 2.1.2 on 2018-11-14 16:22
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('trips', '0003_auto_20181114_1128'),
]
operations = [
migrations.RemoveField(
model_name='tripreport',
... | StarcoderdataPython |
195353 | <reponame>ouyang-w-19/decogo
# MINLP written by GAMS Convert at 04/21/18 13:54:08
#
# Equation counts
# Total E G L N X C B
# 1481 195 380 906 0 0 0 0
#
# Variable counts
# x b i... | StarcoderdataPython |
1790643 | <reponame>ss9202150/Project_1
#
# Copyright (c) 2018 by Contributors
#
# 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 appl... | StarcoderdataPython |
165909 | <filename>08_concurrency/cralwer/tornado/crawler.py
import asyncio
import random
import string
from functools import partial
from tornado.httpclient import AsyncHTTPClient
AsyncHTTPClient.configure(
"tornado.curl_httpclient.CurlAsyncHTTPClient", max_clients=100 # <1>
)
def generate_urls(base_url, num_urls):
... | StarcoderdataPython |
3259805 | <filename>go/base/management/commands/go_send_app_worker_command.py
from django.core.management.base import BaseCommand, CommandError
from go.vumitools.api import VumiApiCommand
from go.base.utils import vumi_api, vumi_api_for_user
from go.base.command_utils import get_user_by_account_key
class Command(BaseCommand):... | StarcoderdataPython |
3236037 | import colander
from colander import SchemaNode, String
from kinto.core.utils import strip_whitespace, msec_time
class ResourceSchema(colander.MappingSchema):
"""Base resource schema, with *Cliquet* specific built-in options."""
class Options:
"""
Resource schema options.
This is me... | StarcoderdataPython |
171229 | <gh_stars>0
import os.path
from reformat import output
from reformat.store import Store
from reformat.util import rmtree
def clean(store: Store) -> int:
legacy_path = os.path.expanduser('~/.reformat')
for directory in (store.directory, legacy_path):
if os.path.exists(directory):
rmtree(di... | StarcoderdataPython |
1761496 | from app import app
import json
import os
from flask import jsonify, request
from app.services import user_services, auth_service, faq_services, exame_services
from app.util.decorator import requires_authn, requires_authz
from app.util.exceptions import AbroadException
@app.route('/', methods=['GET'])
def home():
... | StarcoderdataPython |
170273 | <reponame>jerumanu/blogs
import urllib.request,json
base_url = None
def configure_request(app):
global base_url
base_url = app.config['QUOTE_API_BASE_URL']
def getquote():
getquote_url ='http://quotes.stormconsultancy.co.uk/random.json'
with urllib.request.urlopen(getquote_url) as url:
get... | StarcoderdataPython |
1604740 | <gh_stars>0
from django.contrib.auth import get_user_model
from django.urls import reverse
from django.test import TestCase
from rest_framework import status
from rest_framework.test import APIClient
try:
from ...core.models import Tag, Recipe
except ImportError:
from core.models import Tag, Recipe
# The abo... | StarcoderdataPython |
3388047 | <filename>pyracing/jockey.py
from .common import Entity
class Jockey(Entity):
"""A jockey represents the human riding a runner"""
@classmethod
def get_jockey_by_id(cls, id):
"""Get the single jockey with the specified database ID"""
return cls.find_one({'_id': id})
@classmethod
def get_jockey_by_performan... | StarcoderdataPython |
95087 | from core.models import GitlabUser
from django.contrib.auth.models import User
from django.db.models.signals import post_save
from django.dispatch import receiver
from social_django.models import UserSocialAuth
@receiver(post_save, sender=UserSocialAuth)
def create_gitlab_user(sender, instance, **kwargs):
def cre... | StarcoderdataPython |
4800072 | from __future__ import unicode_literals
import json
import os
import django
from django.test import TestCase
from mock import patch
from job.test import utils as job_test_utils
from storage.configuration.json.workspace_config_v6 import WorkspaceConfigurationV6
from storage.test import utils as storage_test_utils
fro... | StarcoderdataPython |
50539 | from lights import *
open_car()
horn()
start_engine()
stop_engine()
| StarcoderdataPython |
130390 | import logging
import re
import sys
from anime_downloader.sites.anime import Anime, AnimeEpisode, SearchResult
from anime_downloader.sites import helpers
logger = logging.getLogger(__name__)
class WatchMovie(Anime, sitename='watchmovie'):
"""
Nice things
Siteconfig
----------
s... | StarcoderdataPython |
139241 | # -*- coding: utf-8 -*-
import uuid
from yandex_checkout.client import ApiClient
from yandex_checkout.domain.common.http_verb import HttpVerb
from yandex_checkout.domain.request.refund_request import RefundRequest
from yandex_checkout.domain.response.refund_list_response import RefundListResponse
from yandex_checkout.... | StarcoderdataPython |
70913 | <reponame>molssi-seamm/seamm_installer<gh_stars>1-10
# -*- coding: utf-8 -*-
"""Non-graphical part of the SEAMM Installer
"""
from datetime import datetime
import json
import logging
import os
from pathlib import Path
import pkg_resources
import pprint
import shlex
import shutil
import subprocess
import sys
import te... | StarcoderdataPython |
198874 | <gh_stars>1-10
# Copyright 2021 The Orbit 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 ... | StarcoderdataPython |
4841383 | """Test InstallJson"""
# pylint: disable=R1710
# standard library
import json
import os
import shutil
from pathlib import Path
# third-party
from deepdiff import DeepDiff
# first-party
from tcex.app_config.install_json import InstallJson
class TestInstallJson:
"""App Config InstallJson testing."""
def setu... | StarcoderdataPython |
74043 | <gh_stars>10-100
# -*- coding: utf-8 -*-
"""
Peony Clients
:class:`BasePeonyClient` only handles requests while
:class:`PeonyClient` adds some methods that could help when using
the Twitter APIs, with a method to upload a media
"""
import asyncio
import io
from contextlib import suppress
import logging
try:
from... | StarcoderdataPython |
3251259 | # Copyright 2020 Xiaomi Corporation (author: <NAME>)
# See ../../../LICENSE for clarification regarding multiple authors
#
# 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://... | StarcoderdataPython |
135864 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django import forms
from django.utils.translation import ugettext_lazy as _
from .models import CommentLike
class LikeForm(forms.ModelForm):
class Meta:
model = CommentLike
fields = []
def __init__(self, user=None, comme... | StarcoderdataPython |
3278890 | <gh_stars>0
"""
@created_at 2015-05-11
@author <NAME> <<EMAIL>>
"""
from klass_exception import KlassException
class Klass:
"""Define a sample class"""
def __init__(self):
pass
def new_method(self):
raise KlassException("Not implemented yet")
def __str__(self):
... | StarcoderdataPython |
1675121 | <reponame>ed-fish/collaborative-multi-modal-video-transformer<filename>src/pl_modules/model.py
from typing import Any, Dict, Sequence, Tuple, Union
import math
import hydra
import omegaconf
import pytorch_lightning as pl
import torch
import torch.nn as nn
from torch.nn import TransformerEncoder, TransformerEncoderLayer... | StarcoderdataPython |
24291 | <filename>TextAdventure.py<gh_stars>0
start = '''You wake up one morning and find yourself in a big crisis.
Trouble has arised and your worst fears have come true. Zoom is out to destroy
the world for good. However, a castrophe has happened and now the love of
your life is in danger. Which do you decide to save to... | StarcoderdataPython |
3214560 | import torch
from torch import nn
class BatchNormConv1d(nn.Module):
r"""A wrapper for Conv1d with BatchNorm. It sets the activation
function between Conv and BatchNorm layers. BatchNorm layer
is initialized with the TF default values for momentum and eps.
Args:
in_channels: size of each input... | StarcoderdataPython |
3219839 | from typing import Optional
from maneuvers.driving.drive import Drive
from maneuvers.driving.travel import Travel
from maneuvers.maneuver import Maneuver
from rlutilities.linear_algebra import vec3, norm, normalize
from rlutilities.simulation import Car
from tools.drawing import DrawingTool
from tools.math imp... | StarcoderdataPython |
102518 | <reponame>EstebanDalelR/LearningPythonTheHardWay
tabby_cat = "\tI'm tabbed in"
persian_cat = "I'm split \non a line"
backslash_cat = "I \\ am a \\ cat"
fat_cat = """
I'll do a list:
\t*pizza
\t*lasagna
\t*burguers \n\t*soda
"""
print tabby_cat
print persian_cat
print backslash_cat
print fat_cat
| StarcoderdataPython |
3351097 | from __future__ import annotations
""" Classes and functions for pipette state tracking
"""
from dataclasses import asdict, replace
import logging
from typing import Any, Dict, Optional, Set, Tuple, Union, TYPE_CHECKING
from opentrons.types import Point
from opentrons.calibration_storage.types import PipetteOffsetByPi... | StarcoderdataPython |
1630877 | <filename>plata/payment/modules/ogone.py<gh_stars>1-10
"""
Payment module for Ogone integration
Needs the following settings to work correctly::
OGONE = {
'PSPID': 'your_shop_id',
'LIVE': True, # Or False
'SHA1_IN': 'yourhash',
'SHA1_OUT': 'yourotherhash',
}
"""
from __fut... | StarcoderdataPython |
1656190 | <filename>roses/rosebiology/migrations/0002_rose.py
# -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2016-04-21 07:18
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('rosebiology', '0001_initial'),
]
o... | StarcoderdataPython |
1662834 | <filename>Strings.py<gh_stars>0
# coding=utf8
""" Strings Module
Holds several methods for validating and manipulating strings
"""
# Import future
from __future__ import print_function, absolute_import
__author__ = "<NAME>"
__copyright__ = "OuroborosCoding"
__maintainer__ = "<NAME>"
__email__ = "<EMAIL>"
__created... | StarcoderdataPython |
3062 | import abc
from typing import TypeVar, Generic, List, Dict
T = TypeVar('T')
class CRUDInterface(Generic[T], metaclass=abc.ABCMeta):
@abc.abstractmethod
def all(self) -> List[T]:
pass
@abc.abstractmethod
def one_by_id(self, entity_id: int) -> T:
pass
@abc.abstractmethod
def ... | StarcoderdataPython |
3348994 | <filename>content/migrations/0019_auto_20200330_1100.py
# Generated by Django 3.0 on 2020-03-30 16:00
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('content', '0018_auto_20200323_1458'),
]
operations = [
... | StarcoderdataPython |
1656113 | <reponame>SINTEFMedtek/libromocc
from unittest import TestCase
import numpy as np
from pyromocc import CalibrationMethods
class TestCalibration(TestCase):
def setUp(self) -> None:
pass
def test_calibration_shah(self):
poses_a = np.random.random((100, 4, 4))
poses_b = poses_a
... | StarcoderdataPython |
3368982 | <filename>main.py
from covidui import CovidUi
cui = CovidUi("COVID-19 Monitor")
cui.show() | StarcoderdataPython |
4821665 | <filename>samples/python/13.core-bot/envs/chat_bot_02/Lib/site-packages/datatypes_date_time/timex_convert.py
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
class TimexConvert:
@staticmethod
def convert_timex_to_string(timex):
return ''
| StarcoderdataPython |
3276255 | from setuptools import setup, find_packages
package_name = 'bt_learning'
setup(
name=package_name,
version='0.0.0',
maintainer='<NAME>',
maintainer_email='<EMAIL>',
description='TODO: Package description',
license='TODO: License declaration',
packages=find_packages(),
install_requires=... | StarcoderdataPython |
3325478 | <filename>flask_app/analyser/tweets.py
import os
import tweepy
from huepy import * # refer to this https://github.com/s0md3v/huepy
import re
import time
import pandas as pd
from pandas import DataFrame
from mtranslate import translate
from textblob import TextBlob
import nltk
from nltk.corpus import stopwords
from nlt... | StarcoderdataPython |
1771416 | <reponame>reddymeghraj/beerbar
# Copyright (c) 2013, wayzon and Contributors
# See license.txt
import frappe
import unittest
test_records = frappe.get_test_records('Stock')
class TestStock(unittest.TestCase):
pass
| StarcoderdataPython |
155576 | <filename>modules/querychapter.py
import time
from textwrap import dedent
from gluon import current
from constants import ALWAYS
from helpers import debug, delta
class QUERYCHAPTER:
def __init__(self):
pass
def makeQCindexes(self):
VERSIONS = current.VERSIONS
for vr in (
... | StarcoderdataPython |
3340446 | <filename>Mundo 1 Fundamentos/ex011.py
# DESAFIO 011
# Faça um programa que leia a largura e a altura de uma parede em metros, calcule a sua área e a quantidade
# de tinta necessária para pintá-la, sabendo que cada litro de tinta, pinta uma área de 2m².
larg = float(input('Largura da parede: '))
alt = float(input('Alt... | StarcoderdataPython |
1604191 | # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc
from ...api.v1 import trading_data_pb2 as data__node_dot_api_dot_v1_dot_trading__data__pb2
class TradingDataServiceStub(object):
"""Missing associated docu... | StarcoderdataPython |
4800538 | import socket
conn = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
conn.connect(("127.0.0.1", 14900))
data = conn.recv(16384)
print(data.decode("utf-8"))
conn.close() | StarcoderdataPython |
99619 | '''
Inhalte Arbeit:
- Werte einlesen mit try except block
- if - Verzweigungen
- for - Schleifen (for in ....)
for i in lst:
for i in range(10):
- list - anhängen, sortieren, löschen, ist etwas in einer Liste
- dict - keys zugreifen - values zugreifen und auf beide zugreifen
- files - lesen und schreiben
Übungsprogra... | StarcoderdataPython |
1719549 | <reponame>IvanTodorovBG/SoftUni
import re
data = input()
pattern = r"(www\.([a-zA-Z0-9]+(\-[a-zA-Z0-9]+)*)\.([a-z]+(\.[a-z]+)*))"
while data != "":
for match in re.finditer(pattern, data):
print(match.group(1))
data = input()
| StarcoderdataPython |
1773884 | import math
from bisect import bisect, insort
from cocos.batch import BatchNode
from cocos.euclid import Vector2, Matrix3
class Picker(object):
""" A picker to find your children quickly """
def __init__(self):
self.xChildren = {}
self.yChildren = {}
self.xs = []
self.ys = []
... | StarcoderdataPython |
3226983 | <filename>src/margipose/data/mpi_inf_3dhp/preprocess.py<gh_stars>10-100
import os
from os import path
import numpy as np
from scipy.io import loadmat
import torch
from subprocess import call
from shutil import copy, move
from tqdm import tqdm
from tempfile import TemporaryDirectory
import h5py
import PIL.Image
import P... | StarcoderdataPython |
119442 | <filename>finitewave/cpuwave3D/model/__init__.py<gh_stars>0
from finitewave.cpuwave3D.model.aliev_panfilov_3d import AlievPanfilov3D
from finitewave.cpuwave3D.model.luo_rudy91_3d import LuoRudy913D
from finitewave.cpuwave3D.model.tp06_3d import TP063D
| StarcoderdataPython |
3385348 | <reponame>binyao2020/ElegantRL
from AgentRun import *
from AgentNet import *
from AgentZoo import *
"""
beta2 check ModPPO CarRacing
beta3 check InterPPO CarRacing
ceta1 check PPO Minitaur
"""
class AgentModSAC(AgentBaseAC):
def __init__(self, state_dim, action_dim, net_dim):
super(AgentBaseAC, self).__... | StarcoderdataPython |
3282789 | # Django
from django.core.management.base import BaseCommand, CommandError
from django.core.management import call_command
# Models
from superadmin.models import Action, Menu
#
from superadmin import site
class Command(BaseCommand):
help = "Create base menu mapping all apps"
def handle(self, *args, **optio... | StarcoderdataPython |
1701115 | '''初始化'''
from .musicplayer import MusicPlayer | StarcoderdataPython |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.