id
stringlengths
1
8
text
stringlengths
6
1.05M
dataset_id
stringclasses
1 value
6588271
from local_server import * class LocalServerMock(LocalServer): def __init__(self): """ Mock Local Server """ self._is_from_test = True super().__init__()
StarcoderdataPython
354340
<filename>src/crypto.py from Crypto.Cipher import AES from hashlib import sha256 from base64 import b64encode def create_key(string): """ Creates sha256 hash key from given string. Key is of the right length for AES encryption. :param string: String encoded with UTF-8. :returns: String key, a hash of ...
StarcoderdataPython
6574585
<reponame>yongkangzzz/mmfgroup """ =============================================================================== shap_explainer.py explainer class for singlemodal or multimodal inputs =============================================================================== """ import matplotlib.pyplot as plt import shap impor...
StarcoderdataPython
5037006
import datetime date_tomorrow = datetime.date.today() + datetime.timedelta(days=1) date_tomorrow_iso = date_tomorrow.isoformat() def filter_today(docs): returned_array = [] for doc in docs: d = doc["doc"] # TODO: If due less than tomorrow if d["due"] and d["due"] < date_tomorrow_iso: ...
StarcoderdataPython
6697840
import torch from torch.nn.parameter import Parameter A = torch.tensor([[[[1, 2, 0, 1], [-1, 0, 3, 2], [1, 3, 0, 1], [2, -2, 1, 0]]]]).float() conv2d = torch.nn.Conv2d(1, 1, kernel_size = 2, bias = False) conv2d.weight = Parameter(torch.tensor([[[[1, -1], [-...
StarcoderdataPython
3360947
from time import time import requests urls = ["https://www.naver.com", "http://www.google.com", "https://www.nytimes.com", "https://www.mlb.com", "https://www.kakaocorp.com"] begin = time() result = [] for url in urls: response = requests.get(url) page = response.text result.append("{0} Bytes".format(len(...
StarcoderdataPython
166826
'''Defines data and parameters in an easily resuable format.''' # Common sequence alphabets. ALPHABETS = { 'dna': 'ATGCNatgcn-', 'rna': 'AUGCNaugcn', 'peptide': 'ACDEFGHIKLMNPQRSTVWYXacdefghiklmnpqrstvwyx'} COMPLEMENTS = { 'dna': {'A': 'T', 'T': 'A', 'G': 'C', 'C': 'G', 'N': 'N', 'a': 't', ...
StarcoderdataPython
12852654
<gh_stars>10-100 """CLI handling for `routemaster`.""" import logging import yaml import click import layer_loader from routemaster.app import App from routemaster.cron import CronThread from routemaster.config import ConfigError, load_config from routemaster.server import server from routemaster.middleware import wr...
StarcoderdataPython
3421953
<filename>doc/adjusted_MLE/tests/test_risk.py import numpy as np, os, itertools import pandas as pd from rpy2 import robjects import rpy2.robjects.numpy2ri rpy2.robjects.numpy2ri.activate() import rpy2.robjects.pandas2ri from rpy2.robjects.packages import importr from .comparison_metrics import (sim_xy, ...
StarcoderdataPython
6683573
#!/usr/bin/env python import sys import psycopg2 def execute(clause): db = psycopg2.connect("dbname=news") cursor = db.cursor() cursor.execute(clause) res = cursor.fetchall() db.close() return res def get_top3_articles(): res = execute(""" SELECT * FROM article_log_view O...
StarcoderdataPython
4811921
# 1. Reebok is designing a new type of Crossfit shoe, the Nano X. The fixed cost for the # production will be $24,000. The variable cost will be $36 per pair of shoes. The shoes will # sell for $107 for each pair. Using Python, graph the cost and revenue functions and # determine how many pairs of sneakers will have to...
StarcoderdataPython
157465
from server.worker import celery from server.main.models import VirtualMachineModel @celery.task() def task_vmspawning(id): vmachine = VirtualMachineModel.get(id) vmachine.spawn( dhcp=False, on_running=running_vmcreate_callback, on_success=success_vmcreate_callback, on_error=er...
StarcoderdataPython
1809544
<gh_stars>0 import json from project_manager_pro._meta import cache_commands from colorama import init, Style, Fore, Back init(autoreset=True) def _acmd(alias, body): file = open(cache_commands, 'r', encoding='utf-8') commands = json.load(file) commands[alias] = body print(Fore.GREEN + '' + alias ...
StarcoderdataPython
8078283
import xml.etree.ElementTree as xml_tree import pandas as pd import numpy as np import os import shutil def check_box(path): files = os.listdir(path) i = 0 for anna_file in files: tree = xml_tree.parse(path+"/"+anna_file) root = tree.getroot() # Image shape. size = root.fi...
StarcoderdataPython
8026276
from argparse import Namespace from maskrcnn.train import run args = Namespace() args.comment = 'MXInfer' args.config = ['main', 'mexico', 'infer'] args.mode = ['infer'] args.resume_run = 'run_01_PretrainPool' args.no_cuda = False args.cuda_max_devices = 1 run(args)
StarcoderdataPython
299799
<filename>dqn/policies/categorical_mlp_q_policy.py from rllab.core.lasagne_powered import LasagnePowered import lasagne.layers as L from rllab.core.network import MLP from rllab.distributions.categorical import Categorical from rllab.policies.base import Policy from rllab.misc import tensor_utils from rllab.spaces.disc...
StarcoderdataPython
9674700
<reponame>LabRobPL/robotics-toolbox-python import numpy as np from spatialmath import base def jacobian_numerical(f, x, dx=1e-8, N=0): r""" Numerically compute Jacobian of function :param f: the function, returns an m-vector :type f: callable :param x: function argument :type x: ndarray(n) ...
StarcoderdataPython
4883902
<reponame>ayroti-18/Competitive-Programming<gh_stars>1-10 #link https://practice.geeksforgeeks.org/problems/union-of-two-arrays/0# from collections import defaultdict for _ in range(int(input())): n, m = map(int, input().split()) narr = list(map(int, input().split())) marr = list(map(int, input().split()))...
StarcoderdataPython
398498
import logging def monitor(app, store_event): state = app.events.State() def announce_failed_tasks(event): state.event(event) # task name is sent only with -received event, and state # will keep track of this for us. task = state.tasks.get(event['uuid']) store_event({'...
StarcoderdataPython
213334
<reponame>adrianurdar/Automate-The-Boring-Stuff # madLibs.py - reads in text files and lets the user add their own text anywhere the word # ADJECTIVE, NOUN, ADVERB, or VERB appears in the text file # Usage: madLibs.py import re from pathlib import Path import sys def madLib(): # Ask user to name the file he wa...
StarcoderdataPython
1624557
# Copyright (c) 2014 University of California, Davis # # # 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,...
StarcoderdataPython
6605164
# 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, software # distrib...
StarcoderdataPython
1670590
<filename>src/Latis.py import io # Nécessaire car le fichier est encodé en 'utf-16-le' import xmltodict # Pour lire facilement le fichier xml import struct import binascii def nettoyage(texte: str): # Le fishier ne respecte pas totalement la norme xml # La première partie (qui nous intéresse) est valide ...
StarcoderdataPython
8179937
import numpy as np import matplotlib as mpl mpl.use('Agg') import matplotlib.pyplot as plt import scipy.interpolate import scipy.signal import scipy.spatial import scipy.stats import sys # %% Load data case = int(sys.argv[1]) print("Case " + str(case)) suffix = '_uphavg' basedata = np.load('/home/nc1472/git/qg-e...
StarcoderdataPython
8157836
<filename>app/objects/c_data_encoder.py from abc import abstractmethod import marshmallow as ma from app.objects.interfaces.i_object import FirstClassObjectInterface from app.utility.base_object import BaseObject class DataEncoderSchema(ma.Schema): name = ma.fields.String() description = ma.fields.String() ...
StarcoderdataPython
6702289
<gh_stars>1-10 # 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/LICENSE-2.0 # # Unless re...
StarcoderdataPython
6701123
import abc import tensorflow as tf import numpy as np from railrl.predictors.state_action_network import StateActionNetwork from railrl.core.tf_util import he_uniform_initializer, xavier_uniform_initializer, mlp, conv_network, linear class NNQFunction(StateActionNetwork, metaclass=abc.ABCMeta): def __init__( ...
StarcoderdataPython
1821487
""" # Sample code to perform I/O: name = input() # Reading input from STDIN print('Hi, %s.' % name) # Writing output to STDOUT # Warning: Printing unwanted or ill-formatted data to output will cause the test cases to fail """ # Write your code here t = int(input()) for _ in range(t): s =...
StarcoderdataPython
5176173
<filename>matmodlab2/core/material.py import numpy as np from collections import OrderedDict from copy import deepcopy as copy from .misc import add_metaclass class BaseMaterial(type): def __call__(cls, *args, **kwargs): """Called before __init__ method is called""" # Call the objects __init__ me...
StarcoderdataPython
308658
# Advent of Code 2020 # Day 02 # Author: irobin591 import os import doctest import re with open(os.path.join(os.path.dirname(__file__), "input.txt"), 'r') as input_file: input_data = input_file.read().strip().split('\n') def prep_data(input_data): # 0: min amount of char | no 1 # 1: max amount of char |...
StarcoderdataPython
1755509
#! /usr/bin/env python import sys sys.path.insert(0, sys.path[0]+'/source') sys.path.insert(0, sys.path[0]+'/Objects') sys.path.insert(0, sys.path[1]+'/Calculator') sys.path.insert(0, sys.path[2]+'/Solver') sys.path.insert(0, sys.path[3]+'/Models') sys.path.insert(0, sys.path[4]+'/Models/AGN_Models') sys.path.insert(0,...
StarcoderdataPython
6469973
<reponame>Allianaab2m/teammaker<filename>cogs/team.py from discord import Message import discord from discord.ext.commands import Bot, Cog, Context, command import random class Team(Cog): __slots__ = "bot" def __init__(self, bot: Bot) -> None: self.bot = bot @command() async def team(self, c...
StarcoderdataPython
8001768
import cv2 from PIL import Image import numpy as np import os.path as osp from utils import getInstanceColorImage, make_palette, color_seg import argparse def getDispSeman(ins_img_mask): disp_img = cv2.imread("disparity/6_l.png") disp_img = cv2.cvtColor(disp_img, cv2.COLOR_BGR2GRAY) sub_disp_img = ins_img...
StarcoderdataPython
5059481
from django.contrib.sites.models import Site from django.core.files.base import ContentFile from django.test import TestCase from django.test.utils import override_settings from django.utils import timezone from django.utils.translation import gettext as _ from django_comments.models import Comment import pytz from qa...
StarcoderdataPython
9761595
<filename>src/beautifulstew.py from bs4 import BeautifulSoup def xml_2_soup(input_file): try: with open(input_file) as file: data = file.read() data_unescaped = html.unescape(data) soup = BeautifulSoup(data_unescaped, "lxml") return soup except: l...
StarcoderdataPython
9789629
from .base import load_acute_inflammations from .base import load_cervical_cancer from .base import load_diabetes from .base import load_diagnostic_breast_cancer from .base import load_fertility from .base import load_heart_disease from .base import load_mammographic_masses from .base import load_pima_indians_diabetes ...
StarcoderdataPython
1974608
<filename>masters/master.chromium.lkgr/master_lkgr_cfg.py # 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. from buildbot.process.properties import WithProperties from master import gitiles_poller from ...
StarcoderdataPython
108007
#!/usr/bin/env python # -*- coding: utf-8 -*- import setuptools, os import kicost import re SHOW_LAST_HISTORY=3 try: from setuptools import setup from setuptools.command.develop import develop from setuptools.command.install import install except ImportError: from distutils.core import ...
StarcoderdataPython
5191986
<filename>doac/conf.py from django.conf import settings import datetime class Settings: def __init__(self, options): self.handlers = options.get("HANDLERS", None) if not self.handlers: self.handlers = ( "doac.handlers.bearer.BearerHandler", ) ...
StarcoderdataPython
1704894
<filename>tgsettings.py tg_key='telegram-bot-key' tmp_dir = '/tmp' tmp_uids = tmp_dir + "/uids.txt" log_file = "/var/log/tgbot/tgbot.log" debug = True markdown = True html = False
StarcoderdataPython
1964275
from __future__ import absolute_import #!/usr/bin/env python import numpy as np from scipy.stats import norm import scipy.linalg as spl from ..utils import (multiple_mahalanobis, z_score, multiple_fast_inv, check_cast_bin8) from nose.tools import assert_true, assert_equal, assert_raises from nu...
StarcoderdataPython
1684532
import tensorflow as tf import numpy as np import pyomo.environ as pyo from relumip import AnnModel from relumip.utils.visualization import plot_results_2d # Load the trained tensorflow model which will be embedded into the optimization problem. tf_model = tf.keras.models.load_model('data/peaks_3x10.h5') # Create a ...
StarcoderdataPython
4899576
import matplotlib.pyplot as plt from matplotlib import style style.use('ggplot') import numpy as np X = np.array([[1, 2], [1.5, 1.8], [5, 8], [8, 8], [1, 0.6], [9, 11]]) plt.scatter(X[:, 0], X[:, 1], s=150) plt.show() colors = 10 * ["g", "r", "c", "b", "k"] class K_Means: def __init__(self, k=2, tol=0.001, ma...
StarcoderdataPython
6686462
__all__ = ['AsyncPythonInterpreter'] try: import fcntl except: fcntl = None import os import sys import socket from StringIO import StringIO from netrepr import NetRepr, RemoteObjectPool, RemoteObjectReference import objc from Foundation import * IMPORT_MODULES = ['netrepr', 'remote_console', 'remote_pipe', '...
StarcoderdataPython
5186860
<filename>deepnodal/python/functions/hypervisor.py """ Hypervisor module for Tensorflow. """ # <NAME> #------------------------------------------------------------------------------- from deepnodal.python.functions.supervisor import * from deepnodal.python.concepts.master import * #----------------------------------...
StarcoderdataPython
6699360
<filename>utils/score_utils.py import numpy as np # calculate mean score for AVA dataset def mean_score(scores): si = np.arange(1, 11, 1) mean = np.sum(si * scores,axis=-1) return mean # calculate standard deviation of scores for AVA dataset def std_score(scores): if len(scores.shape) < 3: sco...
StarcoderdataPython
3361129
#! python3 import docx def getDocxText(filename): doc = docx.Document(filename) fullText = [] for para in doc.paragraphs: fullText.append(para.text) return '\n\n'.join(fullText)
StarcoderdataPython
4889325
<reponame>mmulich/wildbook-ia # -*- coding: utf-8 -*- import numpy as np # NOQA import utool as ut # import logging import itertools as it import copy import six import collections from wbia import constants as const from wbia.algo.graph import nx_dynamic_graph # from wbia.algo.graph import _dep_mixins from wbia.alg...
StarcoderdataPython
313339
import lasagne.layers as L import lasagne.nonlinearities as NL import lasagne.init import theano.tensor as TT import theano import lasagne from rllab.core.lasagne_powered import LasagnePowered from rllab.core.serializable import Serializable from rllab.core.network import MLP from rllab.misc import ext from rllab.misc...
StarcoderdataPython
11252249
import os.path import pandas as pd from stock.globalvar import HIST_DIR def load_csv(symbol): path = os.path.join(HIST_DIR["stock"], symbol) df = pd.read_csv(path, index_col=0, engine='c', dtype=str) return df
StarcoderdataPython
3347153
<filename>setup.py """setuptools module for solana.py.""" from setuptools import find_namespace_packages, setup extras_require = { "dev": [ "black", "pytest", "pylint", "pytest-tornasync", "mypy", "pydocstyle", "flake8", "isort", "pytest-dock...
StarcoderdataPython
12841010
from ..models.base_agent import BaseAgent class MockAgent(BaseAgent): def __init__(self, testapp, moves, game_id, player): self.testapp = testapp self.args = [] self.kwargs = [] self.moves = iter(moves) self.past_end = False super().__init__(game_id, player) de...
StarcoderdataPython
9733082
# # pystylus/ast/importnode.py # """ Contains the two import nodes in the stylus AST """ class ImportNode: """ A stylus import statement created from the line "@import xxx" where the xxx does NOT end with ".css". This is a command to stylus to import another file into the current one. """ def...
StarcoderdataPython
120693
<gh_stars>1-10 import discord import helper import numpy numpy.random.seed(9999) import tensorflow from tensorflow import keras async def find_friends(user, guild, dictionary): """ Creates dictionary of floats representing similarity percentage mapped to Discord user mentions based on the user and guild Argument...
StarcoderdataPython
78914
import ray import torch from collections import namedtuple, defaultdict from itertools import count, chain from flatland.envs.agent_utils import RailAgentStatus from agent.PPO.PPORollout import PPORollout, PPOTransition class PPORunner(): def _select_actions(self, state, done): valid_handles = list() ...
StarcoderdataPython
1837783
from __future__ import annotations from collections.abc import Collection from typing import Callable, Protocol, TypeVar Element = TypeVar("Element") Comparator = Callable[[Element, Element], bool] MIN_COMPARATOR: Comparator = lambda x, y: x < y MAX_COMPARATOR: Comparator = lambda x, y: x < y class Node(Protoco...
StarcoderdataPython
3404703
<gh_stars>10-100 # Copyright 2022 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-2.0 # # Unless required by applicable...
StarcoderdataPython
8005069
import sys import torch.nn as nn import torch.nn.functional as F from layers import GraphConvolution import torch from torch.nn.parameter import Parameter class Co_GCN(nn.Module): def __init__(self, input_size, hidden_size, output_size, dropout=0.3, indep_weights=False): super(Co_GCN, self).__init__() ...
StarcoderdataPython
329458
<reponame>vermavis/cbtool #!/usr/bin/env python3 #/******************************************************************************* # Copyright (c) 2012 IBM Corp. # 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 ...
StarcoderdataPython
3512903
def rot13(s): "ROT-13 Ceaser Cypher" return s.translate( str.maketrans( "ABCDEFGHIJKLMabcdefghijklmNOPQRSTUVWXYZnopqrstuvwxyz", "NOPQRSTUVWXYZnopqrstuvwxyzABCDEFGHIJKLMabcdefghijklm" ) )
StarcoderdataPython
1680927
from django.urls import path from . import views urlpatterns = [ path('', views.index, name='home'), path('about/', views.about, name='about'), path('contact/', views.contact, name='contact'), path('privacy/', views.privacy, name='privacy'), path('terms/', views.terms, name='terms'), ]
StarcoderdataPython
1651293
<filename>full.py #!/usr/bin/python3 # -*- coding: utf-8 -*- """ Module to fetch images(or other types of attachments) from VK dialog and download them to local drive. """ from time import time from sys import stdout import urllib.request import requests import json def get_photos(folder, **kwargs): """ Fetc...
StarcoderdataPython
1780271
# Generated by Django 3.0.4 on 2020-03-13 13:58 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('kobe', '0006_kobepost_summittime'), ] operations = [ migrations.RemoveField( model_name='kobepost', name='summitTime...
StarcoderdataPython
5088603
from django.apps import AppConfig class ExtractionConfig(AppConfig): name = 'extraction'
StarcoderdataPython
170605
"""Tests for graphein.protein.features.nodes.amino_acids""" # Graphein # Author: <NAME> <<EMAIL>>, <NAME> # License: MIT # Project Website: https://github.com/a-r-j/graphein # Code Repository: https://github.com/a-r-j/graphein from functools import partial import numpy as np import pandas as pd from pandas.testing im...
StarcoderdataPython
5183228
<gh_stars>0 import json import os import subprocess import urllib.request def lambda_handler(event, context): # Download the CLI and make it executable; must use 1.33.0+ file_name, headers = urllib.request.urlretrieve("https://s3-us-west-2.amazonaws.com/confluent.cloud/ccloud-cli/binaries/1.33.0/ccloud_1.33.0_...
StarcoderdataPython
3567260
<reponame>Eurydia/Xian-assignment n = input() arr = list(map(int, input().split())) print(all(i > 0 for i in arr) and any(i < 10 or i % 11 == 0 for i in arr))
StarcoderdataPython
6645439
# Copyright 2008-2015 Nokia Networks # Copyright 2016- Robot Framework Foundation # # 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 ...
StarcoderdataPython
337271
<reponame>lesserwhirls/scipy-cwt<filename>scipy/sparse/linalg/eigen/__init__.py "Sparse eigenvalue solvers" from info import __doc__ from arpack import * from lobpcg import * __all__ = filter(lambda s:not s.startswith('_'),dir()) from numpy.testing import Tester test = Tester().test bench = Tester().bench
StarcoderdataPython
9769716
from __future__ import absolute_import import json import os import unittest from functools import partial import cwltool.pack from cwltool.main import print_pack as print_pack import cwltool.workflow from cwltool.load_tool import fetch_document, validate_document from cwltool.main import makeRelative from cwltool.pat...
StarcoderdataPython
1897726
<gh_stars>0 from io import StringIO class Diagnostics_HTML(): def __init__(self, settings, device, page_elements): self.config = settings self.device = device self.diagnostics_html = None self.page_elements = page_elements def get_diagnostics_html(self, base_url, force_update...
StarcoderdataPython
61623
<reponame>rombie/contrail-test ''' Generate Policy test scenarios based on user input. Policy test cases can be built based on this topology. ''' import copy from random import choice class PolicyTestBasicConfig_1(): def __init__(self): self.vmc_list = [] self.vnet_list = [] self.policy_...
StarcoderdataPython
9746080
"""Unit tests for hello_world.py.""" from hello_world.hello_world import hello def test_hellow_world(): assert hello("Frank") == "Hello Frank" assert hello("Sam") == "Hello Sam"
StarcoderdataPython
7957
#!/usr/bin/env python # #The MIT License (MIT) # # Copyright (c) 2015 Bit9 + Carbon Black # # 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 t...
StarcoderdataPython
9616265
<reponame>mzweig/LogicalLens from setuptools import find_packages, setup setup( name='logical-lens', version='0.0.1', description='Python library for using parametric specifications to' 'embed domain specific knowledge in machine learning.', url='https://github.com/mvcisback/LogicalLens', autho...
StarcoderdataPython
6683365
""" Terrain package """ from .terrain import Terrain from .wms import WMS from .srtm import SRTM from .threedep import ThreeDEP __all__ = [ "Terrain", "WMS", "SRTM", "ThreeDEP" ]
StarcoderdataPython
46792
"""This imports all the lib package classes""" from gateway import Gateway
StarcoderdataPython
8076355
# Generated by Django 3.0.3 on 2020-07-04 20:10 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('accounts', '0003_auto_20200704_0236'), ] operations = [ migrations.AddField( model_name='customer', name='gender', ...
StarcoderdataPython
4910549
# -*- coding: utf-8 -*- # # djangoplicity-contacts # Copyright (c) 2007-2011, European Southern Observatory (ESO) # 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 ...
StarcoderdataPython
3369343
#!/bin/python3 """ Script to perform hyperparameter optimization on a reservoir computer with the specified options. Run as: python3 opt_then_test.py SYSTEM MAP_INITIAL PREDICTION_TYPE METHOD [Results directory] [options...] ### Script arguments ### Choose SYSTEM from ["lorenz", "rossler", "thomas", "softrobot"] C...
StarcoderdataPython
9738677
<reponame>Galland/kivy ''' Widget animation ================ This example demonstrates creating and applying a multi-part animation to a button widget. You should see a button labelled 'plop' that will move with an animation when clicked. ''' import kivy kivy.require('1.0.7') from kivy.animation import Animation fro...
StarcoderdataPython
11352153
<reponame>Funtimes-Smarts/Python-import-Smart<gh_stars>0 # pylint: disable=C0111,R0902,R0904,R0912,R0913,R0915,E1101 # Smartsheet Python SDK. # # Copyright 2017 Smartsheet.com, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"): you may # not use this file except in compliance with the License. You...
StarcoderdataPython
10285
<reponame>jlsmirandela/Curso_Python print('-+-' *10) print(' <NAME> PA') print('+-+' * 10) c = 1 ter = int(input('Insira o primeiro termo - ')) rz = int(input('Insira a razão - ')) while c <= 10: print(ter, ' → ', end=' ') ter += rz c += 1 print('FIM')
StarcoderdataPython
6438906
"""Testing file path evaluation when using import_tasks / include_tasks.""" import textwrap from pathlib import Path from typing import Dict import pytest from ansiblelint.rules import RulesCollection from ansiblelint.runner import Runner LAYOUT_IMPORTS: Dict[str, str] = { "main.yml": textwrap.dedent( ""...
StarcoderdataPython
8108975
<reponame>SuviVappula/tilavarauspalvelu-core<gh_stars>0 # Generated by Django 3.1.13 on 2021-10-11 07:18 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('permissions', '0010_unit_permissions'), ] operations = [ migrations.AddField( ...
StarcoderdataPython
6515920
import os.path import sys import math infile = sys.argv[1] platform = sys.argv[2] outfile = sys.argv[3] trackKey = "" def get_inputs(infile): if os.path.isfile(infile): return [infile] return [os.path.join(infile, x) for x in os.listdir(infile)] delayMemory = {} def main(): glob...
StarcoderdataPython
9633358
<gh_stars>0 """ Advent of code 2017 day 3/1 """ import unittest from code import solution, start_point, count_y, side_pos class MyTest(unittest.TestCase): """Unist tests for actual day""" def test_start(self): """ Test start point """ self.assertEqual(start_point(52), (50, 5)) self.ass...
StarcoderdataPython
1746516
<filename>tests/test_api.py<gh_stars>10-100 #!/usr/bin/env python # -*- coding: utf-8 -*- """Tests for `mlbench_core.api` package.""" import datetime import pytest from mlbench_core.api import ApiClient @pytest.fixture def kubernetes_api_client_node_port(mocker): mock_client = mocker.patch("kubernetes.client....
StarcoderdataPython
9737516
<filename>psana/psana/pyalgos/generic/NDArrGenerators.py<gh_stars>0 ####!/usr/bin/env python #------------------------------ """ :py:class:`NDArrGenerators` wrapping methods for numpy random array generators ============================================================================== Usage:: import psana.pyalgo...
StarcoderdataPython
1926401
<reponame>dreamergz/gltf-to-3d-tiles from .gltf_to_tileset import gltf_to_tileset
StarcoderdataPython
6552359
from . import FaceDetector from . import DataProvider from . import ImageProvider
StarcoderdataPython
1860471
<reponame>antho214/RayTracing from .matrix import * from .ray import * import matplotlib.pyplot as plt import matplotlib.patches as patches import matplotlib.path as mpath import matplotlib.transforms as transforms class MatrixGroup(Matrix): """MatrixGroup: A group of Matrix(), allowing the combination of sev...
StarcoderdataPython
11210625
# Importing modules import argparse import atexit import happybase import json import logging from kafka import KafkaConsumer # Configuring logger logger_format = '%(asctime)s - %(message)s' logging.basicConfig(format = logger_format) logger = logging.getLogger('data-storage-writer') logger.setLevel(logging.DEBUG) #...
StarcoderdataPython
3357378
from pathlib import Path from argparse import Namespace import numpy as np import torch from torch.utils.data import DataLoader import mediapipe as mp from model.estimator_2d import Estimator2D from data.video_dataset import VideoDataset from data.skeleton_helper import mediapipe2openpose, mediapipe2coco from data.d...
StarcoderdataPython
6623944
from __future__ import unicode_literals __version__ = "6.27.18"
StarcoderdataPython
11347369
## https://medium.com/swlh/real-time-object-detection-deployment-using-tensorflow-keras-and-aws-ec2-instance-1c1937c001d9 import sys, os import io from fastapi import FastAPI, UploadFile, File from starlette.requests import Request from pydantic import BaseModel import cv2 import cvlib as cv from cvlib.object_detec...
StarcoderdataPython
6557852
<filename>pikuli/uia/control_wrappers/list.py<gh_stars>0 # -*- coding: utf-8 -*- from .uia_control import UIAControl class List(UIAControl): ''' Некий список из ListItem'ов. ''' CONTROL_TYPE = 'List' def list_items(self): return self.find_all(ControlType='ListItem', exact_level=1)
StarcoderdataPython
6471526
""" SocksProxy implementation. """ # TODO implement SocksProxy
StarcoderdataPython
3243108
"""Generates capacity diagrams for the bottleneck""" import csv from matplotlib import pyplot as plt from matplotlib import rc import numpy as np import os rc('text', usetex=True) font = {'weight': 'bold', 'size': 18} rc('font', **font) inflows = [] outflows = [] path = os.path.dirname(os.path.abspath(__file...
StarcoderdataPython
6592075
<gh_stars>0 from .main import scrape __all__ = ["scrape"]
StarcoderdataPython