id
stringlengths
1
8
text
stringlengths
6
1.05M
dataset_id
stringclasses
1 value
4868442
# pylint:disable=arguments-differ from typing import Optional, Union, TYPE_CHECKING import logging import claripy from ailment import Block, Stmt, Expr from ...utils.constants import is_alignment_mask from ...engines.light import SimEngineLightAILMixin from ...sim_variable import SimStackVariable from .engine_base im...
StarcoderdataPython
54220
<filename>society/migrations/0008_auto_20190204_1104.py # Generated by Django 2.1.4 on 2019-02-04 11:04 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('student', '0003_student_password_changed'), ('society', '000...
StarcoderdataPython
1888477
<gh_stars>1-10 #!/usr/bin/env python3 """Create a new GitHub release, if appropriate. Steps: - check if version in dbt_profiles.yml matches an existing release - if not, create a new release """ import requests import os import yaml import json def main(): github_token = os.environ["GITHUB_TOKEN"] github_re...
StarcoderdataPython
11336944
<filename>tools/grit/grit/extern/FP.py #!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. try: import hashlib _new_md5 = hashlib.md5 except ImportError: import md5 _new_md5 =...
StarcoderdataPython
6505810
<gh_stars>1-10 from setuptools import setup setup( name="arrdem.kook", # Package metadata version="0.1.19", license="MIT", description="A Kazoo based inventory management system", long_description=open("README.md").read(), long_description_content_type="text/markdown", author="Reid 'ar...
StarcoderdataPython
1628389
<reponame>znarthur/basic-live # Generated by Django 2.2.5 on 2019-11-09 23:14 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('lims', '0021_auto_20190917_1434'), ] operations = [ migrations.RemoveField( model_name='group', ...
StarcoderdataPython
3390029
from time import time import defaultGen import perlinCircleGen import perlinFlowGen import wavesGen def test_defaultGen(): start = time() assert defaultGen.generate( 2100, 1300, "#ffffff", "#242424", 50, 30, 10, 100, 10, 0, "./image.png") == 201 end = time() print("\nThe Default algorithm took...
StarcoderdataPython
6524449
import yaml import os class sgpr_args(): def __init__(self): #common self.model="" self.graph_pairs_dir="/dir_of_graph_pairs" self.p_thresh=3 self.batch_size=128 self.pair_list_dir='' #arch self.keep_node=1 self.filters_1=64 self.filter...
StarcoderdataPython
1783367
__author__ = "<NAME>, <NAME>" __copyright__ = "Copyright 2014 <NAME>, 2016 <NAME>" __license__ = "MIT" __all__ = ["Events", "HumbleApi", "HumbleHash"]
StarcoderdataPython
5024553
import sys import uuid from cassandra.query import ConsistencyLevel from cassandra.query import SimpleStatement from tornado import gen from appscale.common.unpackaged import APPSCALE_PYTHON_APPSERVER from appscale.datastore.cassandra_env.retry_policies import ( BASIC_RETRIES, NO_RETRIES) from appscale.datastore.ca...
StarcoderdataPython
1862134
<reponame>yuanfangtardis/vscode_project ########################################################################## # # This file is part of Lilith # made by <NAME> and <NAME> # # Web page: http://lpsc.in2p3.fr/projects-th/lilith/ # # In case of questions email <EMAIL> # # # Lilith is free software: you can redi...
StarcoderdataPython
12847794
<reponame>Bhare8972/LOFAR-LIM #!/usr/bin/env python3 from LoLIM.stationTimings.plot_multiple_data_all_stations import plot_blocks ## these lines are anachronistic and should be fixed at some point from LoLIM import utilities utilities.default_raw_data_loc = "/exp_app2/appexp1/public/raw_data" utilities.default_proce...
StarcoderdataPython
269529
<filename>pybb/markups/postmarkup.py # -*- coding: UTF-8 -*- """ Post Markup Author: <NAME> (http://www.willmcgugan.com) """ __version__ = "1.1.3" import re from urllib import quote, unquote, quote_plus from urlparse import urlparse, urlunparse pygments_available = True try: from pygments import ...
StarcoderdataPython
117406
# Copyright 2021 <NAME> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, softw...
StarcoderdataPython
4909022
<gh_stars>1-10 """ MIT License Copyright (c) 2020 <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 use, copy, modify, merge, ...
StarcoderdataPython
9741158
<reponame>hankehly/JRDB # Flake8: noqa: F401 from .codes import ( HoofCode, HorseGearCode, HorseGearCodeCategory, PaceFlowCode, Pedigree, RaceConditionCode, RaceConditionGroupCode, SpecialMentionCode, ) from .contender import Contender from .horse import Horse from .jockey import Jockey ...
StarcoderdataPython
4828033
''' Expected run times on a GTX 1080 GPU: MNIST: 1 hr Reuters: 2.5 hrs cc: 15 min ''' import sys, os # add directories in src/ to path sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__),'..'))) import argparse from collections import defaultdict from core.data import get_data from spectralnet ...
StarcoderdataPython
9741701
# Imports from django.shortcuts import render # Index def index(request): return render(request, 'frontend/index.html')
StarcoderdataPython
5035296
import urwid from urwid import LEFT from polka_curses.config import Palette as p class ExpertsPage(urwid.ListBox): def __init__(self, experts): self.experts = experts widgets = [ExpertItem(e) for e in self.experts] super().__init__(urwid.SimpleFocusListWalker(widgets)) def get_focuse...
StarcoderdataPython
283146
<gh_stars>0 import queue import threading from django.db.backends.sqlite3.base import DatabaseWrapper as DB _alias_2_pool = {} _lock = threading.Lock() class DatabaseWrapper(DB): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) if self.alias not in _alias_2_pool: ...
StarcoderdataPython
5021531
from unittest import TestCase import numpy as np import tensorflow as tf import uncertainty_wizard as uwiz from uncertainty_wizard.internal_utils import UncertaintyWizardWarning from uncertainty_wizard.models import StochasticFunctional from uncertainty_wizard.models.stochastic_utils.layers import UwizBernoulliDropou...
StarcoderdataPython
11338052
# coding=utf-8 import os from flask_cors import CORS from flask import Flask, jsonify, request, render_template from entities.entity import Session, engine, Base from entities.opp import Opp, OppSchema from auth import AuthError, requires_auth, requires_role # creating the Flask application app = Flask(__name__) COR...
StarcoderdataPython
3522451
<reponame>wilsonjefferson/DSSC_SML<gh_stars>0 import numpy as np import torch from torch.utils.data import Dataset def convert_to_tensor(number): binary_num = list(map(int, format(number, 'b'))) return torch.tensor(binary_num).to(torch.float) def num_from_tensor(tens): bin_list = tens.view(-1).tolist() ...
StarcoderdataPython
11264323
class Solution(object): def generateParenthesis(self, n): """ :type n: int :rtype: List[str] """ if(n == 0): return [] res = [] def recursion(left,right,content): if(left==n and right==n): res.append(content) ...
StarcoderdataPython
5077601
<filename>lyrebird/project_builder/demo_project/lyrebird_demo/my_handler.py from lyrebird import HandlerContext from flask import Response class MyDataHandler: def handle(self, handler_context: HandlerContext): if 'www.baidu.com' in handler_context.request.path: print('Got "baidu" in request ...
StarcoderdataPython
3451509
<gh_stars>0 """ Unit tests for the Friedman module """ import math import numpy as np import vtk import glenoidplanefitting.algorithms.models as mdl def test_make_plane_model(): """ Tests that make_plane_model returns a plane centred on the plane centre with the correct normal vector """ plane_cent...
StarcoderdataPython
1107
<filename>var/spack/repos/builtin/packages/openssl/package.py # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) import llnl.util.tty as tty from spack import * import spac...
StarcoderdataPython
299915
<reponame>JulyKikuAkita/PythonPrac __source__ = 'https://leetcode.com/problems/super-palindromes/' # Time: O() # Space: O(logW) # # Description: Leetcode # 906. Super Palindromes # # Let's say a positive integer is a superpalindrome if it is a palindrome, # and it is also the square of a palindrome. # # Now, given two...
StarcoderdataPython
9760742
from django.contrib import admin from Owner.models import Owner admin.site.register(Owner)
StarcoderdataPython
33272
import numpy as np import tensorflow as tf from utils import fc_block from params import* class Model(): def __init__(self, input_dim=INPUT_DIM, output_dim=OUTPUT_DIM, dim_hidden=DIM_HIDDEN, latent_dim=LATENT_DIM, update_lr=LEARNING_RATE, scope='model'): self.input_dim = input_dim self.ou...
StarcoderdataPython
3370144
# -------------------------------------------------------------------------- # File: _constants.py # --------------------------------------------------------------------------- # Licensed Materials - Property of IBM # 5725-A06 5725-A29 5724-Y48 5724-Y49 5724-Y54 5724-Y55 5655-Y21 # Copyright IBM Corporation 2008, 2017...
StarcoderdataPython
3431746
<gh_stars>100-1000 import pandas as pd from carla.data.catalog import DataCatalog from carla.evaluation import constraint_violation from carla.models.catalog import MLModelCatalog from carla.models.pipelining import encode, scale def test_constraint_violations(): # Build data and mlmodel data_name = "adult" ...
StarcoderdataPython
1631879
""" COCOPanda :: Trash Panda COCO Data Manipulation The goal of this package is to convert the COCO dataset into the Trash Panda YOLO format (nested class directories). The code in this file is based on: - The official COCO Python API: pycocotools - https://github.com/cocodataset/cocoapi/blob/master/PythonAPI/pyc...
StarcoderdataPython
11318572
<reponame>ve7cxz/ferrystatus<filename>frontend/urls.py from django.urls import path, re_path from . import views # We only have a single view for the front end, as React handles the pages urlpatterns = [ re_path(r'(.*)$', views.app ) ]
StarcoderdataPython
72290
# # This source file is part of the EdgeDB open source project. # # Copyright 2008-present MagicStack Inc. and the EdgeDB 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
152879
import re from typing import Dict, List, Tuple import h5py import numpy as np from logzero import logger from trcdproc.core import ( H5File, Dataset, Group, subgroups, datasets, ) from trcdproc.navigate.common import wavelength_set from trcdproc.reorganize.common import recursive_copy def is_wit...
StarcoderdataPython
72162
<filename>lucario_reasons/pokerank.py if __name__ == "__main__": with open("poketags.txt", "r", encoding = "utf-8") as ifile: poketags = tuple(ifile.read().strip().split())
StarcoderdataPython
1277
<gh_stars>0 import argparse from helper.metaclasses_definition import Singleton class CliArgs(metaclass=Singleton): LogLevel = None BankName = None InputFilepath = None @staticmethod def init(): my_parser = argparse.ArgumentParser() my_parser.add_argument('--bank-name', require...
StarcoderdataPython
3221850
# Licensed to Modin Development Team under one or more contributor license agreements. # See the NOTICE file distributed with this work for additional information regarding # copyright ownership. The Modin Development Team licenses this file to you under the # Apache License, Version 2.0 (the "License"); you may not u...
StarcoderdataPython
4976201
<reponame>jhong93/aws-lambda-proxy import boto3 import hashlib import json import os from base64 import b64encode, b64decode from Crypto.PublicKey import RSA from Crypto.Cipher import PKCS1_OAEP from requests import post from shared.crypto import REQUEST_META_NONCE, RESPONSE_META_NONCE, \ REQUEST_BODY_NONCE, RESP...
StarcoderdataPython
1803726
<reponame>PratikRamdasi/Design-Patterns-in-Python from math import * class Point: def __init__(self, x, y): self.x = x self.y = y def __str__(self): return f'x: {self.x}, y: {self.y}' # Factory class class PointFactory: # methods need not be static ...
StarcoderdataPython
9676776
# Copyright (c) 2016 Uber Technologies, Inc. # # 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 use, copy, modify, merge, publ...
StarcoderdataPython
11370489
<filename>hyperion_cli/cli/util.py from dataclasses import dataclass, field from typing import List, Dict, Optional from geopy import Point from ..fetch import ApiError from ..fetch.police import fetch_crime from ..fetch.wikipedia import fetch_nearby from ..models import Postcode, Bike, CachingError from ..models.uti...
StarcoderdataPython
6478752
<gh_stars>1-10 from ._column_transformer import columnTransformer
StarcoderdataPython
336861
<reponame>sdgdsffdsfff/bk-sops-tencent # -*- coding: utf-8 -*- """ Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available. Copyright (C) 2017-2020 THL A29 Limited, a Tencent company. All rights reserved. Licensed under the MIT License (the "License");...
StarcoderdataPython
9766255
from app.configs.database import db from sqlalchemy import Column, Integer, String from dataclasses import dataclass from sqlalchemy.orm import relationship @dataclass class SubjectModel(db.Model): subject: str __tablename__ = 'subjects' id = Column(Integer, primary_key=True) subject = ...
StarcoderdataPython
9717376
<filename>nn_meter/__init__.py # Copyright (c) Microsoft Corporation. # Licensed under the MIT license. try: import pkg_resources # part of setuptools __version__ = pkg_resources.require("nn-meter")[0].version except ModuleNotFoundError: __version__ = 'UNKNOWN' from .nn_meter import ( nnMeter, lo...
StarcoderdataPython
9794283
import os import argparse import tqdm import sys import torch import torchvision as tv import torchvision.transforms as transforms from torch.autograd import Variable from torch.utils.data import DataLoader from torchvision import datasets from config import opt from model import NetD, NetG from torchnet.meter import...
StarcoderdataPython
8089700
special.boxcox(x, lmbda)
StarcoderdataPython
4915557
# # Copyright 2016 <NAME> (<EMAIL>) # # 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 agree...
StarcoderdataPython
3269697
<reponame>Anthogr/Snakes-in-Space #!/usr/bin/env python # coding: utf-8 # # Selecting values from Tiff # We start of by making the necessary imports # In[1]: import pandas as pd # General data handling library -> aimed more at data science / flat matrices (multi indexing gets confusing) import pandas_profiling # A...
StarcoderdataPython
6652869
<filename>src/create_synthetic_weather_data.py import pandas as pd import numpy from tqdm import tqdm import random import seaborn import matplotlib.pyplot as plt fields = ['Israel_Direct_Radiation', 'Jordan_Direct_Radiation', 'Israel_Wind_Speed', 'Jordan_Wind_Speed', 'West_Bank...
StarcoderdataPython
167178
from typing import Dict, List from pyhafas.profile.base.helper.date_time import BaseDateTimeHelper from pyhafas.profile.base.helper.format_products_filter import \ BaseFormatProductsFilterHelper from pyhafas.profile.base.helper.parse_leg import BaseParseLegHelper from pyhafas.profile.base.helper.parse_lid import B...
StarcoderdataPython
5107436
<reponame>ipa-mdl/textX-LS from typing import List, Union from textx.exceptions import TextXError from textx.metamodel import TextXMetaMetaModel, TextXMetaModel def validate( metamodel: Union[TextXMetaMetaModel, TextXMetaModel], model: str, file_path: str, project_root: str, ) -> List[TextXError]: ...
StarcoderdataPython
1690135
<gh_stars>10-100 # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. import torch from sklearn.model_selection import train_test_split from .mnist_dgps import AbstractMNISTxz def generate_data( X_IMAGE=False, Z_IMAGE=False, tau_fn="abs", n_samples=10000, n_dev_samples=5000, ...
StarcoderdataPython
4900696
# Copyright (C) 2016-2021 Alibaba Group Holding 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 License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
StarcoderdataPython
365048
<gh_stars>10-100 import aiohttp import async_timeout from backends.flag_submitter import AbstractFlagSubmitter from farm import models as models class HackerdomFlagSubmitter(AbstractFlagSubmitter): """ Flag submitter for Hackerdom (RuCTF and RuCTFE) checksystem. See https://github.com/HackerDom/checksyst...
StarcoderdataPython
3244332
from AOCClasses import Position result = 0 input = 368078 def oddsqrt(n): m = int(n ** (1/2)) if m % 2 == 0: m -= 1 return m start = Position(0,0) odd = oddsqrt(input) even = odd + 1 oddSquare = odd ** 2 squarePosition = Position(odd // 2, - (odd // 2)) diff = input - oddSquare offsetPos = Pos...
StarcoderdataPython
162221
<gh_stars>0 from django import template from django.conf import settings from flowpatrolcore.models import * register = template.Library() # settings value @register.assignment_tag def get_googe_maps_key(): return getattr(settings, 'GOOGLE_MAPS_KEY', "") @register.assignment_tag(takes_context=True) def get_si...
StarcoderdataPython
6582749
# Copyright 2015 <NAME> # # This program 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. # # This program is distributed in the hope th...
StarcoderdataPython
3531661
import os import shutil import subprocess import sys import tempfile from PIL import Image, UnidentifiedImageError from docstore.models import Dimensions def _is_animated_gif(path): """ Returns True if the file at ``path`` is an animated GIF. """ try: im = Image.open(path) except Unident...
StarcoderdataPython
357001
from django import forms from .models import student_info class studentform(forms.ModelForm): first_name = forms.CharField() last_name = forms.CharField() date_birth = forms.DateTimeField admin_no = forms.CharField() telephone = forms.CharField() class meta: model = student_info fields = ["first_name", "sec...
StarcoderdataPython
348256
# from setuptools import setup with open("README.md", "r") as fh: long_description = fh.read() setup( name='reusegen', version='0.1.2', description='Cache generator\'s results and reuse them', long_description=long_description, long_description_content_type="text/markdown", classifiers=[ ...
StarcoderdataPython
3527019
<filename>graphic.py height = int(input('Enter image height: ')) # var width = int(input('Enter image width: ')) # var pixels = height * width # calulate print('Pixels: ',pixels) # pixels bitDepth = int(input('Enter image depth: ')) # var bits = pixels * bitDepth # calulate totalbytes = bits // 8 # calulate print(...
StarcoderdataPython
11232803
import json import sys import os from tqdm import tqdm from mdf_refinery.validator import Validator from mdf_forge.toolbox import find_files from mdf_refinery.parsers.ase_parser import parse_ase # VERSION 0.3.0 # This is the converter for the Cp Complexes dataset. # Arguments: # input_path (string): The file or d...
StarcoderdataPython
5173984
import CLIIDE . Class as Class import CLIIDE . IO as IO def expect (input_stream, expected): if (isinstance (expected, str)): for e in expected: try: c = input_stream . get () except IO . EOF: raise SyntaxError ( "Unexpected EOF, expected '" + expected + "'", input_stream . position ()...
StarcoderdataPython
3484501
# -*- coding: utf-8 -*- from django.views.generic import ListView, DetailView from .models import Location class LocationListView(ListView): model = Location template_name = 'locations/location_list.html' context_object_name = 'locations' paginate_by = 10 def get_queryset(self): return L...
StarcoderdataPython
63113
#! /usr/bin/python3 # Copyright 2018 <NAME> # # 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...
StarcoderdataPython
6553563
from mass_api_client.schemas import AnalysisRequestSchema from .base import BaseResource class AnalysisRequest(BaseResource): schema = AnalysisRequestSchema() endpoint = 'analysis_request'
StarcoderdataPython
11399120
<gh_stars>1-10 # Author: <NAME> <<EMAIL>> (https://www.zhs.me) # import required setup libraries from setuptools import setup, find_packages from codecs import open from os import path # import library for metadata from redistr import __author__, __license__, __version__ # project absolute directory DIRECTORY = path...
StarcoderdataPython
6673734
from collections import OrderedDict from numpy import argmax, append, exp, zeros, pi,argsort, diff, array, sqrt, square, ones, sum, mean, std, linspace, polyfit, vstack, greater, less, searchsorted, sort, empty from numpy import float as npfloat, log as nplog, float32, float64, invert, ...
StarcoderdataPython
6446192
import threading import unittest from mock import Mock, patch, call import beeline import libhoney assert libhoney class TestBeeline(unittest.TestCase): def setUp(self): self.addCleanup(patch.stopall) self.m_gbl = patch('beeline._GBL').start() def test_send_event(self): ''' test corre...
StarcoderdataPython
3389493
from homeassistant import config_entries from homeassistant import data_entry_flow from bluepy.btle import Scanner, DefaultDelegate from subprocess import check_output import traceback import random import string from re import search import voluptuous as vol from homeassistant.core import callback from .lib import Red...
StarcoderdataPython
1702887
from __future__ import print_function # for print() in Python 2 import re from yapf.yapflib import yapf_api from sparksqlformatter import Style from sparksqlformatter import api as sparksqlformatter_api from pysqlformatter.src.tokenizer import Tokenizer class Formatter: ''' Format a script with Python code a...
StarcoderdataPython
4907185
# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: update_file.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf...
StarcoderdataPython
9608905
<reponame>NoobJsPerson/runget-1<filename>cogs/newruns.py import asyncio from discord.ext import commands class NewRuns(commands.Cog): def __init__(self, bot: commands.Bot) -> None: self.bot = bot async def get_new_runs(self) -> None: async with self.bot.session.get( "https://www....
StarcoderdataPython
1863462
from kivy.uix.boxlayout import BoxLayout from kivy.uix.tabbedpanel import TabbedPanel import sqlite3 def connect_to_database(path): try: con = sqlite3.connect(path) cursor = con.cursor() create_table_ventas(cursor) con.commit() con.close() except Exception as e: ...
StarcoderdataPython
6619494
# Platform module for querying info about your system. # www.xanthium.in import platform print('Generic platform services using platform module') print('\nOS/Machine info\n') #Cross platform print('\n----------------------------------------------------') print('\nCross platform OS ') print('\n-----------------------...
StarcoderdataPython
3340215
#!/usr/bin/env python """This modules contains tests for VFS API handlers.""" from grr.gui import api_test_lib from grr.gui.api_plugins import vfs as vfs_plugin from grr.lib import access_control from grr.lib import action_mocks from grr.lib import aff4 from grr.lib import flags from grr.lib import flow from grr.li...
StarcoderdataPython
11313716
<filename>test.py<gh_stars>1-10 import torch from models.flow_classifier import SdeClassifier if __name__ == "__main__": classifier = SdeClassifier(n_scale=3, nclass=10, nc=3, nc_hidden=64, sigma=0.1, grid_size=0.1, T=1.0) x = torch.randn(13, 3, 32, 32) out = classifier(x) print(out.size())
StarcoderdataPython
3378349
"""Tests for the UWS job manipulation handlers. These tests don't assume any given application, and therefore don't use the API to create a job, instead inserting it directly via the UWSService. """ from __future__ import annotations from datetime import timedelta import pytest from dramatiq import Worker from fast...
StarcoderdataPython
4955664
<gh_stars>10-100 [ { 'date': '2011-01-01', 'description': "New Year's Day", 'locale': 'en-US', 'notes': '', 'region': '', 'type': 'NF' }, { 'date': '2011-01-17', 'description': 'Birthday of <NAME>, Jr.', 'locale': 'en-US', 'note...
StarcoderdataPython
6521529
<reponame>www2171668/alf<gh_stars>100-1000 # Copyright (c) 2020 Horizon Robotics. 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/...
StarcoderdataPython
11282943
<reponame>jonhillmtl/passman from .repo import Repo, RepoAlreadyExistsError, RepoNotFoundError from .vault import (Vault, VaultNotFoundError, VaultAlreadyExistsError, VaultWrongPasswordError, VaultEntryAlreadyExistsError, VaultWeakPasswordError) from .utils import error_exit, smart_choice from termcolor import col...
StarcoderdataPython
4947193
import re import random from model.contact import Contact def test_wszystkie_kontakty_glowna_vs_db(app, db): lista_kontaktow_poglad = app.contact.zwroc_liste_kontaktow() lista_kontaktow_bd = db.get_contact_list() assert len(lista_kontaktow_poglad) == len(lista_kontaktow_bd) # #tu zaczynam zmieniać # def t...
StarcoderdataPython
6497505
# Copyright (c) 2017-present, Facebook, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed...
StarcoderdataPython
1769978
<reponame>dlmed/LC3-SeBRA import b0RemoteApi import math import time from kalmanfilter import AccelGyro from pid_control import PID accel_gyro = AccelGyro() pid = PID() with b0RemoteApi.RemoteApiClient('b0RemoteApi_pythonClient','b0RemoteApi') as client: # synchronous functions client.doNextStep = True c...
StarcoderdataPython
3530708
# -*- coding:utf-8 -*- ############################################################## # Created Date: Monday, December 28th 2020 # Contact Info: <EMAIL> # Author/Copyright: Mr. <NAME> ############################################################## import pandas as pd import pymysql import pyodbc from sqlalchemy import...
StarcoderdataPython
1864105
# HT10 Estructuras de Datos # <NAME> 18049 # <NAME> 18676 # Programa de recomendacion de medicos from neo4j import GraphDatabase #Se inicia un servidor y se conecta driver = GraphDatabase.driver("bolt://localhost:7687", auth=("neo4j", "admin123")) #Al iniciar el programa, borra la base de datos que esta en el localh...
StarcoderdataPython
5108438
<reponame>seekayel/aws-sam-cli<gh_stars>0 """ Isolates interactive init prompt flow. Expected to call generator logic at end of flow. """ import tempfile import logging import click from botocore.exceptions import ClientError, WaiterError from samcli.commands.init.interactive_event_bridge_flow import ( get_schema...
StarcoderdataPython
3330397
<filename>contenido/tests/__init__.py __author__ = 'Luis_Sebastian_Talero'
StarcoderdataPython
3424170
############################################################################################### # 自解 # 排序使用python中list类自带的reverse函数,会增加内存消耗,但运行更快 ############################################################################################### class Solution: def reverse(self, x: int) -> int: if x == 0:...
StarcoderdataPython
11380757
<gh_stars>0 import warnings from scipy.linalg import toeplitz import scipy.sparse.linalg from scipy.ndimage.interpolation import zoom import numpy as np import numba import cooler from functools import partial from ._numutils import ( iterative_correction_symmetric as _iterative_correction_symmetric, observed_...
StarcoderdataPython
6526800
<gh_stars>0 from operator import add, sub from typing import Tuple from dataclasses import dataclass @dataclass class display_base: cell_size: int = 20 cell_width: int = 10 cell_height: int = 10 window_width = cell_size * cell_width window_height = cell_size * cell_height @stat...
StarcoderdataPython
9748130
<filename>distributed/tests/test_collections.py import pytest from distributed.collections import LRU, HeapSet def test_lru(): l = LRU(maxsize=3) l["a"] = 1 l["b"] = 2 l["c"] = 3 assert list(l.keys()) == ["a", "b", "c"] # Use "a" and ensure it becomes the most recently used item l["a"] ...
StarcoderdataPython
4965833
<filename>results/temporal_atm/acc_cost_plot.py import matplotlib.pyplot as plt import numpy as np fh = open('epoch_cost_acc_50.txt') #fh = open('epoch_cost_acc_50_.txt') epochs, costs, accs, batchs = [], [], [], [] for line in fh: epoch, cost, acc, batch = line.split(',') epochs.append(int(epoch)) costs.a...
StarcoderdataPython
8053165
from django.conf.urls import include, url from resource_status_api.views import * # Define our custom URLs # Additionally, we include login URLs for the browseable API. urlpatterns = [ # url(r'^outages/$', # Outages_List.as_view(), # name='outages-list'), # url(r'^outages/ResourceID/(?P<resourceid>...
StarcoderdataPython
5012737
<filename>tests/test_event.py #!/usr/bin/env python import unittest from evento import Event class TestEventMethods(unittest.TestCase): def test_fire(self): # setup e = Event() def observer(p1, p2): self.value = ','.join([p1, p2]) e += observer # assert e...
StarcoderdataPython
11372495
import os import importlib import time import datetime as datetime import torch import torch.nn as nn import torch.optim as optim import torch.distributed as dist from torch.utils.data import DataLoader from torchvision import transforms import numpy as np from dataloaders.datasets import DAVIS2017_Train, YOUTUBE_VOS_...
StarcoderdataPython
6421471
from gym_battlesnake.gymbattlesnake import BattlesnakeEnv from gym_battlesnake.custompolicy import CustomPolicy from stable_baselines import PPO2 env = BattlesnakeEnv(n_threads=4, n_envs=16) model = PPO2(CustomPolicy, env, verbose=1, learning_rate=1e-3) model.learn(total_timesteps=100000) model.save('ppo2_trainedmode...
StarcoderdataPython