id stringlengths 1 8 | text stringlengths 6 1.05M | dataset_id stringclasses 1
value |
|---|---|---|
1842880 | """Specifies the current version number of OpenCOOD."""
__version__ = "0.1.0"
| StarcoderdataPython |
8001653 |
import json
import click
import requests
from . import configure_env_var
_BASE_URL = 'BASE_URL'
@click.command('login')
@click.option('-b', '--base_url', envvar=_BASE_URL,
show_default=True, type=str,
help=f"Base api url (overrides {_BASE_URL} env var).")
@click.argument('output', defaul... | StarcoderdataPython |
5011171 | <reponame>gokulyc/python123<filename>selenium_py/TestCases/main.py<gh_stars>0
import unittest
from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager
import page
import time
class PythonOrgSearch(unittest.TestCase):
def setUp(self):
self.driver = webdriver.Chrome(ChromeDrive... | StarcoderdataPython |
8027369 | '''
Utility for plotting gaussian distributions
with different variance
Project: https://github.com/roatienza/dl-keras
Dependency: keras 2.0
Usage: python3 <this file>
'''
import numpy as np
import matplotlib.pyplot as plt
want_noise = False
# grayscale plot, comment if color is wanted
plt.style.use('grayscale')
mu... | StarcoderdataPython |
3336360 | """
Datetime-related misc utilities
:author: <NAME>
"""
__all__ = ['format_duration', 'timedelta_to_str']
def format_duration(seconds: float) -> str:
"""
Formats time in seconds as (Dd)HH:MM:SS (time.stfrtime() is not useful for formatting durations).
:param seconds: Number of seconds to format
:re... | StarcoderdataPython |
3488874 | from typing import Optional, Union
from pydantic import BaseModel
from pydantic.color import Color
from pydantic.fields import Field
from typing_extensions import Literal
class ThemeColors(BaseModel):
canvas: Optional[Color]
console: Optional[Color]
background: Optional[Color]
foreground: Optional[Co... | StarcoderdataPython |
8071560 | """
TripsLayer
==========
Plot of a single vehicle trip within San Francisco, fading in from the origin.
Adapted from a deck.gl documentation example.
"""
import pydeck as pdk
import pandas as pd
TRIPS_LAYER_DATA = "https://raw.githubusercontent.com/visgl/deck.gl-data/master/website/sf.trips.json" # noqa
df = pd.... | StarcoderdataPython |
9752656 | <gh_stars>0
:wq
tabby_cat="\t I'm tabbed in."
persian_cat="I'm split\non a line."
backslash_cat="I'm \\ a\\ cat."
fat_cat="""
I'll do a list:
\t*Cat food
\t*Fishie
\t*Catnip\n\t*Grass
"""
print(tabby_cat)
print(persian_cat)
print(backslash_cat)
print(fat_cat)
tabby_rad="\t I'm tabbed in."
persian_rad="I'm split\non a l... | StarcoderdataPython |
4941188 | import os
from PIL import Image
from torch.utils.data import Dataset
import torch
import torchvision.transforms as transforms
import numpy as np
def get_transforms(cfg):
train_transform = transforms.Compose([
transforms.Resize((cfg.DATA.RESIZE_SIZE, cfg.DATA.RESIZE_SIZE)),
transforms.RandomCrop((c... | StarcoderdataPython |
1673930 | <filename>dask/dataframe/io/tests/test_io.py
from concurrent.futures import ThreadPoolExecutor
from threading import Lock
import numpy as np
import pandas as pd
import pytest
import dask.array as da
import dask.dataframe as dd
from dask.dataframe._compat import tm
from dask.dataframe.io.io import _meta_from_array
fro... | StarcoderdataPython |
1694323 | import os
import argparse
import warnings
import datasets
import torch
import flwr as fl
import pandas as pd
import numpy as np
from datasets import load_dataset, load_metric
from transformers import AutoTokenizer, DataCollatorWithPadding
from transformers import AutoModelForSequenceClassification
from transformers ... | StarcoderdataPython |
1730674 | import logging
import pytest
import responses
from flash_services.core import Service
from flash_services.github import GitHubEnterpriseIssues, GitHubIssues
@pytest.fixture
def service():
return GitHubIssues(username='user', password='<PASSWORD>', account='foo', repo='bar')
def test_tracker_service_type():
... | StarcoderdataPython |
83942 | <reponame>gbrault/schemdraw<gh_stars>10-100
''' Two-terminal element definitions '''
import numpy as np
from .elements import Element2Term, gap
from ..segments import Segment, SegmentArrow, SegmentArc, SegmentText, SegmentCircle, SegmentPoly
from ..adddocs import adddocs
resheight = 0.25 # Resistor height
resw... | StarcoderdataPython |
3473763 | # this script resizes bitmaps, so that they are square shaped
import wx
from os import walk
BITMAP_SIZE = 96
app = wx.App()
def ResizeBitmap(filepath):
img = wx.Image(filepath)
if img.Width == BITMAP_SIZE and img.Height == BITMAP_SIZE:
print('Skipped ' + filepath)
return
img.Resize(wx.Size... | StarcoderdataPython |
1677213 | <reponame>jwoehr/nuqasm2<filename>test/test_parsing.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Feb 21 19:03:20 2020
@author: jax
"""
import io
import os
import unittest
import nuqasm2 as nq
class TestParsing(unittest.TestCase):
"""Test nuqasm2 regressions"""
include_path = os.geten... | StarcoderdataPython |
9781233 | <reponame>R0b3rt020/django-friendship<filename>friendship/tests/tests.py
import os
from django.contrib.auth.models import User
from django.core.cache import cache
from django.core.exceptions import ValidationError
from django.db import IntegrityError
from django.test import TestCase
from django.urls import reverse
fr... | StarcoderdataPython |
3559205 | # -- EIGRP
# nxos: interface <intf> / ip authentication key-chain eigrp someword someword2
# nxos: interface <intf> / ip authentication mode eigrp someword md5
# nxos: interface <intf> / ip bandwidth eigrp someword 1
# nxos: interface <intf> / ip bandwidth-percent eigrp someword 1
# nxos: interface <intf> / ip delay ei... | StarcoderdataPython |
8125454 | <gh_stars>1-10
#!/usr/bin/env python
# -*- coding:utf-8 -*-
from pymysqlreplication import BinLogStreamReader
from pymysqlreplication.event import RotateEvent, FormatDescriptionEvent
from pymysqlreplication.row_event import UpdateRowsEvent
from pymysqlreplication.row_event import WriteRowsEvent
from pymysqlreplication... | StarcoderdataPython |
1707522 | <reponame>ocarneiro/scraping
# coding: utf-8
import json
import requests
from bs4 import BeautifulSoup as bs
from pprint import pprint
sites = {}
errors = {}
print("====== scrap_sites.py =======")
print("loading site list...")
with open('sites.json', 'r') as file:
content = file.read()
sites = json.loads(cont... | StarcoderdataPython |
1673740 | <gh_stars>0
from .columnar import Columnar
| StarcoderdataPython |
5178201 | # Copyright (c) 2019 zfit
from collections import OrderedDict
from contextlib import ExitStack
from typing import List, Tuple, Union, Dict, Mapping
import warnings
import tensorflow as tf
from tensorflow.python.framework import ops
from tensorflow.python.ops import array_ops
import uproot
import numpy as np
import ... | StarcoderdataPython |
1810716 | import glob
import os
import numpy as np
from sklearn.utils import shuffle
from scipy import misc
from PIL import Image
import pandas as pd
import matplotlib
from matplotlib import pyplot as plt
import tensorflow as tf
#matplotlib.interactive(True)
random_seed = 90210
np.random.seed(random_seed)
img_w, img_h = 64,... | StarcoderdataPython |
3597442 | <filename>tests/__init__.py
"""Unit test package for pagic."""
| StarcoderdataPython |
292444 | <reponame>HenrYxZ/2d-simple-shader<filename>script.py
import imageio
import numpy as np
import os
import os.path
from PIL import Image
# Local Modules
from constants import MAX_COLOR_VALUE, MAX_QUALITY
from normal_map import get_normals
from render import render_lambert, render_specular
import utils
AMBIENT_FILENAME ... | StarcoderdataPython |
5156766 | from django.urls import path
from .views import *
app_name = 'create_forms'
urlpatterns = [
path('', form_list, name='list'),
path('<slug:slug>/', form_detail, name='detail'),
]
| StarcoderdataPython |
11256724 | # Autumn Festival Full Moon Damage Skin
success = sm.addDamageSkin(2434374)
if success:
sm.chat("The Autumn Festival Full Moon Damage Skin has been added to your account's damage skin collection.")
| StarcoderdataPython |
8130708 | <reponame>under-chaos/ymir
import logging
import os
import shutil
import tarfile
import unittest
from unittest import mock
from google.protobuf.json_format import ParseDict
import yaml
from mir.commands.mining import CmdMining
import tests.utils as test_utils
import mir.protos.mir_command_pb2 as mirpb
class TestMin... | StarcoderdataPython |
9665674 | # -*- coding: utf-8 -*-
"""Command line interface for :mod:`cova`.
Why does this file exist, and why not put this in ``__main__``? You might be tempted to import things from ``__main__``
later, but that will cause problems--the code will get executed twice:
- When you run ``python3 -m cova`` python will execute``__m... | StarcoderdataPython |
374125 | <reponame>waikato-ufdl/ufdl-backend<filename>ufdl-core-app/src/ufdl/core_app/exceptions/_JobNotStarted.py
from rest_framework import status
from rest_framework.exceptions import APIException
class JobNotStarted(APIException):
"""
Exception for when a node tries to perform an action
on a job that it hasn't... | StarcoderdataPython |
1997572 | <reponame>andzaytsev/deepnav
# Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# * Redistributions of source code must retain the above copyright
# noti... | StarcoderdataPython |
284215 | <reponame>gauravvazirani/ooad<gh_stars>0
import math
class IntegerStatistics(list):
"""
An extension of the built in list data structure that stores
at hand mehtods to calculate the mean and standard deviation of the elements
"""
def mean(self):
"""
:return: (decimal) mean of the ... | StarcoderdataPython |
8046652 | <gh_stars>1-10
import click
import scipy.signal
import scipy.fft
import numpy as np
import pandas as pd
import os
import csv
import gzip
def chunk_generator(data_file):
with gzip.open(data_file, "rt") as f:
csvr = csv.DictReader(f)
chunk = []
chunk_key = None
is_wrist = False
... | StarcoderdataPython |
3296318 | """
Test that breakpoints in an IT instruction don't fire if their condition is
false.
"""
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class TestBreakpointIt(TestBase):
mydir = TestBase.compute_mydir(__file__)
NO_DEBUG_INFO_T... | StarcoderdataPython |
188357 | <filename>pmDisk.py
import ebf
import healpix_util as hu
import numpy as np
import matplotlib as mpl
mpl.use('pdf')
import matplotlib.pyplot as plt
import astropy.coordinates as coord
import astropy.units as u
import healpy as hp
import astropy.stats as st
import astropy.visualization as av
import xdpm
import itertool... | StarcoderdataPython |
166953 | from django.contrib import admin
from .models import Biodata, UserProfile
# Register your models here.
@admin.register(Biodata)
@admin.register(UserProfile)
# admin.site.register(UserProfile)
class BiodataAdmin(admin.ModelAdmin):
pass | StarcoderdataPython |
115194 | import os
import subprocess
import itertools
import pytest
from click.testing import CliRunner
from hobbit import main as hobbit
from hobbit.bootstrap import templates
from . import BaseTest, rmdir, chdir
class TestHobbit(BaseTest):
wkdir = os.path.abspath('hobbit-tox-test')
def setup_method(self, method)... | StarcoderdataPython |
8172320 | <gh_stars>0
from framework.core.util import is_uri, get_feature_from_uri
class _PluginRegistry(object):
def __init__(self):
self._plugins = {}
def add(self, plugin):
self._plugins[plugin.name] = plugin
def get_plugin_uris(self):
for plugin in self._plugins.values():
yi... | StarcoderdataPython |
11295955 | import pytest
from tests.conftest import create_mock_error
from py42.exceptions import Py42BadRequestError
from py42.exceptions import Py42CaseAlreadyHasEventError
from py42.exceptions import Py42UpdateClosedCaseError
from py42.services.casesfileevents import CasesFileEventsService
_TEST_CASE_NUMBER = 123456
UPDATE_E... | StarcoderdataPython |
5134169 | #!/usr/bin/env python
#coding=utf-8
from pyecharts.base import Base
from pyecharts.option import get_all_options
class Radar(Base):
"""
<<< 雷达图 >>>
雷达图主要用于表现多变量的数据。
"""
def __init__(self, title="", subtitle="", **kwargs):
super(Radar, self).__init__(title, subtitle, **kwargs)
def conf... | StarcoderdataPython |
359174 | #!/usr/bin/python
#FIXME: -Error handling
# -Bind to request from all addresses
"""
This is the holiday server. It provides a generic interface to a holiday calender for
multiple users. Communication is done via an abstract interface, currently using NC::SocketServer.
See the man page holiday for further details.... | StarcoderdataPython |
8012110 | import json
import discord
import requests
import tweepy
from discord.ext import commands, tasks
class StreamListener(tweepy.StreamListener):
def __init__(self):
with open("./config.json") as f:
self.config = json.load(f)
def on_error(self, status_code: int) -> bool:
if status_co... | StarcoderdataPython |
3578558 | <gh_stars>1-10
import math
import torch
import random
import numpy as np
import matplotlib.pyplot as plt
# import modules
from training.chessEnv import ChessEnv
from models.models import ChessNN
# Use GPU, if available
USE_CUDA = torch.cuda.is_available()
class Trainer():
def __init__(self, parameters, simple=... | StarcoderdataPython |
8049825 | import unittest
import rastervision as rv
@unittest.skipIf(not rv.backend.pytorch_available, 'PyTorch is not available')
class TestPyTorchSemanticSegmentationConfig(unittest.TestCase):
def test_builder(self):
batch_size = 10
num_epochs = 10
chip_size = 300
class_map = {'red': (1,... | StarcoderdataPython |
9783407 | <reponame>Derpimort/VGGVox-PyTorch
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Apr 10 12:52:25 2020
@author: darp_lord
"""
import torch
import torch.nn as nn
from collections import OrderedDict
import numpy as np
class VGGM(nn.Module):
def __init__(self, n_classes=1251):
super... | StarcoderdataPython |
5061594 | <filename>cocoa/inter/stats_label.py
from cocoa.inter import PyGUIObject, GUIObjectView
class StatsLabelView(GUIObjectView):
pass
class PyStatsLabel(PyGUIObject):
def display(self) -> str:
return self.model.display
| StarcoderdataPython |
5133908 | from django.apps import AppConfig
class FinanceAccountsConfig(AppConfig):
name = 'applications.finance_accounts'
| StarcoderdataPython |
35832 | <gh_stars>0
from typing import Generic, List, Optional, Type, TypeVar, Union, Dict, Any
from uuid import UUID
from fastapi import HTTPException
from fastapi.encoders import jsonable_encoder
from pydantic import BaseModel
from sqlalchemy.orm import Session
from src.db.sqlalchemy.database import Base
ModelType = TypeV... | StarcoderdataPython |
3493007 | from enum import Enum, unique
@unique
class MessageType(Enum):
MESSAGE = 1
WAKEUP = 2
def __lt__(self, other):
return self.value < other.value
class Message:
uniq = 0
def __init__ (self, body = None):
# The base Message class no longer holds envelope/header information,
# however any desire... | StarcoderdataPython |
3273267 | #!/usr/bin/env python
# coding: utf-8
# define custom exceptions
class HeaderAndRowLenNotMatch(Exception):
pass
class HeaderNotDefine(Exception):
pass
| StarcoderdataPython |
6479662 | <reponame>groboclown/nightjar-mesh
"""Some constant values."""
TRUE_VALUES = ('yes', 'true', '1', 'on', 'enable', 'active', 'activate',)
FALSE_VALUES = ('no', 'false', '0', 'off', 'disable', 'deactivate',)
| StarcoderdataPython |
5020509 | <reponame>rsk1130/image_classifier
import torch
from torch import nn
from torch import optim
from PIL import Image
from torchvision import datasets, transforms, models
import numpy as np
import matplotlib.pyplot as plt
def process_image(image):
transform = transforms.Compose([transforms.Resize(256),
... | StarcoderdataPython |
6619205 | from PyQt5 import QtWidgets, QtCore, QtGui
from PyQt5.QtWidgets import QLabel, QCheckBox, QFrame, QVBoxLayout, QHBoxLayout, QComboBox
import config as config
def init_view(label, container, label_bold=True, position="centertop", vertical=True):
if vertical:
vl = QVBoxLayout(container)
else:
v... | StarcoderdataPython |
9671311 | <reponame>AltairStar/PyReqBS
import sys
sys.path.append('../src/Coin.py')
from src import Coin
scrapper = Coin.Coinmarketcap('xrp')#default param
scrapper.get_info()#default is initialization param in class
scrapper.get_info("bitcoin")#use another param | StarcoderdataPython |
9741984 | from types import FunctionType
from src.managers.RequestManager import RequestManager
class Application:
def __call__(self, environ: dict, start_response: FunctionType) -> tuple:
"""
Method to be called when make_server function starts
Args:
environ (dict): Enviroment variable with all the request... | StarcoderdataPython |
6666729 | <reponame>benayas1/benatools
import tensorflow as tf
def _log(s, verbose):
"""
Prints a message on the screen
"""
if verbose:
print(s)
def get_device_strategy(device, half=False, XLA=False, verbose=True):
"""
Returns the distributed strategy object, the tune policy anb the number of ... | StarcoderdataPython |
3456837 | <filename>zwave_js_server/firmware.py<gh_stars>10-100
"""Firmware update helper."""
from typing import Optional
import aiohttp
from .client import Client
from .model.node import Node
from .util.helpers import convert_bytes_to_base64
async def begin_firmware_update(
url: str,
node: Node,
filename: str,
... | StarcoderdataPython |
1827145 | #! /usr/bin/env python
import numpy as np
import scipy
"""
Simple utilities for managing snapshots and
creating training, testing data
"""
def prepare_data(data, soln_names, **options):
"""
Utility to extract snapshots and time
arrays from raw data, by ignoring
initial spin-up times, skipping over
... | StarcoderdataPython |
367823 | '''
<NAME>
This script is used to create clusters using the DBSCAN(density-based spatial clustering of applications) implementation
Creates two different types of clusters which are labeled as the yellow and redclusters. The yellow cluster covers areas
that are potentially contaminated. The red cluster covers are... | StarcoderdataPython |
3444164 | <filename>Live Events/GetMessage.py<gh_stars>0
import boto3
import json
import pandas as pd
from pprint import pprint
import config_SQS as csqs
import exasol as e
import config_Exasol as ec
import simplejson
num_of_records = 1
def get_messages(is_json=True):
sqsclient = boto3.client(
'sqs',
aws_ac... | StarcoderdataPython |
9718383 | <reponame>renaudb/bixistrava
from .strava import Strava
__all__ = ['Strava']
| StarcoderdataPython |
11232940 | #!/usr/bin/env python3
import numpy as np
from enum import IntEnum
class OpCode(IntEnum):
HALT = 0
SET = 1
PUSH = 2
POP = 3
EQ = 4
GT = 5
JMP = 6
JT = 7
JF = 8
ADD = 9
MULT = 10
MOD = 11
AND = 12
OR = 13
NOT = 14
RMEM = 15
WMEM = 16
CALL = 17
... | StarcoderdataPython |
3512223 | <reponame>Robbie-Cook/nimblenet<filename>nimblenet/learning_algorithms/commons/utils.py
from ...tools import confirm
from ...activation_functions import softmax_function
from ...cost_functions import softmax_neg_loss
import numpy as np
all = ["check_network_structure", "verify_dataset_shape_and_modify", "print_traini... | StarcoderdataPython |
8096929 | <gh_stars>0
"""
Copyright 2011 <NAME> <<EMAIL>>
This file is part of PyCAM.
PyCAM 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, either version 3 of the License, or
(at your option) any later version.
PyCAM is... | StarcoderdataPython |
11210409 | import logging
import flask
from typing import Dict
from allennlp_demo.common.logs import configure_logging
from allennlp_models.pretrained import get_pretrained_models
logger = logging.getLogger(__name__)
class ModelCardsService(flask.Flask):
def __init__(self, name: str = "model-cards"):
super().__i... | StarcoderdataPython |
3556161 | # -*- coding: utf-8 -*-
# (c) Copyright 2022 Sensirion AG, Switzerland
from enum import IntFlag
from typing import Iterable, Optional
from typing import List
from sensirion_i2c_driver import I2cConnection, CrcCalculator
from sensirion_shdlc_driver import ShdlcSerialPort, ShdlcConnection
from sensirion_shdl... | StarcoderdataPython |
5196292 | <reponame>pyToshka/pyTerrafile<gh_stars>1-10
import os
import shutil
import sys
from os import path
import git
import requests
import yaml
from git import Repo, Git, GitCommandError
from loguru import logger
TF_REGISTRY_BASE_URL = "https://registry.terraform.io/v1/modules"
class Progress(git.remote.RemoteProgress):... | StarcoderdataPython |
3343973 | <gh_stars>1-10
"""
Unit tests for the main web views
"""
import re
import os
from django.test import TestCase
from django.urls import reverse
from django.contrib.auth import get_user_model
class ViewTests(TestCase):
""" Tests for various top-level views """
username = 'test_user'
password = '<PASSWORD>... | StarcoderdataPython |
1866240 | <filename>unknowntags/admin.py
from django.contrib import admin
from import_export.admin import ImportExportModelAdmin
from import_export import resources
from simple_history.admin import SimpleHistoryAdmin
from .models import Unknowntag
class UnknownagAdmin(ImportExportModelAdmin, SimpleHistoryAdmin):
resource_... | StarcoderdataPython |
8012294 | <filename>Part_3_advanced/m17_tests_II/unittest_module/homework_1_solution/estudent/tests/test_grade.py
from estudent.grade import Grade
from unittest import TestCase
class GradeTestCase(TestCase):
def setUp(self):
self.failing_grade = Grade(value=1)
self.passing_grade = Grade(value=5)
def t... | StarcoderdataPython |
9706469 | <reponame>gigabackup/gigantum-client
import os
from typing import List, Optional
from gtmcore.gitlib.git_fs import GitFilesystem
from gtmcore.logging import LMLogger
import subprocess
logger = LMLogger.get_logger()
class GitFilesystemShimmed(GitFilesystem):
# INFORMATIONAL
def check_ignored(self, path: str... | StarcoderdataPython |
197645 | <reponame>emailweixu/XWorld
"""
Copyright (c) 2017 Baidu Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless requir... | StarcoderdataPython |
6663493 | import logging
import json
from board import Board
logger = logging.getLogger(__name__)
class Game(object):
def __init__(self, players, game_id=None, size=(10, 10), star_count=10):
if game_id:
logger.info("Loading game {id}".format(id=game_id))
raise NotImplementedError
s... | StarcoderdataPython |
6407050 | <gh_stars>0
from utils import *
def diveToLast(lst):
try:
if type(list(list(lst.values())[0][0].values())[0]) is list:
return diveToLast(list(lst.values())[0][0])
elif type(list(list(lst.values())[0][1].values())[0]) is list:
return diveToLast(list(lst.values())[0][1])
else:
return lst
except Exceptio... | StarcoderdataPython |
12811797 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
def main(entrada, saida):
# Trata o arquivo palavras.txt para remover os verbos (palavras terminadas em ar,er,ir)
# Ler todas as palavras do arquivo de entrada
with open(entrada, 'r') as arquivo:
palavras = [palavra.lower().rstrip() fo... | StarcoderdataPython |
3471368 | """
main_module - 输出形状计算,测试时将对应方法的@unittest.skip注释掉.
Main members:
# __main__ - 程序入口.
"""
import unittest
import torch
from torch import nn
class TestShape(unittest.TestCase):
"""输出形状计算.
Main methods:
test_Conv2d - RNN.
"""
# @unittest.skip('debug')
def test_RNN(self):
... | StarcoderdataPython |
1976655 | # -*- coding: utf-8 -*-
"""
To make userdefined function avaiable to Business logic define them here
Function names have to be all lower case !!!
Created on Fri Mar 2 14:50:18 2018
@author: hanseni
"""
from numba import jit
@jit("f8(b1,f8,f8)")
def recode(condition,yes,no):
'''Function which recreates the funct... | StarcoderdataPython |
1640332 | <filename>reinforcement/agents/basis.py
from abc import ABC, abstractmethod
import numpy as np
from reinforcement.trajectories import TrajectoryRecorder
class AgentInterface(ABC):
@abstractmethod
def next_action(self, observation):
raise NotImplementedError
@abstractmethod
def signal(self, ... | StarcoderdataPython |
3542052 | <gh_stars>0
from config.settings.base import *
from config.settings.base import env
# Production specific settings
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/3.1/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
... | StarcoderdataPython |
11383349 | # -*- coding: utf-8 -*-
from connect import security
import json
class TestFilteredKeys():
def test_encrypt_and_decrypt_return_same_value(self):
master_key = "00000000000000000000000000000000"
filter_definition = {
'filters': {
'type': 'cycling'
},
... | StarcoderdataPython |
4942335 | <filename>schapp/timeClock/admin.py<gh_stars>0
from django.contrib import admin
from .models import Clock_In, Clock_Out
admin.site.register(Clock_In)
admin.site.register(Clock_Out)
| StarcoderdataPython |
4930671 | <reponame>glauberm/doaj
from doajtest.helpers import DoajTestCase
class TestSearchBox(DoajTestCase):
def setUp(self):
super(TestSearchBox, self).setUp()
def tearDown(self):
super(TestSearchBox, self).tearDown()
def test_01_with_referrer(self):
""" Utilise the search endpoint usi... | StarcoderdataPython |
11220908 | # Copyright (C) The Arvados Authors. All rights reserved.
#
# SPDX-License-Identifier: Apache-2.0
import arvados
import re
import os
import sys
import fcntl
import subprocess
gatk2_install_path = None
def install_path():
global gatk2_install_path
if gatk2_install_path:
return gatk2_install_path
g... | StarcoderdataPython |
3374553 | from base64 import b64encode
from pathlib import Path
from typing import Optional, Union
from PIL import Image as PILImage
from .grid_object import GridObject
from .mixin import SlideMixin
from .._utils import check_exists, check_type, check_sanity_int
class Image(GridObject):
"""Represents an image on the sli... | StarcoderdataPython |
1765638 | __version__ = "0.15.1"
__api_version__ = "1.0.1"
| StarcoderdataPython |
9655975 | <filename>datasets/ToyARD2.py
'''
ToyARD2.py
Toy data from a first-order auto-regressive process.
'''
import numpy as np
import scipy.linalg
from bnpy.data import XData
def get_short_name():
''' Return short string used in filepaths to store solutions
'''
return 'ToyARD2'
def get_data_info():
retu... | StarcoderdataPython |
1957212 | from ArithBuses import *
from TraceType import *
import DFG
from BusReq import *
##############################################################################
# Arithmetic operators
##############################################################################
class ArithmeticInputBaseReq(BusReq):
def __i... | StarcoderdataPython |
3493966 | <gh_stars>100-1000
# -*- coding: utf-8 -*-
'''
inplace_callbacks.py: python module showcasing inplace callback function
registration and functionality.
Copyright (c) 2016, NLnet Labs.
This software is open source.
Redistribution and use in source and binary forms, with or without
modific... | StarcoderdataPython |
11275565 | import numpy as np
import os
import time
import random
import matplotlib.pyplot as plt
from matplotlib import mlab
import forecast_lib as fl
dropout=False
if dropout:
type_exp = '_dropout'
else:
type_exp = ''
strategic_attack=False
if strategic_attack:
type_exp='strategic_' + type_exp
else:
type_exp=''+ t... | StarcoderdataPython |
6623457 | import os
import boto3
from typing import List
import json
import sys
import os
import logging
logger = logging.getLogger()
logger.setLevel(logging.DEBUG)
class ProwlerScanGroup:
def __init__(self, topic_arn):
self.__topic = boto3.resource('sns').Topic(topic_arn)
self.__region = os.environ['AWS_R... | StarcoderdataPython |
6628879 | <reponame>ikuroNoriiwa/shellcode_transform<filename>utils.py
#!/usr/bin/python3
from sys import exit
def error(msg):
print("\033[31mError: {}\033[0m".format(msg))
exit(1) | StarcoderdataPython |
1971193 | <gh_stars>0
from itertools import cycle
import matplotlib.gridspec as grsp
import matplotlib.pyplot as plt
import networkx as nx
import numpy as np
import pandas as pd
import seaborn as sns
from GPErks.constants import HEIGHT, WIDTH
from GPErks.utils.plotting import get_col, interp_col
def boxplot(ST, S1, S2, index... | StarcoderdataPython |
1672325 | <reponame>medunigraz/outpost.django.base
from django.dispatch import Signal
materialized_view_refreshed = Signal(providing_args=["name", "model"])
| StarcoderdataPython |
3503718 | <filename>questionA/questionA.py
def isOverlap(x,y):
return 'overlap' if y[0] <= x[0] < y[1] or y[0] < x[1] <= y[1] else 'no overlap'
if __name__ == '__main__':
z = [(1,2),(1,3)]
print(isOverlap(z[0], z[1]))
z = [(1,2),(2,3)]
print(isOverlap(z[0], z[1]))
z = [(3,4),(1,3)]
print(isOverlap(... | StarcoderdataPython |
6684583 | <filename>src/aiotube/_rgxs.py
import re
class _ChannelPatterns:
name = re.compile('channelMetadataRenderer\":{\"title\":\"(.*?)\"')
id = re.compile('channelId\":\"(.*?)\"')
verified = re.compile('"label":"Verified"')
check_live = re.compile('{"text":"LIVE"}')
live = re.compile("thumbnailOverlays\... | StarcoderdataPython |
1626523 | #
# Copyright (c) 2021 Airbyte, Inc., all rights reserved.
#
import pytest
import requests
from airbyte_cdk.sources.streams.http.auth import NoAuth
from source_intercom.source import Companies, Contacts, IntercomStream
test_data = [
(
IntercomStream,
{"data": [], "pages": {"next": "https://api.in... | StarcoderdataPython |
6527350 | <filename>docker_emperor/commands/launch.py
import os
from docker_emperor.commands import Command
import docker_emperor.logger as logger
def run(root, *args, **kwargs):
logger.cmd('Run project <b>%s</b>' % (root.compose.name, ))
root.run_command('machine:start', internal=True)
root.run_command('down', int... | StarcoderdataPython |
9608489 | #!/usr/bin/python
import sys
from sense_hat import SenseHat
text = "Hello"
colorRed = 255
colorGreen = 0
colorBlue = 0
for index in range(len(sys.argv)):
next = index+1
if next >= len(sys.argv):
break
if "--text" == sys.argv[index]:
text = sys.argv[next]
elif "--color-red" == sys.argv[index]:
colorRed = in... | StarcoderdataPython |
11293845 | <filename>output/models/nist_data/atomic/float_pkg/schema_instance/nistschema_sv_iv_atomic_float_pattern_2_xsd/__init__.py
from output.models.nist_data.atomic.float_pkg.schema_instance.nistschema_sv_iv_atomic_float_pattern_2_xsd.nistschema_sv_iv_atomic_float_pattern_2 import NistschemaSvIvAtomicFloatPattern2
__all__ =... | StarcoderdataPython |
3528283 | <filename>tests/karura_test/insights/test_label_format_insight.py<gh_stars>10-100
import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), "../../../"))
from datetime import datetime
import unittest
import numpy as np
import pandas as pd
from karura.core.dataframe_extension import DataFrameExtension... | StarcoderdataPython |
3275999 | <reponame>BobbyEllena/bugtracker<gh_stars>0
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from bug.models import BugModel, CustUser
from bug.forms import LoginForm, CreateUser
# Register your models here.
class CustomUserAdmin(UserAdmin):
add_form = CreateUser
form = Create... | StarcoderdataPython |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.