id stringlengths 1 8 | text stringlengths 6 1.05M | dataset_id stringclasses 1
value |
|---|---|---|
8179869 | <reponame>FastmoreCrak/Fantasmas<filename>assistant/ytdl.py
# Ultroid - UserBot
# Copyright (C) 2020 TeamUltroid
#
# This file is a part of < https://github.com/TeamUltroid/Ultroid/ >
# PLease read the GNU Affero General Public License in
# <https://www.github.com/TeamUltroid/Ultroid/blob/main/LICENSE/>.
import async... | StarcoderdataPython |
1745484 | <gh_stars>0
#!/usr/bin/env python
import socket
import json
import sys
import rospy
from geometry_msgs.msg import Vector3Stamped
if len(sys.argv)<3:
print("usage cmd ip_address topic_name")
exit()
ip = sys.argv[1]
port = 7005
# Create a UDP socket at client side
UDPClientSocket = socket.socket(family=socket... | StarcoderdataPython |
35661 | <gh_stars>0
from importlib.util import spec_from_file_location, module_from_spec
from os import listdir
from os.path import join
def load_cls(file_path: str, class_name: str):
s = spec_from_file_location(class_name, file_path)
m = module_from_spec(s)
s.loader.exec_module(m)
return m.__dict__[class_nam... | StarcoderdataPython |
3245513 | import platform
from setuptools import setup, Extension
# from distutils.core import setup
# from distutils.extension import Extension
from Cython.Build import cythonize
compile_extra_args = []
link_extra_args = []
if platform.system() == "Windows":
compile_extra_args = ["/std:c++latest", "/EHsc"]
elif platform.s... | StarcoderdataPython |
6671498 | from sympy import Symbol
x = Symbol( 'x' )
x + x + 1
x.name
a = Symbol( 'x' )
a.name
from sympy import symbols
x,y,z = symbols( 'x,y,z' )
x = Symbol( 'x' )
y = Symbol( 'y' )
s = x*y + x*y
s
p = ( x + 2) * ( x + 3 )
p
x = Symbol( 'x' )
y = Symbol( 'y' )
from sympy import factor, expand
expr = x**2 - y**2
fa... | StarcoderdataPython |
8020439 | from char_rbm.simple import CharRBM
dataset = "data/black_metal_bands.txt"
rbm = CharRBM()
train = True
if train:
rbm.train(dataset, preserve_case=True)
rbm.save()
else:
model_path = "models/heavy_metal_bands_.pickle"
rbm.load(model_path)
samples = rbm.sample()
print(samples)
| StarcoderdataPython |
8053454 | import re
import PyQt5.QtCore as qC
import PyQt5.QtGui as qG
import PyQt5.QtWidgets as qW
from oguilem.configuration import conf
from oguilem.configuration.utils import BuildingBlockHelper, ConnectedValue
from oguilem.resources import globopt
from oguilem.ui.widgets import InactiveDelegate, SmartLineEdit
class OGUI... | StarcoderdataPython |
3316966 | <filename>rotkehlchen/errors/api.py
from typing import Any, Dict, Optional
class RotkehlchenPermissionError(Exception):
"""Raised at login if we need additional data from the user
The payload contains information to be shown to the user by the frontend so
they can decide what to do
"""
def __init... | StarcoderdataPython |
5145194 | """
Wrap caproto to give utilities methods for access in one place
"""
import json
import time
from caproto.threading.client import Context
from caproto.sync.client import read
from caproto import CaprotoError
from HLM_PV_Import.logger import pv_logger, logger
from HLM_PV_Import.settings import CA
from HLM_PV_Import.... | StarcoderdataPython |
3244114 | """Module for matchers."""
from ._phrasematcher import _PhraseMatcher
from .fuzzymatcher import FuzzyMatcher
from .regexmatcher import RegexMatcher
from .similaritymatcher import SimilarityMatcher
from .tokenmatcher import TokenMatcher
__all__ = [
"_PhraseMatcher",
"FuzzyMatcher",
"RegexMatcher",
"Simi... | StarcoderdataPython |
3207830 | #!/usr/bin/python3.8
import argparse
from query_type import QueryType
import socket
import time
import ipaddress
from serializer import Serializer
from deserializer import Deserializer
class DNSClient:
def __init__(self, params):
self.name = params.name
self.address = params.address... | StarcoderdataPython |
5159131 | <reponame>AlbertSuarez/weCooltra
DB_USER = 'postgres'
DB_DB = 'postgres'
DB_PORT = 5432
RANDOM_API_ENDPOINT = 'https://randomuser.me/api/'
__all__ = [
'DB_USER',
'DB_DB',
'DB_PORT',
'RANDOM_API_ENDPOINT'
]
| StarcoderdataPython |
3585541 | from swaggertosdk.restapi.sdkbot import GithubHandler
def test_sdk_bot_git(github_client, github_token):
handler = GithubHandler(github_token)
repo = github_client.get_repo("lmazuel/TestingRepo")
issue = repo.get_issue(11)
output = handler.git(issue, "show", "2a0c2f0285117ccb07b6f9c32749d6c50abed70b... | StarcoderdataPython |
1846970 | <reponame>DonikaChervenkova/SoftUni
def steal(all_loots, comm):
count = int(comm[1])
items_to_steal = all_loots[-count:None]
print(", ".join(items_to_steal))
del all_loots[-count:None]
return all_loots
def drop(all_loots, comm):
index = int(comm[1])
if 0 <= index < len(all_loots):
... | StarcoderdataPython |
11215733 | <gh_stars>0
from github import Github
import requests
g = Github("a348eca2e402afc861d44d03f84e547ab5668170")
#for repo in g.get_user().get_repos():
#print(repo.name)
repo = g.get_repo("TommyVaughan/dataRepresentation")
#print(repo.clone_url)
fileInfo = repo.get_contents("test.txt")
urlOfFile = fileInfo... | StarcoderdataPython |
1741770 | <reponame>Ryan-HT/air-quality-lnu-project
# https://github.com/JurassicPork/DHT_PyCom
import time
from machine import enable_irq, disable_irq, Pin
class DHTResult:
'DHT sensor result returned by DHT.read() method'
ERR_NO_ERROR = 0
ERR_MISSING_DATA = 1
ERR_CRC = 2
error_code = ERR_NO_ERROR
t... | StarcoderdataPython |
1902516 | <gh_stars>1-10
from threading import Thread
import datetime
import logging
import time
import pytest
from freezegun import freeze_time
from logrotor.runner import Runner
UDP_PORT = 1024
@pytest.fixture
def runner(tmpdir):
config = {
'flush_every_seconds': 5,
'rotate_every_seconds': 3600,
... | StarcoderdataPython |
4818847 | from django.apps import AppConfig
from herbie import settings
class HerbieappConfig(AppConfig):
name = settings.APP_LABEL
| StarcoderdataPython |
186259 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('mp', '0006_preference_paid'),
]
operations = [
migrations.AddField(
model_name='preference',
name='p... | StarcoderdataPython |
3293690 | <reponame>Samathy/requirements_checker
import argparse
import requirements
import requests
import json
import re
import functools
from pprint import pprint
from pip._internal.req import parse_requirements as _parse_requirements
from pip._vendor.packaging import specifiers
requirement_matcher = re.compile(r"(.*)(==|... | StarcoderdataPython |
3506522 | <filename>herbarium/modeling/__init__.py
# Copyright (c) Facebook, Inc. and its affiliates.
from herbarium.layers import ShapeSpec
from .backbone import (
BACKBONE_REGISTRY,
Backbone,
ResNet,
ResNetBlockBase,
build_backbone,
build_resnet_backbone,
make_stage,
)
from .meta_arch import (
... | StarcoderdataPython |
8146808 | <gh_stars>100-1000
"""Test utils.slug."""
# Standard Library
import uuid
# Websauna
from websauna.utils.slug import slug_to_uuid
from websauna.utils.slug import uuid_to_slug
def test_uuid_slug():
"""Make short slugs for 64-bit UUID ids."""
_uuid = uuid.uuid4()
_uuid2 = slug_to_uuid(uuid_to_slug(_uuid))
... | StarcoderdataPython |
5122169 | <reponame>serivt/serivt-blog
import pytest
from mixer.backend.django import mixer
from django.conf import settings
@pytest.fixture
def api_client():
from rest_framework.test import APIClient
return APIClient()
@pytest.fixture
def auth_api_client(db, api_client):
user = mixer.blend(settings.AUTH_USER_M... | StarcoderdataPython |
6696308 | <filename>spirouPolar.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Spirou polarimetry module
Created on 2018-06-12 at 9:31
@author: <NAME>
"""
import numpy as np
import os
import astropy.io.fits as fits
import matplotlib.pyplot as plt
from scipy.interpolate import interp1d
from scipy import interpolate
fro... | StarcoderdataPython |
11204776 | <gh_stars>1000+
# tests list.clear
x = [1, 2, 3, 4]
x.clear()
print(x)
| StarcoderdataPython |
9763251 | <reponame>Natan7/vault<filename>dashboard/views.py
# -*- coding: utf-8 -*-
from django.views.generic.base import TemplateView
from vault.views import LoginRequiredMixin
class DashboardView(LoginRequiredMixin, TemplateView):
template_name = "dashboard/dashboard.html"
| StarcoderdataPython |
251559 | <filename>zwierzeta/antylopa.py
from zwierzeta.zwierze import Zwierze
import random
class Antylopa(Zwierze):
def __init__(self, swiat, ruch=False , x=-1, y=-1):
self.sila = 4
self.priorytet = 4
self.obecnySwiat = swiat
if x == -1:
super().__init__(swiat, 4, 4, "chocolate... | StarcoderdataPython |
1622463 | from django.db import models
from django.conf import settings
import datetime
from django.db import models
from django.db.models import permalink
# Create your models here.
class Org(models.Model):
name = models.CharField(max_length=50, unique=True)
created_date = models.DateTimeField(auto_now_add=True, null=... | StarcoderdataPython |
11326419 | import os
import cv2
import numpy as np
from skimage.io import imread
from sklearn.model_selection import GroupKFold
from sklearn.utils import shuffle
from torch.utils.data import Dataset
import config
class CarvanaTrainDataset(Dataset):
def __init__(self, mode, folds, fold_num, transform=None):
assert ... | StarcoderdataPython |
9655011 | from sqlalchemy import Column, Integer, String, Table, DateTime, Float, Boolean, ForeignKey, ForeignKeyConstraint
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relationship, backref, class_mapper
Base = declarative_base()
class HVACIssue(Base):
"""Class to map to the HVACIssue ta... | StarcoderdataPython |
6652146 | from . import (
expressions,
blocks,
controls,
core
)
supported_languages = ['js', 'go']
Transpiler = core.Transpiler
| StarcoderdataPython |
5043155 | <filename>setup.py
# vim: set ts=2 expandtab:
from setuptools import setup
#version 0.2: include basic webserver and jisho database display
#version 0.3: added katakanize function
#version 0.4: Removed web backend for easier running
# Web backend still available in weeabot_site repository.
def readme():
... | StarcoderdataPython |
1654587 | import os
from graphviz import Digraph
from chor_auto import ChoreographyAutomata
from .utils import extract_name, get_string_from_tokens, get_interaction_string
from .DOTParser import DOTParser
from .DOTVisitor import DOTVisitor
class DomitillaVisitor(DOTVisitor):
"""
This class is based on the ANTLR visitor... | StarcoderdataPython |
1899272 | __author__ = 'tmy'
from src.SparqlInterface.src.Interfaces.AbstractClient import SparqlConnectionError
from src.Utilities.Logger import log
def materialize_to_file(instance=None, types=None, target=None, server=None):
if not types:
types = __get_all_types(instance, server)
with open(target, "a+") as ... | StarcoderdataPython |
4962269 | # --------------
import pandas as pd
import numpy as np
import math
#Code starts here
class complex_numbers:
def __init__(self, real, imag):
self.real = real
self.imag = imag
def __repr__(self):
if self.real == 0.0 and self.imag == 0.0:
return "0.00"
... | StarcoderdataPython |
6515489 | # -*- coding: utf-8 -*-
"""utilities.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/19uSO6SzDVwHjK887O6uGLBbNTuENcGrH
"""
import torch
import numpy as np
import torch.nn as nn
import pdb
# import gc
# import logging
# from tqdm import tqdm
# fr... | StarcoderdataPython |
4857085 | from math import fabs
a = float(input('Digite o comprimento da primeira reta: '))
b = float(input('Digite o comprimento da segunda reta: '))
c = float(input('Digite o comprimento da terceira reta: '))
if fabs(b - c) < a < b + c and fabs(a - c) < b < a + c and fabs(a - b) < c < a + b:
print('Essas retas podem sim fo... | StarcoderdataPython |
9728839 | <reponame>kczauz/PerfKitBenchmarker
# Copyright 2018 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/LICE... | StarcoderdataPython |
11215250 | <gh_stars>1-10
import numpy as np
from deepartransit.utils.scaling import Scaler, MeanStdScaler, MinMaxScaler
def test_Scalers():
fixtures = []
fixtures.append([np.random.uniform(0, 1, size=(100, 6, 5)), None, 0])
fixtures.append([np.random.uniform(0, 1, size=(100, 1, 5)), None, 0])
fixtures.append([... | StarcoderdataPython |
9726432 | from django.urls import reverse
from rest_framework import serializers
from accounts.serializers import UserBasicPublicSerializer
from posts.models import Post
class Post_ToThreadRelation_Serializer(serializers.ModelSerializer):
url = serializers.CharField(source='get_absolute_url')
thread_title = serializers.C... | StarcoderdataPython |
9681453 | <filename>coding/learn_mock/demo.py
from mock import patch
import fake_filesystem
import coding.learn_mock.hardware.memory as memory
def fake_fs(path, data):
fs = fake_filesystem.FakeFilesystem()
fs.CreateFile(path, contents=data)
return fake_filesystem.FakeFileOpen(fs)
def demo():
path = "/proc/me... | StarcoderdataPython |
11250057 | <filename>Python_Day1.py
# Python Numbers(int, float,complex)
a = 5 # integer
type(a)
A = 2.0 # float
type(A)
AA = 1+2j # complex
type(AA)
#############################################
#################
## Strings
# this is a ordered sequence of characters, then we can index it and slice it
name =... | StarcoderdataPython |
1976351 | from datetime import datetime
from datetime import timedelta
from time import sleep
from time import time
from .parser import parse
from .settings import load_settings
from .utils import upgrade_db
if __name__ == "__main__":
settings = load_settings()
logger = settings["logger"]
if settings["db_upgrade"]... | StarcoderdataPython |
1655494 | <filename>simrcm/simulation.py
import simrcm.sim_tools
import cantera as ct
import numpy as np
def simulation1(filename):
"""
The main algorithim for running a simulation case and evaluationg the ignition delay time
Returns
-------
ignition_delay : Igition delay time
pressure: List of rea... | StarcoderdataPython |
3572315 | <filename>banner/banner.py
#!/usr/bin/python3
# -*- coding:utf8 -*-
from termcolor import colored, cprint
def gh():
banner = """
__________________ ___________ ________ ___ ___
\_ _____/\ \\__ ___/ / _____/ / | \
| __) / | \ | | ______ / \ ___... | StarcoderdataPython |
8197062 | #!/usr/bin/python3
# Quick and hacky Python script
# to generate a lua script with
# a table of minecraft item prices
def main():
with open("market_prices_table.txt") as file:
source_text = file.read()
lines = source_text.splitlines()
lua_text = """
-- prices.lua
-- Table for prices for different... | StarcoderdataPython |
3255342 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.13 on 2018-07-26 18:38
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('zerver', '0175_change_realm_audit_log_event_type_tense'),
]
operations = [
migrati... | StarcoderdataPython |
1993649 | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
import numpy as np
import os
import cv2
import torch
import tqdm
from iopath.common.file_io import g_pathmgr
import slowfast.utils.checkpoint as cu
import slowfast.utils.logging as logging
from slowfast.datasets.ava_helper ... | StarcoderdataPython |
383335 | <filename>python/src/CreateBathy/create_barrier_existing_bathy.py<gh_stars>0
from clawpack.geoclaw import topotools
import os
import numpy as np
import matplotlib.pyplot as plt
topo = topotools.Topography()
def read_bathy(file, topo):
"""
:param file: bathymetry file name/path
:return:
""... | StarcoderdataPython |
5182789 | import csv
records = []
with open('data.csv') as f:
reader = csv.reader(f)
for row in reader:
records.append(row[0])
#for column in reader:
# records.append(column[1])
print("{title}\n".format(title=records[2]))
print("{title}\n".format(title=records[5])) | StarcoderdataPython |
4822213 | import django_filters
from .models import PlayList, Tag
class PlayListFilter(django_filters.rest_framework.FilterSet):
"""歌单的api的过滤器"""
lid = django_filters.CharFilter(field_name='lid')
name = django_filters.CharFilter(field_name='name')
created = django_filters.CharFilter(field_name='created')
t... | StarcoderdataPython |
8072967 | """
This library offers functions to parse different types of SNPs data from multiple formats into a snpsData objects.
Author: <NAME>
Email: <EMAIL>
"""
import time, random
import cPickle
from snpsdata import *
import scipy as sp
import h5py
# this should be fixed
#Standard missing value is N (Used to be NA)
missi... | StarcoderdataPython |
6520816 | import socket
from sys import argv
import time
from udt4py import UDTSocket, UDTException
if __name__ == "__main__":
SIZE = 15 * 1000 * 1000
msg = bytearray(SIZE)
sock_type = argv[1][0:3]
argv[1] = argv[1][6:]
HOST, PORT = argv[1].split(':')
addr = (HOST, int(PORT))
N = int(argv[2])
if... | StarcoderdataPython |
6526883 | <gh_stars>1-10
# Generated by Django 3.1.1 on 2020-12-10 10:40
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("verifications", "0001_initial")]
operations = [
migrations.AlterField(
model_name="verification",
name="is_verified... | StarcoderdataPython |
4832363 | import requests
import random
import time
from bs4 import BeautifulSoup
class Scraper(object):
'''
Scraper utility class to fetch recipes from TheKitchn
'''
def __init__(self):
''' Global variables '''
self.sitemap = 'https://www.thekitchn.com/sitemap.xml'
self.h... | StarcoderdataPython |
5023337 | <reponame>sjtumultiagent/on-policy-main
import torch
from torch.utils.tensorboard import SummaryWriter
from onpolicy.algorithms.r_mappo.algorithm.r_actor_critic import R_Actor, R_Critic
from onpolicy.utils.util import update_linear_schedule
class R_MAPPOPolicy:
"""
MAPPO Policy class. Wraps actor and critic... | StarcoderdataPython |
8005808 | <reponame>shellytang/intro-cs-python<filename>01_week5_OOP/person-example.py
import datetime
class Person(object):
def __init__(self, name):
self.name = name
self.birthday = None
self.lastName = name.split(' ')[-1] # extract last element of that list
def getLastName(self):
... | StarcoderdataPython |
3321078 | <reponame>intel/wult<gh_stars>1-10
# -*- coding: utf-8 -*-
# vim: ts=4 sw=4 tw=100 et ai si
#
# Copyright (C) 2019-2021 Intel Corporation
# SPDX-License-Identifier: BSD-3-Clause
#
# Authors: <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
"""
This module the base class for generating HTML reports for raw test results.
""... | StarcoderdataPython |
9609932 | # AutoTransform
# Large scale, component based code modification library
#
# Licensed under the MIT License <http://opensource.org/licenses/MIT>
# SPDX-License-Identifier: MIT
# Copyright (c) 2022-present <NAME> <http://github.com/nathro>
# @black_format
"""The heart of AutoTransform, AutoTransformSchemas represent a... | StarcoderdataPython |
3368119 | <filename>tests/test_connection.py
import json
import time
from queue import Empty
from threading import Event, Thread
from pytest import raises
import pywebostv.connection
from pywebostv.connection import WebOSClient
from utils import FakeClient
class TestWebOSClient(object):
def test_unique_id(self):
... | StarcoderdataPython |
1604953 | <reponame>clark3493/machine_learning
import numpy as np
class Perceptron(object):
def __init__(self,
eta=0.01,
n_iter=50,
random_state=1):
self.eta = eta
"""
Learning rate (between 0.0 and 1.0)
:type eta: float
"""
... | StarcoderdataPython |
6540840 | from pathlib import Path
from step5 import load_field
TEST_INPUT = Path(__file__).parent / 'step5.txt'
REAL_INPUT = Path(__file__).parent.parent / 'src/step5.txt'
def test_step5():
field = load_field(TEST_INPUT)
assert field.display() == '''.......1..
..1....1..
..1....1..
.......1..
.112111211
..........
.... | StarcoderdataPython |
9604949 | import pygame
from scene import Scene
from level import Level
from text import Text
class MenuScene(Scene):
def __init__(self, director, background=(92, 150, 252)):
super().__init__(director)
self.background = background
self.screen = director.screen
text_rect = pygame.Rect(0, 2... | StarcoderdataPython |
4929536 | # -*- coding: utf-8 -*-
"""
"""
import arrow
from flask import g
from base.utils.pubs import id_type
from base.threads.models import Thread
from flask_wtf import Form
from wtforms import TextField, TextAreaField, ValidationError, SelectField
from wtforms.validators import Required
from base.frontends.views import get_... | StarcoderdataPython |
5177284 | from __future__ import annotations
from datetime import datetime
from databases.core import Database
from orm import ModelRegistry, Model, BigInteger, String, DateTime, ForeignKey
from pydantic.main import BaseModel
import env
database = Database(env.db_uri)
registry = ModelRegistry(database)
class User(Model):
... | StarcoderdataPython |
118701 | """High level parallel chip-seq analysis
"""
import os
import copy
import toolz as tz
from bcbio.log import logger
from bcbio import utils
from bcbio.pipeline import config_utils
from bcbio.pipeline import datadict as dd
from bcbio.provenance import do
from bcbio.distributed.transaction import file_transaction
def g... | StarcoderdataPython |
1961532 | <reponame>Riteme/test
#!/usr/bin/env pypy
from random import *
n = 5000
print n
P = range(1, n + 1)
shuffle(P)
print " ".join(map(str, P))
for i in xrange(2, n + 1):
u = randint(1, i - 1)
print u, i
| StarcoderdataPython |
6513668 | <filename>main/model/logistic_regression.py
# -*- coding: utf-8 -*-
# @Time : 2020/1/14 下午8:04
# @Author : updbdipt
# @Project : CDW_FedAvg
# @FileName: logistic_regression
import numpy as np
import tensorflow as tf
import tensorflow.nn.rnn_cell as rnn
from main.model.model import Model
from main.utils.model_utils... | StarcoderdataPython |
6412152 | num = str(input("country flag:"))
import requests
import json
url = "https://api.coinbase.com/v2/prices/spot?currency=KRW"
response = requests.get(url)
data = response.text
parsed = json.loads(data)
amount_data = parsed["data"]["amount"]
y = (str(amount_data))
print ("#bitcoin ","South Korean Won" ,"price:","₩"+str(y)... | StarcoderdataPython |
8033617 | class Invader(object):
velocity = 64
def __init__(
self,
enemy_type,
hp,
pos_x,
pos_y,
sprites
):
self.enemy_type = enemy_type
self.hp = hp
self.pos_x = pos_x
self.pos_y = pos_y
self.sprites = sprites
def move_x(se... | StarcoderdataPython |
11226171 | import pytest
from utgardtests.filewriter import messageprocessor
def get_filewriter_status_master_msg(kafka_timestamp):
payload = {
"files": {
"unit-test-1": {
"filename": "/var/opt/dm_group/kafka-to-nexus/data.nxs",
"topics": {
"FAKE_detect... | StarcoderdataPython |
1737072 | <filename>three.py/core/Mesh.py
import numpy as np
from OpenGL.GL import *
from core import Object3D
class Mesh(Object3D):
def __init__(self, geometry, material):
super().__init__()
self.geometry = geometry
self.material = material
self.visible = True
# passing shade... | StarcoderdataPython |
6495693 | <gh_stars>100-1000
#!/bin/false
# This file is part of Espruino, a JavaScript interpreter for Microcontrollers
#
# Copyright (C) 2013 <NAME> <<EMAIL>>
#
# 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... | StarcoderdataPython |
8129146 | <reponame>pauldmccarthy/fsleyes
#!/usr/bin/env python
#
# gltensor_funcs.py - OpenGL2.1 functions used by the GLTensor class.
#
# Author: <NAME> <<EMAIL>>
#
"""This module provides functions which are used by the :class:`.GLTensor`
class for rendering :class:`.DTIFitTensor` overlays, and compatible
:class:`.Image` over... | StarcoderdataPython |
8180375 | <reponame>tudou0002/NEAT<filename>extractors/filter.py
# from tokenizers.implementations import ByteLevelBPETokenizer
# from tokenizers.processors import BertProcessing
from transformers import RobertaTokenizerFast
from transformers import RobertaConfig
from transformers import RobertaForMaskedLM
from transformers impo... | StarcoderdataPython |
3291460 | <reponame>Alecto3-D/testable-greeter
# This file is part of Buildbot. Buildbot is free software: you can
# redistribute it and/or modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation, version 2.
#
# This program is distributed in the hope that it will be useful, bu... | StarcoderdataPython |
8012777 | <gh_stars>1-10
def edit():
import sqlite3
from tabulate import tabulate
con=sqlite3.connect('Library.sqlite')
cur=con.cursor()
print("\n\n********** PRINTING THE CURRENT LIBRARY DATABASE ***********\n\n")
cur.execute(" SELECT Book_Name, Author, Quantity, Book_id F... | StarcoderdataPython |
6499396 | # -*- coding: utf-8 -*-
#
# 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 |
350724 | <filename>sms_gateway/__main__.py
import argparse
import logging
import secrets
import threading
import time
from wsgiref.simple_server import make_server
import falcon
from falcon_auth import FalconAuthMiddleware, TokenAuthBackend
import sms_gateway.config as config
from .background_threads.sms_sender import send_sm... | StarcoderdataPython |
1991159 | <gh_stars>0
"""
Do you know the difference between the following syntax?
[x for x in range(5)]
(x for x in range(5))
tuple(range(5))
See https://djangostars.com/blog/list-comprehensions-and-generator-expressions/
list reserves memory for the whole list and calculates it on the spot. In case of generator, we receive ... | StarcoderdataPython |
3468116 | <reponame>Fiji05/PA
import requests
import datetime
import json
import time
import schedule
from twilio.rest import Client
from random import randint
import os
from dotenv import load_dotenv
load_dotenv('.env')
news_api_key = os.getenv('NEWS_API_KEY')
weather_api_key = os.getenv('WEATHER_API_KEY')
zip_code = os.getenv(... | StarcoderdataPython |
8015538 | from qiskit import IBMQ, Aer, BasicAer, execute
from qiskit.providers.ibmq import least_busy
from qiskit.tools.monitor import job_monitor
from qiskit.providers.aer.noise import NoiseModel
def run_circuit_QASM(device, noise, fitter, circuit, quantum_register, classical_register):
circuit.measure(quantum_register,c... | StarcoderdataPython |
1847143 | <reponame>Bram-Hub/gui_resolution
from tkinter import *
from tkinter import ttk
# a fuction to modify the message variable
def addToMessage():
temp = message.get()
temp += '.'
message.set(temp)
# a function to be used with the entry box
def modText(window):
text = entered.get()
for i in range(len(... | StarcoderdataPython |
3363245 | #! /usr/bin/env python3
import rospy
import actionlib
import actionlib_tutorials.msg
class FibonacciAction(object):
# create messages that are used to publish feedback/result
_feedback = actionlib_tutorials.msg.FibonacciFeedback()
_result = actionlib_tutorials.msg.FibonacciResult()
def __init__(self,... | StarcoderdataPython |
3245636 | #
# Copyright (c) 2016 Intel Corporation
#
# 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 i... | StarcoderdataPython |
328334 | <reponame>MiyaSteven/python_stack
# attributes are characteristics of an object defined in a "magic method" called __init__, which method is called when a new object is instantiated
class User: # declare a class and give it name User
def __init__(self):
self.name = "Steven"
self.email = "<EMAIL>"
... | StarcoderdataPython |
3554043 | from django.template import Library
from django_flickr_gallery.base import Photoset
from django_flickr_gallery import models
from django_flickr_gallery import settings
register = Library()
PAGE_FIELD = getattr(settings, 'PAGE_FIELD')
@register.inclusion_tag("gallery/flickr/tags/dummy.html", takes_context=True)
def... | StarcoderdataPython |
11346982 | <filename>astroML/plotting/multiaxes.py<gh_stars>1-10
"""
Multi-panel plotting
"""
from copy import deepcopy
import numpy as np
class MultiAxes(object):
"""Visualize Multiple-dimensional data
This class enables the visualization of multi-dimensional data, using
a triangular grid of 2D plots.
Paramet... | StarcoderdataPython |
9665081 | from urllib.parse import urlencode
import datetime
from django.conf import settings
from django.contrib.auth.models import AnonymousUser
from django.db.models import F
from ...cart.utils import (
get_cart_from_request, get_or_create_cart_from_request)
from ...core.utils import get_paginator_items
from ...core.uti... | StarcoderdataPython |
11367668 | <reponame>amit-hm/Neural-Persona-based-Conversation-Model-Python-Version<filename>decode.py<gh_stars>0
from decode_params import decode_params
from data import data
from persona import *
from decode_model import decode_model
from io import open
import string
import numpy as np
import pickle
import linecache
import tor... | StarcoderdataPython |
8194313 | <reponame>Contraz/demosys-py<filename>examples/system/dependencies.py
import os
from demosys.resources.meta import ProgramDescription, TextureDescription
def local(path):
"""
Prepend the effect package name to a path so resources
can still be loaded when copied into a new effect package.
"""... | StarcoderdataPython |
1857075 | <reponame>www8098/TD3-HEX
from copy import deepcopy
from util import *
import pickle
import random
from memory import RingBuffer
from model import (Actor, Critic)
import torch.nn as nn
def train(writer, args, agent, env, evaluate, mode, debug=False, num_interm=25, visualize=False):
agent.is_train... | StarcoderdataPython |
3232848 | <filename>Components/discussion_board/migrations/0003_auto_20210307_1557.py
# Generated by Django 3.0.5 on 2021-03-07 22:57
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('discussion_board', '0002_auto_20210306_2014'),
... | StarcoderdataPython |
5176587 | from seedwork.domain.repositories import GenericRepository
class ListingRepository(GenericRepository):
"""An interface for Listing repository"""
| StarcoderdataPython |
1758663 | import turtle as t
import os
import os.path
WIDTH = 600
HEIGHT = 600
wn = t.Screen()
wn.bgcolor("#2b3e50")
path_to_bg1 = os.path.join(os.getcwd(), "sources/turtle/images/space.gif")
path_to_bg2 = os.path.join(os.path.abspath(os.curdir), "images/space.gif")
print(path_to_bg1)
print(path_to_bg2)
wn.bgpic(path_to_bg1)
w... | StarcoderdataPython |
11241321 | # -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2018 Fetch.AI Limited
#
# 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 Lice... | StarcoderdataPython |
3235791 | <filename>mindspore/common/parameter.py<gh_stars>1-10
# Copyright 2020 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-... | StarcoderdataPython |
9718106 | <reponame>devincachu/devincachu-2013
# -*- coding: utf-8 -*-
# Copyright 2013 Dev in Cachu authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
# This code is based on work previously done on pythonbrasil8 website:
# https://raw.github.... | StarcoderdataPython |
4803226 | <filename>slimta/util/pycompat.py<gh_stars>0
# Copyright (c) 2016 <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
# to us... | StarcoderdataPython |
3250495 | <filename>32.Dropdown.py
from tkinter import *
tk = Tk()
tk.geometry('500x500')
tk.title('Drop Down Menu')
choice = [ "Yes", "No" , "May Be" ]
x = StringVar()
x.set( "Select an option" )
def submit():
lb.config( text = x.get() )
menu_input = OptionMenu( tk, x , *choice )
menu_input.pack()
btn = Button( tk,... | StarcoderdataPython |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.