id stringlengths 1 265 | text stringlengths 6 5.19M | dataset_id stringclasses 7
values |
|---|---|---|
3385152 | <filename>python/cppyy/ll.py
""" Low-level utilities, to be used for "emergencies only".
"""
import cppyy
try:
import __pypy__
del __pypy__
ispypy = True
except ImportError:
ispypy = False
__all__ = [
'cast',
'static_cast',
'reinterpret_cast',
'dynamic_cast',
'malloc',
'free',... | StarcoderdataPython |
3355782 | <gh_stars>0
# Copyright (c) 2012-2013, <NAME> <<EMAIL>>
# All rights reserved.
#
# See LICENSE file for full license.
from aws import Action as BaseAction
from aws import BaseARN
service_name = 'Application Auto Scaling'
prefix = 'application-autoscaling'
class Action(BaseAction):
def __init__(self, action=None... | StarcoderdataPython |
137261 | from .CutTools import * | StarcoderdataPython |
3331297 | import curses
import os
import platform
import time
from contextlib import contextmanager
from _curses import error as CursesError
from typing import Any, Callable, Dict, Generator, List, Optional, Type
from .context import BoundingRectangle, RenderContext
from .component import Component, DeferredInput
from .input i... | StarcoderdataPython |
3274499 | <filename>installscripts/wizard/scenarios/__init__.py
from stack_with_bb_jenkins import *
from stack_with_bb_dockerized_jenkins import *
from stack_with_dockerized_gitlab_jenkins import *
| StarcoderdataPython |
1672793 | #!/usr/bin/env python3
import argparse
# We define the necessary functions ahead of usage
def sum_ints(a, b):
return a + b
def get_user_name():
parser = argparse.ArgumentParser()
parser.add_argument('-u', '--user', default='User')
args = parser.parse_args()
return args.user
# This makes sure w... | StarcoderdataPython |
3342535 | # */
# * Licensed to the Apache Software Foundation (ASF) under one
# * or more contributor license agreements. See the NOTICE file
# * distributed with this work for additional information
# * regarding copyright ownership. The ASF licenses this file
# * to you under the Apache License, Version 2.0 (the
# * "License... | StarcoderdataPython |
69304 | from fastapi import (
FastAPI,
Depends,
)
from CTFe.config.database import dal
from CTFe.utils import (
validators,
enums,
)
from CTFe.views import (
auth_router,
user_router,
team_router,
challenge_router,
attempt_router,
player_router,
contributor_router,
)
app = FastAPI... | StarcoderdataPython |
126830 | from django.urls import path, include, re_path
from . import views
app_name = 'accounts'
urlpatterns = [
re_path(r'^reachus', views.reachus, name='reachus'),
re_path(r'^login', views.login, name='login'),
re_path(r'^signup', views.signup, name='signup'),
re_path(r'^campus_signup', views.campus_signup, ... | StarcoderdataPython |
4836902 | import sys
import time
from python_kemptech_api import *
wait_time = 10
max_retries = 10
# Specify the LoadMaster connection credentials here:
loadmaster_ip = ""
username = ""
password = ""
# Specify the Virtual Service and Real Server IDs here:
virtual_service_id = 0
real_server_id = 0
lm = LoadMaster(loadmaster_ip... | StarcoderdataPython |
178404 | <reponame>neilswainston/DEbrief<filename>main.py<gh_stars>0
'''
DEbrief (c) GeneGenie Bioinformatics Limited
All rights reserved.
@author: neilswainston
'''
# pylint: disable=no-member
# pylint: disable=wrong-import-order
import json
import sys
import uuid
from apiclient import discovery
import flask
import httplib... | StarcoderdataPython |
1604612 | <reponame>diamondtron24/Game-List-Builder
# Generated by Django 3.1.2 on 2020-11-19 01:38
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('armada', '0010_savedlists'),
]
operations = [
migrations.RenameModel(
old_name='SavedLists',
... | StarcoderdataPython |
3268944 | """Unit test for flood module"""
from floodsystem.stationdata import build_station_list, update_water_levels
from floodsystem.flood import stations_level_over_threshold, stations_highest_rel_level
def test_stations_level_over_threshold():
""" Test returning a sorted list of (station, relative water level) tuples"... | StarcoderdataPython |
1778731 | import unittest
import threading
import gc
import platform
from queue import Empty
from across._utils import SimpleQueue
class Garbage:
pass
def test_gc(margin, func, gc_func):
def gc_callback(phase, info):
if phase == 'start':
gc_func()
garbage = []
garbage_append = garbage.ap... | StarcoderdataPython |
1760360 | <reponame>otizonaizit/pelita
# -*- coding: utf-8 -*-
"""
Verbose demonstration of how to set up a server and run a remote game.
For all practical needs, using the simplesetup module should be sufficient.
"""
import sys
import subprocess
from pelita.simplesetup import SimpleServer, SimplePublisher, SimpleController
... | StarcoderdataPython |
4825307 | # -*- coding: utf-8 -*-
import numpy as np
from sklearn.model_selection import train_test_split
from sktime.classification.frequency_based import RandomIntervalSpectralForest
from sktime.datasets import load_gunpoint
# expected y_proba
expected = np.array(
[
[0.8, 0.2],
[1.0, 0.0],
[0.8, 0... | StarcoderdataPython |
1712330 | from sosi_crawler_executor.crawler import Executor | StarcoderdataPython |
131852 | ##########################################################################
#
# Copyright (c) 2012, <NAME>. All rights reserved.
# Copyright (c) 2013, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the f... | StarcoderdataPython |
1797172 | <reponame>Viet7501/viet1<filename>buoi12/bai2.py
try:
print(10 / 0)
except (TypeError, ZeroDivisionError):
print("Python Quiz") | StarcoderdataPython |
4801237 | # ##### BEGIN GPL LICENSE BLOCK #####
#
# 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 2
# of the License, or (at your option) any later version.
#
# This program is distrib... | StarcoderdataPython |
54875 | #!/usr/bin/env python3
# -- coding: utf-8 --
import datetime
from dateutil import parser, tz
from lxml import etree
from flask import Flask, request, abort, make_response, Response
from flask_appconfig import AppConfig
import requests
def create_app(configfile=None):
app = Flask("delayrss")
AppConfig(app, c... | StarcoderdataPython |
1745841 | import os
from unittest import TestCase
import yaml
MY_DIR = os.path.abspath(os.path.dirname(__file__))
ROOT_DIR = os.path.normpath(os.path.join(MY_DIR, '..', '..'))
def path(*x):
return os.path.join(ROOT_DIR, *x)
class Version:
'''
Just a helper that makes it easy to do things with version numbers.
... | StarcoderdataPython |
3204994 | <gh_stars>0
power = {'BUSES': {'Area': 1.33155,
'Bus/Area': 1.33155,
'Bus/Gate Leakage': 0.00662954,
'Bus/Peak Dynamic': 0.0,
'Bus/Runtime Dynamic': 0.0,
'Bus/Subthreshold Leakage': 0.0691322,
'Bus/Subthreshold Leakage with power gating': 0.0259246,
... | StarcoderdataPython |
3315612 |
from .exc import ElectrumErrorResponse
__version__ = '0.8.1'
| StarcoderdataPython |
175916 | # Classes to handle creation on BabyConnect Types programmatically.
# Methods also support a to_json and from_json method so they can be
# dumped and reloaded from a json file
from datetime import datetime
class Diaper(object):
'''
Class to handle a diaper type request.
'''
type=None
id=None
... | StarcoderdataPython |
1730078 | import asyncio
import datetime
import random
import websockets
import json
@asyncio.coroutine
def msg_producer():
_id = 0
status = {0:'sleeping',1:'running', 2:'recruiting', 3:'pending'}
while True:
rndm = random.randint(0, 3)
batt = random.randint(0,9)
yield from asyncio.sleep(rndm)... | StarcoderdataPython |
36601 | ##
## Software PI-Net: Pose Interacting Network for Multi-Person Monocular 3D Pose Estimation
## Copyright Inria and UPC
## Year 2021
## Contact : <EMAIL>
##
## The software PI-Net is provided under MIT License.
##
#used in train for skeleton input
import os
import os.path as osp
import numpy as np
import math
from ut... | StarcoderdataPython |
1761812 | <gh_stars>0
from django.contrib import admin
from app.models import TopSecret
# Register your models here.
admin.site.register(TopSecret)
| StarcoderdataPython |
1755835 | <filename>banana/interfaces/ants.py
from nipype.interfaces.base import (
TraitedSpec, traits, File, CommandLineInputSpec, CommandLine)
import os
import os.path as op
from nipype.interfaces.base import isdefined
# ants_reg_path = os.path.abspath(
# os.path.join(os.path.dirname(__file__), 'resources', 'bash',
# ... | StarcoderdataPython |
3322077 | #!/usr/bin/env python
# ###################################################################
#
# Disclaimer and Notice of Copyright
# ==================================
#
# Copyright (c) 2015, Los Alamos National Security, LLC
# All rights reserved.
#
# Copyright 2015. Los Alamos National Security, LLC.
# Thi... | StarcoderdataPython |
3287162 | <filename>test_utilities/src/d1_test/tests/test_d1_test_case.py
#!/usr/bin/env python
# This work was created by participants in the DataONE project, and is
# jointly copyrighted by participating institutions in DataONE. For
# more information on DataONE, see our web site at http://dataone.org.
#
# Copyright 2009-20... | StarcoderdataPython |
3232098 | string=[]
leng=[]
flag=[0,0,0]
exit_flag=0
for i in range(0,3):
string.append(input())
leng.append(len(string[i]))
mystring=input()
length=leng[0]+leng[1]+leng[2]
""" for i in range(0,3):
for j in range(0,len(mystring),leng[i]):
if(string[i]==mystring[j:j+1]):
flag[i]=1
... | StarcoderdataPython |
3215158 | <gh_stars>0
from django import forms
from django.forms import fields
from .models import Review_Blog
class ReviewBlogForm(forms.Form):
name=forms.CharField(max_length=255)
email=forms.EmailField()
comment = forms.CharField(widget=forms.Textarea)
# class ReviewBlogFormTest(forms.ModelForm):
# class Me... | StarcoderdataPython |
1638382 | <reponame>BobbyKarabinakis/feedsubs<filename>reader/html_processing.py
from logging import getLogger
from typing import Optional, List
import urllib.parse
import bleach
import bs4
from . import models
ALLOWED_TAGS = bleach.ALLOWED_TAGS + ['p', 'pre', 'img', 'br', 'h1', 'h2',
'h3... | StarcoderdataPython |
52195 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 7/20/20 8:07 PM
# @Author : anonymous
# @File : Mutation_equal.py
#TODO:integrate transformation rules
import re
import random
import mutation.gateCirq_EqualT as MC
import mutation.gateQiskit_EqualT as MQ
import mutation.gatePyQuil_EqualT as MP
def figur... | StarcoderdataPython |
3346964 | r"""Tabs as in browser tabs, not \t characters."""
from __future__ import annotations
import collections
import dataclasses
import hashlib
import importlib
import itertools
import logging
import os
import pathlib
import tkinter
import traceback
from tkinter import filedialog, messagebox, ttk
from typing import (
A... | StarcoderdataPython |
116520 | # -*- coding: utf-8 -*-
# Define here the models for your spider middleware
#
# See documentation in:
# https://doc.scrapy.org/en/latest/topics/spider-middleware.html
from scrapy import signals
from scrapy.exceptions import IgnoreRequest
from urllib.parse import parse_qsl,urlencode,urlsplit,urluns... | StarcoderdataPython |
83708 | <reponame>curtislisle/miqa
# Generated by Django 3.2.7 on 2021-09-21 12:58
import uuid
from django.db import migrations, models
import django.db.models.deletion
def default_evaluation_model_mapping():
return {'ncanda-t1spgr-v1': 'MIQAT1-0', 'ncanda-mprage-v1': 'MIQAT1-0'}
class Migration(migrations.Migration)... | StarcoderdataPython |
141830 | <reponame>vasily-v-ryabov/comtypes
import unittest, gc
from ctypes import *
from ctypes.wintypes import *
################################################################
class PROCESS_MEMORY_COUNTERS(Structure):
_fields_ = [("cb", DWORD),
("PageFaultCount", DWORD),
("Peak... | StarcoderdataPython |
1625748 | <reponame>richardqa/django-ex
# -*- coding: utf-8 -*-
# Generated by Django 1.11.1 on 2017-06-06 16:57
from __future__ import unicode_literals
from django.db import migrations, models
def actualiza_establecimientos_influenza(apps, schema_editor):
establecimientos_model = apps.get_model('establecimiento', 'Establ... | StarcoderdataPython |
35606 | #!/usr/bin/python2
#
# Copyright 2019 Google Inc.
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
roots = [
'bench',
'dm',
'docs',
'example',
'experimental',
'fuzz',
'gm',
'include',
'modules',
'platform_tools/an... | StarcoderdataPython |
4821333 | <gh_stars>0
# Improve the program discussed in How To 2.1 to allow input of quar ters in addition
# to bills.
#constants
PENNIES_PER_DOLLAR = 100
PENNIES_PER_QUARTER = 25
cashValue = float(input("Enter value (0.25 = quarter, 1.25 ="
" $1.25, 5 = $5 bill, etc.): "))
itemPrice = int(input("Ite... | StarcoderdataPython |
1777747 | import sys
import os
import configparser
import argparse
# Проверяет, что путь соответствует фильтрам
def is_ignored(filename):
for ignore_dir in ignore_dirs:
if filename.startswith(ignore_dir):
return True
_, cur_ext = os.path.splitext(filename)
return cur_ext not in extensions
... | StarcoderdataPython |
194585 | <filename>pymcuprog/serialupdi/application.py
"""
Application layer for UPDI stack
"""
from logging import getLogger
from pymcuprog.pymcuprog_errors import PymcuprogError
from pymcuprog.serialupdi import constants
from pymcuprog.serialupdi.link import UpdiDatalink16bit, UpdiDatalink24bit
from pymcuprog.serialupdi.nvm i... | StarcoderdataPython |
3397354 | <reponame>neurologists/ionic
#
# <NAME>, <NAME>
# 10/09/2018
#
import tensorflow as tf
import math
import random
import numpy as np
def process(dataset, training, config, len):
dataset = dataset.map(parse_data, num_parallel_calls=config.batch_size)
dataset = dataset.map(normalize_data, num_parallel_calls=confi... | StarcoderdataPython |
3342249 | def to_mdtraj_Trajectory(item, selection='all', structure_indices='all', syntaxis='MolSysMT'):
if check:
from molsysmt.tools.mmtf_MMTFDecoder.is_mmtf_MMTFDecoder import _checking_form
_checking_form(item, check=check)
from molsysmt.tools.mmtf_MMTFDecoder.to_molsysmt_MolSys import to_molsysmt_M... | StarcoderdataPython |
3250128 | <gh_stars>0
"""Dot notation and access for dictionaries in python"""
from .diot import (
Diot,
CamelDiot,
SnakeDiot,
FrozenDiot,
OrderedDiot,
DiotFrozenError
)
__version__ = "0.1.1"
| StarcoderdataPython |
1760015 | <gh_stars>10-100
"""
Test functions for sm.rlm
"""
from statsmodels.compat.testing import SkipTest
import numpy as np
from numpy.testing import assert_almost_equal, assert_allclose
import pytest
from scipy import stats
import statsmodels.api as sm
from statsmodels.robust.robust_linear_model import RLM
DECIMAL_4 = 4
D... | StarcoderdataPython |
79741 | <reponame>maxibor/coproID
#!/usr/bin/env python3
import argparse
import pandas as pd
import sys
def get_args():
'''This function parses and return arguments passed in'''
parser = argparse.ArgumentParser(
prog='normalizedReadCount',
description='Counts reads aligned to genome, and normalize b... | StarcoderdataPython |
79843 | import sys
import argparse
import os
import cv2
import yaml
from PIL import Image
from importlib.machinery import SourceFileLoader
import torch
from torch import nn
from tqdm import tqdm
import numpy as np
import matplotlib.pyplot as plt
import pandas
import numpy
__filedir__ = os.path.dirname(os.path.realpath(__file_... | StarcoderdataPython |
7182 | <gh_stars>0
"""
4 – Um grande cliente seu sofreu um ataque hacker: o servidor foi sequestrado por um software malicioso, que criptografou todos os discos e pede a digitação de uma senha para a liberação da máquina. E é claro que os criminosos exigem um pagamento para informar a senha.
Ao analisar o código do programa ... | StarcoderdataPython |
1676270 | # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | StarcoderdataPython |
1652690 | <gh_stars>1-10
import os
from conans import ConanFile
required_conan_version = ">=1.33.0"
class RenderContextConan(ConanFile):
python_requires = "base_conanfile/v0.2.0@jgsogo/stable"
python_requires_extend = "base_conanfile.BaseCMakeConanfile"
name = "render_context"
homepage = "https://github.com/jg... | StarcoderdataPython |
3231447 | import serial
import time
import sys
import argparse
from Tkinter import *
import numpy as np
"""root = Tk()
root.resizable(width = False, height= False)
power = StringVar()
power.set('Arbitrary Power: {}'.format(0))
l = Label(root, textvariable=power, font=("Helvetica", 64))
l.pack()
"""
parser = argparse.Argument... | StarcoderdataPython |
3264252 | from myhdl import block, Signal, always_comb, always
@block
def delay_cycles(clk, din, dout, delay_by=1):
"""Delays din by delay_by clk cycles."""
delay_sigs = [Signal(din.val) for _ in range(delay_by)]
@always_comb
def input_rename():
delay_sigs[0].next = din
@always(clk.posedge)
de... | StarcoderdataPython |
4831297 | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
import unittest
from ...util import Stub, StubProxy
from testing_tools.adapter.__main__ import (
parse_args,
main,
UnsupportedToolError,
UnsupportedCommandError,
)
class StubTool(StubProxy):
def __init_... | StarcoderdataPython |
117226 | from autodp.mechanism_zoo import PureDP_Mechanism
from autodp.transformer_zoo import Composition
# Example: pure DP mechanism and composition of it
eps = 0.3
mech = PureDP_Mechanism(eps, name='Laplace')
import matplotlib.pyplot as plt
fpr_list, fnr_list = mech.plot_fDP()
plt.figure(1)
plt.plot(fpr_list,fnr_list,... | StarcoderdataPython |
173234 | import pydantic
class InternalDataPair(pydantic.BaseModel):
key: str
data: str
| StarcoderdataPython |
3394518 | import asyncio
import functools
import re
from io import BytesIO
from logging import getLogger
from typing import Union
from aiogram.types import (
CallbackQuery,
InlineKeyboardButton,
InlineKeyboardMarkup,
Message,
ParseMode,
)
from aiogram.utils.exceptions import RetryAfter
from checkbox451_bot ... | StarcoderdataPython |
54670 | <gh_stars>0
from typing import Optional, Any
from ezcliy.exceptions import MissingPositional
class Positional:
"""Asign value (by source order) to object, allows asking for value or provide default one."""
value: str = None
"""Fetched value by positional"""
description: str = None
"""Description... | StarcoderdataPython |
4831756 | """This container module contains improvements to Python's stdlib."""
| StarcoderdataPython |
1718812 | <reponame>ManuGar/Deep-Image-Analogy-PyTorch<filename>src/models/__init__.py
from .VGG19 import VGG19 as VGG19
| StarcoderdataPython |
3274344 | <filename>estudo de modulos/131 - envio de emails.py
from string import Template
from datetime import datetime
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from email.mime.image import MIMEImage # recebe uma imagem
import smtplib # responsavel por enviar o email para o servidor(... | StarcoderdataPython |
1732802 | <filename>Test/test2.py<gh_stars>0
import tensorflow as tf
if __name__ == "__main__":
Text_a = tf.Variable(tf.ones([64, 300], tf.int32))
text_embed = tf.Variable(tf.truncated_normal([50, 100], stddev=0.3))
TA = tf.nn.embedding_lookup(text_embed, Text_a)
sess = tf.Session()
sess.run(tf.global_variab... | StarcoderdataPython |
3263477 | class FileTXT:
'''
Class responsible for managing the reading and writing of the query file.
'''
def __init__(self, file):
'''
Instance and makes the call to read the file.
Args:
----
- file (str) filepath to access
'''
self.lines = []
self.filepath = file
self.valid = self.__read_file()
d... | StarcoderdataPython |
3259991 | <filename>axonius_api_client/api/json_api/system_meta.py
# -*- coding: utf-8 -*-
"""Models for API requests & responses."""
import marshmallow
import marshmallow_jsonapi
from .base import BaseSchemaJson
class SystemMetaSchema(BaseSchemaJson):
"""Pass."""
api_client_version = marshmallow_jsonapi.fields.Str()... | StarcoderdataPython |
183722 | from src.tracker import Tracker
if __name__ == "__main__":
Tracker()
| StarcoderdataPython |
4820625 | import time
from typing import Optional
from tanager_feeder.commanders.commander import Commander
class SpecCommander(Commander):
def take_spectrum(
self, path: str, basename: str, num: int, label: str, i: Optional[int], e: Optional[int], az: Optional[int]
):
self.remove_from_listener_queue(
... | StarcoderdataPython |
1642008 | import requests
import os
import gzip
import math
import json
from typing import List, Dict
mapping = {
"earn": {
"metric": "iearn",
"labels": ["vault", "param", "address", "version"]
},
"ib": {
"metric": "ironbank",
"labels": ["vault", "param", "address", "version"]
},
... | StarcoderdataPython |
1635513 | from setuptools import setup
setup(
name="tiny_python_utils",
version="0.0.1",
description="Personal Python utils",
author="<NAME>",
packages=["tiny_python_utils"],
)
| StarcoderdataPython |
1606519 | from dataclasses import dataclass
from typing import List, Union
from typing_extensions import Literal
class Dictable(object):
base = {}
@property
def dictionary(self):
return self.base
class FatherOfAQB(Dictable):
base = {}
def __init__(self, base=None):
if base: self.base = b... | StarcoderdataPython |
3324567 | from netCDF4 import Dataset
import numpy as np
import json
import sys,getopt
opts, args = getopt.getopt(sys.argv[1:],':ir',['nc=', 'cities=', 'variable=', 'attr=', 'output='])
for opt,arg in opts:
if opt=='--nc':
filename=arg
if opt=='--variable':
variable=arg
if opt=='--cities':
cities=arg
... | StarcoderdataPython |
186447 | <filename>sponsor-challenges/csit/part1 source/opcode.py<gh_stars>1-10
class opcode(object):
nul = 1
hello = 2
rhello = 130
get = 160
rget = 161
| StarcoderdataPython |
3308137 | <gh_stars>0
"""
Authors: <NAME>, <NAME>
E-mail: <EMAIL>, <EMAIL>
Course: Mashinski vid, FEEIT, Spring 2022
Date: 23.03.2022
Description: design, train and evaluate a CNN for object classification
Python version: 3.6
"""
# python imports
import os
import numpy as np
from keras.utils import plot_model
from keras.callb... | StarcoderdataPython |
41288 | # -*- coding: utf-8 -*-
# Copyright 2020 EMBL - European Bioinformatics Institute
#
# 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 requ... | StarcoderdataPython |
3265101 | #!/usr/bin/env python
#
# Copyright 2014 - 2018 The BCE Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the license.txt file.
#
import bce.parser.cexp.token as _cexp_token
import bce.parser.cexp.parser as _cexp_parser
import bce.parser.cexp.substitut... | StarcoderdataPython |
3357223 | <filename>main.py<gh_stars>0
import os
import json
from datetime import datetime
content = {}
json_content = {}
host = os.listdir()
db = 'data.dat'
db_ver = 2
indent = 15
header = {'base': db_ver, 'last update': str(datetime.now())}
graph = ['Name', 'Location', 'Date buy', 'Date exchange', 'Cost', 'Cost exchange', 'Ta... | StarcoderdataPython |
60422 | <gh_stars>1-10
import six
import unittest
from raspi_io import Query
from raspi_io.utility import scan_server
class TestQuery(unittest.TestCase):
def setUp(self):
self.query = Query(scan_server(timeout=0.03)[0])
def test_query_info(self):
info = self.query.get_hardware_info()
self.ass... | StarcoderdataPython |
1646363 | """
Test cases concerned with the vectors that Vanquisher provide.
"""
import math
import vanquisher.game.vector as vc
def test_indices():
"""
Tests that vector pooling works well.
"""
pool = vc.Vec2Pool()
vec_1 = pool.make(2, 2)
vec_2 = pool.make(1, 2)
assert vec_1.pool_index() == 0
... | StarcoderdataPython |
4823986 | from django.conf.urls import url
from rest_framework import routers
from .views import *
router = routers.DefaultRouter()
router.register(r'jobs', JobViewSet, 'jobs')
router.register(r'tools', ToolViewSet, 'tools')
router.register(r'company', CompanyJobViewSet, 'company')
current_detail = JobViewSet.as_view({'get': ... | StarcoderdataPython |
1606609 | """
let's be simple
"""
import os
import sys
sys.path.append("../../../../")
import swhlab
import matplotlib.pyplot as plt
import matplotlib.mlab as mlab
import numpy as np
import time
class ABF2(swhlab.ABF):
def simple(self,plotToo=True):
# RMS percentile
perRMS=75
perPSC=1... | StarcoderdataPython |
3391842 | <filename>install/app_store/tk-photoshopcc/v1.2.1/python/tk_photoshopcc/adobe_bridge.py
# Copyright (c) 2016 Shotgun Software Inc.
#
# CONFIDENTIAL AND PROPRIETARY
#
# This work is provided "AS IS" and subject to the Shotgun Pipeline Toolkit
# Source Code License included in this distribution package. See LICENSE.
# By... | StarcoderdataPython |
144450 | v1 = int(input('Digite um valor:'))
v2 = int(input('Digite outro valor:'))
re = (v1+v2)
print ('O valor da soma entre {} e {} tem o resultado {}!'.format(v1,v2,re))
| StarcoderdataPython |
71608 | n = int(input())
matrix = [row for lists in range(n) for index, row in enumerate(input())]
last_pos_possible = []
pos = ""
last_count_mov = 0
for i in range(len(matrix)):
row = matrix[i]
if "k" in row:
k_row_i = row.index("k")
pos = f"{i}:{k_row_i}"
break
def check_for_ops():
globa... | StarcoderdataPython |
28782 | <reponame>Qvapil/Electromagnetic_Fields_B_2020
import matplotlib.pyplot as plt
import matplotlib.cm as cm
import numpy as np
import math
#constants
d=2
h=1
a=0.1
I=1
#Axes
N=100
xmin=0
xmax=4
xx=np.linspace(xmin,xmax,N)
ymin=0
ymax=4
yy=np.linspace(ymin,ymax,N)
zmin=-2
zmax=2
zz=np.linspace(zmin,zmax,N)
X,Z=np.me... | StarcoderdataPython |
1620802 | """Module for retrieve application's config from Spring Cloud Config."""
import logging
import os
import sys
from typing import Any, Callable, Dict, KeysView
import attr
from config.core import singleton
from glom import glom
import requests
logging.getLogger(__name__).addHandler(logging.NullHandler())
@attr.s(... | StarcoderdataPython |
3347342 | <reponame>Gustafferson/particleVirtualization
# import the necessary packages
from imutils import paths
import argparse
import cv2
def variance_of_laplacian(image):
# compute the Laplacian of the image and then return the focus
# measure, which is simply the variance of the Laplacian
return cv2.Laplacian(image, cv... | StarcoderdataPython |
1708003 | <reponame>ipwnosx/Servo
# -*- coding: utf-8 -*-
import gsxws
import os.path
from django.urls import reverse
from django.template.defaultfilters import slugify
from pytz import common_timezones, country_timezones
from django.db import models
from django.conf import settings
from mptt.managers import TreeManager
fro... | StarcoderdataPython |
3391802 | import placeOrder
from placeOrder import calcAge
def updateStaff(cur,con):
try:
value=0
row = {}
while(value==0):
row["sid"] = input("Enter Staff_id of staff whose details you wish to update: ")
que = "SELECT * FROM STAFF WHERE Staff_id LIKE '%s'" % (row["sid"])
value = cur.execute(que)
if valu... | StarcoderdataPython |
3298949 | from __future__ import print_function
from multiprocessing.pool import ThreadPool
import requests
import time
import sys
try:
import pykube
except ImportError:
print('Package "pykube" is not installed.\nInstall it:\npip install pykube')
exit(-1)
SLEEP = 2
api = pykube.HTTPClient(pykube.KubeConfig.from... | StarcoderdataPython |
146840 | import os, sys
from flask import Flask, request
from pymessenger import Bot
app = Flask(__name__)
PAGE_ACCESS_TOKEN = "your-access-token-here"
bot = Bot(PAGE_ACCESS_TOKEN)
@app.route('/', methods=['GET'])
def verify():
# Webhook verification
if request.args.get("hub.mode") == "subscribe" and request.args.ge... | StarcoderdataPython |
1715570 | <gh_stars>10-100
# Copyright 2020 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | StarcoderdataPython |
3387810 | <filename>tests/test_dktoken.py
# -*- coding: utf-8 -*-
from base64 import urlsafe_b64encode
import pytest
from toolcall.dktoken import Token
def test_token():
t = Token()
t.validate(t.token)
assert Token().valid
assert type(Token().token) == str
def test_roundtrip():
t = Token()
u = Token(t... | StarcoderdataPython |
164152 | <gh_stars>0
import machine, network, ubinascii, ujson, urequests
WiFi = network.WLAN(network.STA_IF)
mac = ubinascii.hexlify(network.WLAN().config("mac"),":").decode()
print("MAC address: " + mac)
def connect():
import network, utime
WiFi = network.WLAN(network.STA_IF)
if not WiFi.isconnected():... | StarcoderdataPython |
107770 | <gh_stars>10-100
import unittest
import json
from dotenv import load_dotenv
# from .. import application
import application
import requests
def __init__():
# using test environment
load_dotenv(verbose=True, dotenv_path='test/test.env')
class TestApp(unittest.TestCase):
"""
Test Class for application.__m... | StarcoderdataPython |
3364525 | <filename>Simulation/cleanup.py
import docker
import threading
client = docker.from_env()
to_stop = []
for i in client.containers.list(all = True):
if "sm" in i.name:
to_stop.append(i)
def stop_container(handle):
handle.stop()
handle.remove()
threads = []
for i in to_stop:
threads.append(thr... | StarcoderdataPython |
111316 | <reponame>QualiSystemsLab/TechRepo
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import cloudshell.helpers.scripts.cloudshell_dev_helpers as dev_helpers
from cloudshell.api.cloudshell_api import InputNameValue
from cloudshell.workflow.orchestration.sandbox import Sandbox
from cloudshell.workflow.orchestration.se... | StarcoderdataPython |
3217261 | <gh_stars>10-100
from tests.fields.subclass_models import RaceParticipant, RacePlacingEnum
from tortoise.contrib import test
class TestCustomFieldFilters(test.IsolatedTestCase):
tortoise_test_modules = ["tests.fields.subclass_models"]
async def asyncSetUp(self):
await super().asyncSetUp()
awa... | StarcoderdataPython |
3271659 | <gh_stars>0
import codecs
import formatBibTeX
import errorHandler as err
from formatBibTeX import *
from BibTeXclasses import bibentry
#global collectors
globalkeys=[]
def createNewEntry(line,accDuplicate):
dattype = line[:5].lower()
a = line.find("@")
b = line.find("{",a)
dattype = line[a+1:b].lower(... | StarcoderdataPython |
3244616 | # -*- coding: utf-8 -*-
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('annotations', '0018_auto_20171010_1310'),
]
operations = [
migrations.AddField(
model_name='annotation',
name='is_not_labeled_structure',
... | StarcoderdataPython |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.