id
stringlengths
1
7
text
stringlengths
6
1.03M
dataset_id
stringclasses
1 value
132762
#!/usr/bin/env python3 # Copyright (c) 2019 The Stakework Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. from test_framework.test_framework import StakeWorkTestFramework from test_framework.cfund_util import * im...
StarcoderdataPython
148381
from __future__ import print_function import sys import numpy import pytest import struct from stl import mesh _STL_FILE = ''' solid test.stl facet normal -0.014565 0.073223 -0.002897 outer loop vertex 0.399344 0.461940 1.044090 vertex 0.500000 0.500000 1.500000 vertex 0.576120 0.500000 1.117320 endlo...
StarcoderdataPython
3220722
<filename>Monsoon/reflash.py import platform import usb.core import usb.util import struct from Monsoon import Operations as op from copy import deepcopy import numpy as np import array DEVICE = None DEVICE_TYPE = None epBulkWriter = None epBulkReader = None VID = '0x2ab9' PID = '0xffff' class bootloaderMonsoon(objec...
StarcoderdataPython
3367357
#!/usr/bin/python import sys import pickle import numpy as np import matplotlib.pyplot as plt sys.path.append("../tools/") from feature_format import featureFormat, targetFeatureSplit from tester import dump_classifier_and_data ### Task 1: Select what features you'll use. ### features_list is a list of strings, each...
StarcoderdataPython
1763694
from flask import Blueprint, g from .v0 import get_routes as get_v0_routes from .content import main def register_routes(app): """Register routes with the blueprint API Arguments: app {FlaskApp} -- The flask app """ app.register_blueprint(main, url_prefix='') app.register_blueprint(get_v0...
StarcoderdataPython
3245327
import argparse import json from argparse import RawTextHelpFormatter # --- parser = argparse.ArgumentParser(description=''' Provide me with the movies JSON and I will remove each movie without IMDb data. I expect the movies of this JSON to have acquired their IMDb data by the 'get_imdb.py' script.\n Movies with th...
StarcoderdataPython
4835257
<gh_stars>1-10 import logging from gym.envs.doom import doom_env logger = logging.getLogger(__name__) class DoomTakeCoverEnv(doom_env.DoomEnv): """ ------------ Training Mission 8 - Take Cover ------------ This map is to train you on the damage of incoming missiles. It is a rectangular map with monste...
StarcoderdataPython
3355379
import wx app = wx.App() frm = wx.Frame(None, title="Hello World") frm.Show() app.MainLoop()
StarcoderdataPython
1665681
<reponame>kenoseni/Flight-Booking """Base schema module""" from marshmallow import Schema, fields from ..utilities.error_handler.handle_error import ValidationError class BaseSchema(Schema): """Base schema for all models""" id = fields.String(dump_only=True) created_at = fields.String(dump_only=True, dum...
StarcoderdataPython
1740518
<reponame>uct-cbio/galaxy-tools<gh_stars>0 #!/usr/bin/python #to remove duplicate sequences and renames identical seqnames: #reads a tab_del alignment and outputs a fasta file with one copy of each sequence #and prints deleted copies of duplicate seqs #also prints number of sequences in the output file #TO RUN: pyth...
StarcoderdataPython
196439
#!/usr/bin/env python __author__ = '<NAME>' import os import argparse from Bio import SeqIO os.environ['MPLCONFIGDIR'] = '/tmp/' import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt plt.ioff() from RouToolPa.GeneralRoutines.File import make_list_of_path_to_files from RouToolPa.Tools.Kmers import J...
StarcoderdataPython
53498
<filename>src/compute_results.py import argparse import os import json import shutil import numpy as np from distutils.util import strtobool as boolean import torch import torch.optim import torch.nn as nn import torch.nn.parallel import torch.backends.cudnn as cudnn import torch.utils.data import torch.utils.data.dis...
StarcoderdataPython
3221428
<gh_stars>0 # %matplotlib inline import numpy as np import matplotlib.pyplot as plt from six.moves import cPickle # Y' = 0.2989 R + 0.5870 G + 0.1140 B def rgb2gray(rgb): return np.dot(rgb[...,:3], [0.2989, 0.5870, 0.1140]) def readData(): image_data = np.array([]) image_labels = np.array([]) filein...
StarcoderdataPython
1625209
<reponame>Wizard-Toast/CT-Prehistoric-Trader "Chrono Trigger, Prehistoric Trade Handler" # Script assumes player is standing in front of trader with no other menu / dialogue open. It will attempt to bring chrono trigger to the foreground to begin trading. import pyautogui import win32gui from modules.tradehandler im...
StarcoderdataPython
1743516
from tkinter import * import tkinter from random import randint root = Tk() root.title("剪刀石頭布") Button_1 = Button() contentVar = tkinter.StringVar(root, '') buttonList = list() displayButton = Button(root, fg='white', bg='#3E4149', textvariable=contentVar, width=30, height=2) disp...
StarcoderdataPython
101142
from flask import Blueprint from flask_restful import Api from api.resources.demo import DemoResource from api.resources.login import LoginResource api_bp_v1 = Blueprint('bp_v1', __name__) api_v1 = Api(api_bp_v1, '/v1') api_v1.add_resource(DemoResource, '/demo') api_v1.add_resource(LoginResource, '/login') BLUEPRIN...
StarcoderdataPython
3303453
#!/bin/env python import os,sys from datetime import datetime, timedelta import numpy as np from scipy import interpolate from scipy.io import netcdf import pygrib def read_grib(fnl_path, ndays, u10, v10): lon_lat = np.genfromtxt('/fvcom-exec/input/nele_lon_lat.txt',dtype='f') file_list = [ fnl_path + "gfs.pgrb2.0p...
StarcoderdataPython
3244615
<gh_stars>0 from api.models import Share def create(**kwargs): return Share.objects.create(**kwargs) def get_share(**kwargs): return Share.objects.filter(**kwargs).first() def get_shares(**kwargs): return Share.objects.filter(**kwargs)
StarcoderdataPython
1606766
import datetime from django.test import TestCase from model_mommy import mommy from wagtailregulations.models.django import ( EffectiveVersion, Part, Section, Subpart, ) class RegulationsTestData(object): def setUp_regulations(self): self.part_1002 = mommy.make( Part, ...
StarcoderdataPython
1615088
# """Pytorch Dataset object that loads 27x27 patches that contain single cells.""" import os import random import scipy.io import numpy as np from PIL import Image import torch import torch.utils.data as data_utils import torchvision.transforms as transforms from torch.nn.functional import pad import dataloaders.a...
StarcoderdataPython
3305690
''' Util to recalculate persistable hashes ''' __author__ = '<NAME>' import logging from typing import Optional, List from queue import SimpleQueue from simpleml.registries import SIMPLEML_REGISTRY from simpleml.persistables.hashing import CustomHasherMixin from simpleml.persistables.base_persistable import Persist...
StarcoderdataPython
1659219
''' Custom Crowdstrike library -------------------------- Base Crowdstrike Class Base API Requests Call ''' import requests, json, datetime from time import sleep from base64 import b64encode class CrowdStrike(object): def __init__(self, endpoint, clientid, secret, oauth_endpoint="https://api.crowdstrike.com/"): ...
StarcoderdataPython
3287573
<gh_stars>10-100 import pytest from pactman import Like, SomethingLike from pactman.mock.matchers import Matcher, Term def test_is_something_like(): assert SomethingLike is Like def test_valid_types(): types = [None, list(), dict(), 1, 1.0, "string", "unicode", Matcher()] for t in types: Someth...
StarcoderdataPython
1740619
<reponame>mardix/bufferapp from bufferapp.response import ResponseObject PATHS = { 'GET_SHARES': 'links/shares.json?url=%s' } class Link(ResponseObject): ''' A link represents a unique URL that has been shared through Buffer ''' def __init__(self, api, url): shares = api.get(url=PATHS['GET_SHARES'] %...
StarcoderdataPython
1765825
''' brt.py Created by <NAME> <EMAIL> version 1.1 -- 7.15.2017 Buffalo Ray Trace (BRT) is an interactive GUI for plotting image predictions for a lens model. BRT is written in Python, utilizing the tkinter GUI library, the matplotlib plotting library, the astropy library of tools for astrophysical data analysis. All a...
StarcoderdataPython
181637
#!/usr/bin/env python ### # Conway's game of life for Unicorn Hat # (C) 2014 <NAME> # Shared under the MIT permissive license. ### import random import time import unicornhat as unicorn class LifeCell: """ Central class defining both the cells and the matrix of cells. """ matrix = {} # the mat...
StarcoderdataPython
1679141
<reponame>wlanslovenija/django-guardian<filename>guardian/conf/settings.py<gh_stars>0 from __future__ import unicode_literals import warnings from django.conf import settings from django.core.exceptions import ImproperlyConfigured ANONYMOUS_USER_NAME = getattr(settings, 'ANONYMOUS_USER_NAME', None) if ANONYMOUS_USER_...
StarcoderdataPython
1775105
#!/usr/bin/env python # Copyright 2019, FZI Forschungszentrum Informatik # # 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...
StarcoderdataPython
68879
#!/usr/bin/python2.7 import os, sys, socket, json, argparse, threading, csv, getpass,time, ConfigParser from base64 import b64encode from Queue import Queue from Utility.crypto import * q = Queue() clientdict = {} clientusernamedict ={} def rsa_decrypt(cipher,private_key): if len(cipher) > 256: x = len(c...
StarcoderdataPython
1767708
#!/usr/bin/env python # -*- coding: utf-8 -*- # Created by pat on 4/4/18 """ .. currentmodule:: base .. moduleauthor:: <NAME> <<EMAIL>> The GeoAlchemy declarative base for the data model is defined in this module along with some other helpful classes. """ from sqlalchemy.ext.declarative import declarative_base from s...
StarcoderdataPython
1602309
<filename>segundoModulo/PYTHON - DODO/0.3_list-f-c-retorno-s-parametros(TERMINADO)/6.py def parImpar2(): N = int(input('Informe um valor: ')) if N%2: return 'False' else: return 'True' def main(): print(parImpar2()) main()
StarcoderdataPython
1679533
<filename>main.py #!user/bin/env python3.7 # coding:utf-8 # author:wanghongzhang # email:<EMAIL> # time: 2018/10/29 import sys import datetime from PyQt5.QtWidgets import QApplication,QDialog from PyQt5.uic.properties import QtCore from PyQt5 import QtCore, QtGui, QtWidgets from register_dia import Ui_Reg...
StarcoderdataPython
114854
<gh_stars>1-10 path = "E:\\Datasets\\BraTs\\ToCrop\\MICCAI_BraTS2020_TrainingData\\Training_001\\Training_001_t1.png" from PIL import Image import numpy as np img = Image.open(path) img = np.array(img) import matplotlib.pyplot as plt plt.imshow(img,cmap="gray") plt.show() randbuf=[] import random x = 239//2 y = 239...
StarcoderdataPython
1641713
# -*- coding: utf-8 -*- """ Plot of the Datasaurus Dozen @author: <NAME> """ import numpy as np import matplotlib.pyplot as plt plt.style.use("ggplot") plt.rcParams["mathtext.fontset"]='cm' labels = np.genfromtxt("../data/DatasaurusDozen.tsv", delimiter="\t", usecols=(0,), skip_header=1, dtype=str) X ...
StarcoderdataPython
196026
import json import os import time from datetime import datetime import pytz import req_model def main(): tz = pytz.timezone('Asia/Shanghai') data = json.loads(os.environ['DATA']) for item in data: for i in range(3): time.sleep(i * 5) print("now {} clock in {}:".format(ite...
StarcoderdataPython
11243
<gh_stars>1-10 """ Extension to the logging package to support buildlogger. """ # Alias the built-in logging.Logger class for type checking arguments. Those interested in # constructing a new Logger instance should use the loggers.new_logger() function instead. from logging import Logger from . import config from ....
StarcoderdataPython
3240388
import pytest from edera import Condition from edera import Task from edera.exceptions import TargetVerificationError from edera.workflow import WorkflowBuilder from edera.workflow.processors import TargetChecker def test_target_checker_skips_task_execution_if_possible(): class C(Condition): def check(...
StarcoderdataPython
154427
<filename>whatsappEnvioDeArquivos/botImgSms.py import os import time import emoji from os import close from selenium import webdriver from selenium.webdriver.common.keys import Keys from selenium.webdriver.chrome.options import Options from webdriver_manager.chrome import ChromeDriverManager #Instanciando as opt...
StarcoderdataPython
3202597
# -*- coding: utf-8 -*- from typing import List, Tuple, Union import matplotlib as mpl from matplotlib.figure import Figure from matplotlib.axes import Subplot import matplotlib.pyplot as plt from numpy import ndarray from .extend import ExtendDict from .color import PLOT_COLORS # DEFAULT PARAMETERS class PlotProp...
StarcoderdataPython
61351
from qsearch import Project, solvers, unitaries, utils, multistart_solvers, parallelizers, compiler, options import scipy as sp import os try: from qsrs import BFGS_Jac_SolverNative, LeastSquares_Jac_SolverNative except ImportError: BFGS_Jac_SolverNative = None LeastSquares_Jac_SolverNative = None import p...
StarcoderdataPython
3349026
from typing import Callable, NamedTuple, Tuple import jax.numpy as jnp from jax.scipy.stats import norm, multivariate_normal from jax import jacfwd from jax import grad from jax.ops import index_update from jaxvi.models import Model # class ADVIState(NamedTuple): # phi: jnp.DeviceArray # grad_phi: jnp.DeviceA...
StarcoderdataPython
75300
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Fri Mar 24 13:43:28 2017 @author: nightowl """ from __future__ import print_function import os # from fuzzywuzzy import fuzz from shutil import copyfile from ..io.database.sql_to_python import QuerySQL from ..io.database.sql_connector import DVH_SQL from ....
StarcoderdataPython
126417
from pathlib import Path from typing import Tuple, Optional import streamlit as st import pandas as pd from src.utils import io @st.cache def load_data(file_name: str, src_dir: str) -> pd.DataFrame: if str(src_dir) == 'raw': return io.load_csv_data(file_name, src_dir, io.filter_dt_session) else: ...
StarcoderdataPython
176630
<gh_stars>1-10 import os import json import requests from dotenv import load_dotenv load_dotenv() # To set your enviornment variables in your terminal run the following line: # export 'BEARER_TOKEN'='<your_bearer_token>' bearer_token = os.getenv('TWITTER_API_KEY') def getComments(tweets): MAX_SEARCH_TWT_LIMIT =...
StarcoderdataPython
170397
<reponame>heavenshell/py-robo-misawa # -*- coding: utf-8 -*- """ robo.tests.test_misawa_handler ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Tests for robo.handlers.misawa. :copyright: (c) 2016 <NAME>, All rights reserved. :license: BSD, see LICENSE for more details. """ import os import logging import request...
StarcoderdataPython
3383883
<filename>COMET/misc_plugins/TelegramResponderPlugins/QTCPlugins.py import re def do_QTC_Status(value, TelegramResponder): # """Status - Gives back the QTC Status""" for val in value.values(): if re.findall(r"Status\b", val): text = "Current QTC status: \n\n" text += "Measurem...
StarcoderdataPython
1600054
<gh_stars>0 #!/opt/conda/bin/python import datetime,time, pickle, os, sys, argparse import numpy as np def power_of_two(string): n = int(string) fl_lgn = np.floor(np.log(n)/np.log(2)) if n != 2**fl_lgn: msg = "%r is not a power of two" % string raise argparse.ArgumentTypeError(msg) re...
StarcoderdataPython
83509
from __future__ import unicode_literals import codecs def encode_hex(value): return '0x' + codecs.decode(codecs.encode(value, 'hex'), 'utf8') def decode_hex(value): _, _, hex_part = value.rpartition('x') return codecs.decode(hex_part, 'hex')
StarcoderdataPython
3238022
#!/usr/bin/env python3 ''' gpg/card> admin Admin commands are allowed gpg/card> passwd gpg: OpenPGP card no. D2760001240102010006061158870000 detected 1 - change PIN 2 - unblock PIN 3 - change Admin PIN 4 - set the Reset Code Q - quit Your selection? 1 PIN changed. 1 - change PIN 2 - unblock PIN 3 - change Admin P...
StarcoderdataPython
97495
<gh_stars>0 __author__ = 'hs634' class Node(): def __init__(self, v): self.val = v self.left = None self.right = None class BinaryTree(): def __init__(self): self.root = None def insert(self, root, v): if not root: return Node(v) if v < root.va...
StarcoderdataPython
1743989
<filename>cairis/gui/PersonaEnvironmentNotebook.py # 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 Apac...
StarcoderdataPython
1794353
<reponame>yesitsme007/potter-controller #!/usr/bin/env python3 import pathlib import util import os from github.util import GitHubRepositoryHelper OUTPUT_FILE_NAME = 'out' VERSION_FILE_NAME = 'VERSION' repo_owner_and_name = util.check_env('SOURCE_GITHUB_REPO_OWNER_AND_NAME') repo_dir = util.check_env('MAIN_REPO_DIR...
StarcoderdataPython
100035
import os import webbrowser import sys from colorama import Fore, Back, Style from colorama import init init() #os.environ["HTTPS_PROXY"] = "http://username:pass@192.168.1.107:3128" import requests from bs4 import BeautifulSoup import time headers = {'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) Apple...
StarcoderdataPython
6531
<gh_stars>1-10 # Generated by Django 3.0.7 on 2020-07-27 19:23 import build.models from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='AutoCompleteRecord', fie...
StarcoderdataPython
1700340
<filename>oauthost/tests/conftest.py<gh_stars>1-10 from pytest_djangoapp import configure_djangoapp_plugin pytest_plugins = configure_djangoapp_plugin( { 'ROOT_URLCONF': 'oauthost.urls', }, extend_INSTALLED_APPS=[ 'django.contrib.sessions', ], extend_MIDDLEWARE=[ 'django.mi...
StarcoderdataPython
3315320
<filename>fython/lexem/rparx.py from fython.unit import * class RParX(Unit): unit = l.rparx
StarcoderdataPython
164883
import json import SalesforceMetadataModule as smm import dicttoxml from xml.dom.minidom import parseString from fulcrum import Fulcrum import re import collections import time import datetime import requests import base64 import string import random from simple_salesforce import Salesforce from simple_salesforce impo...
StarcoderdataPython
21656
<gh_stars>0 # -*- coding: utf-8 -*- # # Usage: Download all stock code info from TWSE # # TWSE equities = 上市證券 # TPEx equities = 上櫃證券 # import csv from collections import namedtuple import requests from lxml import etree TWSE_EQUITIES_URL = 'http://isin.twse.com.tw/isin/C_public.jsp?strMode=2' TPEX_EQUITIES_URL = 'ht...
StarcoderdataPython
1732176
""" Cartesian View Curve with Logarithmic Y Axis """ # (C) Copyright 2017- ECMWF. # # This software is licensed under the terms of the Apache Licence Version 2.0 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. # # In applying this licence, ECMWF does not waive the privileges and immunities # gra...
StarcoderdataPython
3339641
<reponame>AI4PFAS/AI4PFAS import pandas as pd import numpy as np from sklearn.model_selection import KFold, StratifiedKFold from sklearn.feature_selection import VarianceThreshold from rdkit import Chem from rdkit.Chem import Descriptors from helpers import count_cf_bonds, create_morgan_space from graphnn import mol...
StarcoderdataPython
4802787
<reponame>ProzorroUKR/openprocurement.api from openprocurement.tender.core.procedure.context import get_request from openprocurement.tender.core.procedure.state.tender import TenderState class CFASelectionTenderState(TenderState): min_bids_number = 1 def lots_qualification_events(self, tender): yield...
StarcoderdataPython
1698710
<reponame>odeke-em/utils #!/usr/bin/env python3 # Author: <NAME> <<EMAIL>> # Copy content from src to destination only if it doesn't # exist in the destination import os import sys import json import shutil import hashlib from threading import Thread isDir = lambda p: p and os.path.isdir(p) isPath = lambda p: p and ...
StarcoderdataPython
1712625
''' This is separate library file for the CSD.py applications Its done this way to clean up the code in the main app v00 - Initial Build ''' # External Loads from csdlib.vect import Vector as v2 import os.path import numpy as np import functools from tkinter import filedialog, messagebox from tkinter import * import ...
StarcoderdataPython
66845
# Copyright 2019 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
StarcoderdataPython
3323344
<gh_stars>1-10 # This file is Copyright (c) 2020 <NAME> <<EMAIL>> # License: BSD from migen import * from litex.soc.interconnect.stream import Endpoint class VideoStream(Module): def __init__(self): # VGA output self.red = red = Signal(8) self.green = green = Signal(8) self.blu...
StarcoderdataPython
103947
from lib import db from lib import part import pretty_errors import xlwings from argparse import ArgumentParser XML_PARTS_XLS = r"\\HSSFILESERV1\HSSshared\HSSI Lean\Job Plans\Pre-Nesting Tools\XML PRENESTING\XML-Parts.xls" pretty_errors.configure( line_number_first = True, display_link = True, ) ...
StarcoderdataPython
128696
import unittest from better_profanity import profanity class ProfanityTest(unittest.TestCase): def test_contains_profanity(self): profane = profanity.contains_profanity('he is a m0th3rf*cker') self.assertTrue(profane) def test_leaves_paragraphs_untouched(self): innocent_text = """If y...
StarcoderdataPython
1733973
# Author: <NAME> # Created: 10/4/2021 # Last Edited: 10/8/2021 import Gnome, random class Gnomes(object): """ Gnomes class: Represents a specified collection of Gnomes This class is constructed for solving TSP using a genetic algorithm """ # Constructor # NOTE: n...
StarcoderdataPython
3218428
import os import unittest from dart.client.python.dart_client import Dart from dart.engine.no_op.metadata import NoOpActionTypes from dart.model.action import ActionData, Action, ActionState from dart.model.dataset import Column, DatasetData, Dataset, DataFormat, DataType, FileFormat, RowFormat, LoadType from dart.mod...
StarcoderdataPython
1742767
from .material_dicts import get_material_dict class InvalidStringMaterialError(KeyError): pass class InvalidGaugeError(ValueError): pass class OutOfRangeError(ValueError): pass class GuitarString(): def __init__(self, gauge, string_material): self.is_valid_string_material(string_material) self.str...
StarcoderdataPython
165344
# Generated file, please do not change!!! import re import typing import marshmallow import marshmallow_enum from commercetools import helpers from ... import models from ..cart import ( CartOrigin, CartState, DiscountCodeState, InventoryMode, LineItemMode, LineItemPriceMode, RoundingMode...
StarcoderdataPython
3300734
<reponame>streamlit-badge-bot/automating-technical-analysis<filename>app/exchange_tickers.py def crypto_to_ticker(Crypto): cryptos = {'0Chain': 'ZCN','0x': 'ZRX','12Ships': 'TSHP','ARPA Chain': 'ARPA','Aave': 'LEND','Abyss Token': 'ABYSS','AdEx': 'ADX','Aeon': 'AEON', 'Aeron': 'ARN','Aeternity': 'AE','Agrello':...
StarcoderdataPython
1622945
<filename>backend/app/model/questionnaires/education_mixin.py<gh_stars>0 from sqlalchemy import func from sqlalchemy.ext.declarative import declared_attr from app import db from app.export_service import ExportService class EducationMixin(object): __question_type__ = ExportService.TYPE_UNRESTRICTED __estimat...
StarcoderdataPython
3355203
<filename>code/trial/main.py # --- # jupyter: # jupytext: # text_representation: # extension: .py # format_name: light # format_version: '1.4' # jupytext_version: 1.2.4 # kernelspec: # display_name: Python 3 # language: python # name: python3 # --- # + import glob import os ...
StarcoderdataPython
24018
<filename>clone-zadara-volume.py #!/usr/bin/env python # -*- coding: utf-8 -*- import os import time import logging import logging.config import logging.handlers import yaml from zadarest import ZConsoleClient from zadarest import ZVpsaClient logger = None def setup_logging( log_conf=None ): if log_conf is Non...
StarcoderdataPython
3308624
<reponame>danmerl/jobbot from scrapy.item import Item, Field class JobItem(Item): organization = Field() date = Field() title = Field() jobid = Field() description = Field()
StarcoderdataPython
1699306
<reponame>orelogo/fartberry<filename>fartberry/config.py #!/usr/bin/env python3 import json from pathlib import Path from fartberry.logger import logger POSTGRES_USER = 'postgres_user' POSTGRES_DATABASE = 'postgres_database' IS_GEOLOCATION_ENABLED = 'is_geolocation_enabled' POLLING_FREQUENCY_IN_SEC = 'polling_frequen...
StarcoderdataPython
137143
import os import re import cv2 import numpy as np import pandas as pd from Scripts.Experiments import RESULTS # ------------------------------------------------------------------------------------------------------------------ # # -------------------------------------------------- Restructure UNBC Data ------------...
StarcoderdataPython
3391852
# fonte https://www.twilio.com/docs/libraries/python # pip install twilio from twilio.rest import Client # Your Account SID from twilio.com/console account_sid = "<KEY>" # Your Auth Token from twilio.com/console auth_token = "<PASSWORD>" client = Client(account_sid, auth_token) message = client.messages.create( ...
StarcoderdataPython
3298616
__version__ = '0.0.1' __all__ = ['bert_ner', 'utils']
StarcoderdataPython
20019
<reponame>5x5x5x5/Back2Basics #def spam(): # eggs = 31337 #spam() #print(eggs) """ def spam(): eggs = 98 bacon() print(eggs) def bacon(): ham = 101 eggs = 0 spam() """ """ # Global variables can be read from local scope. def spam(): print(eggs) eggs = 42 spam() print(eggs) """ """ # Loca...
StarcoderdataPython
60671
<reponame>slainesimscale/simscale-python-sdk # coding: utf-8 """ SimScale API The version of the OpenAPI document: 0.0.0 Generated by: https://openapi-generator.tech """ import pprint import re # noqa: F401 import six from simscale_sdk.configuration import Configuration class AdvancedSimmetrixFluid...
StarcoderdataPython
1649831
import nltk import os import requests from nltk.twitter import Query, Streamer, Twitter, TweetViewer, TweetWriter, credsfromfile import twitter as TW from os import listdir from os.path import isfile, join import json import time app_key= 'Osyy0PSrhMRpnIWxjBLzLJeKR' app_secret= '<KEY>' oauth_token= '<KEY> ' oauth_tok...
StarcoderdataPython
100964
<reponame>opannekoucke/sympkf from .random import Expectation, omega from .util import PDESystem, Eq, remove_eval_derivative, upper_triangle from .tool import clean_latex_name from .constants import t as time_symbol import collections from sympy import Derivative, symbols, Function, sqrt, Integer, Rational, Mul, Matr...
StarcoderdataPython
4800436
#-*- coding: utf-8 -*- """ Wakeword listener package """
StarcoderdataPython
150617
from luts import kana_to_romaji, romaji_to_kana, simple_kana_to_romaji import random import os import time ## Term info ## term = os.popen('stty size', 'r').read().split() term_height, term_width = int(term[0]), int(term[1]) - 5 # term_width = 30 # i have issues gap = 3 count = 50 max_count = 50 kana_set = simple_k...
StarcoderdataPython
1606819
#------------------------------------------------------------------------------- # A mock ICF kind 'o problem. #------------------------------------------------------------------------------- from math import * from Spheral import * from SpheralTestUtilities import * from SpheralGnuPlotUtilities import * from SpheralVi...
StarcoderdataPython
1794186
from mcstats import mcstats mcstats.registry.append( mcstats.MinecraftStat( 'enchant', { 'title': 'Enchanter', 'desc': 'Items enchanted', 'unit': 'int', }, mcstats.StatReader(['minecraft:custom','minecraft:enchant_item']) ))
StarcoderdataPython
1779868
import ast import io import os import pathlib import pickle import time from typing import List, Union import click import pydantic import yaml from respo import core, settings def save_respo_model(model: core.RespoModel) -> None: """Dumps respo model into bin and yml format files. Pickle file is generated...
StarcoderdataPython
3241818
<filename>multiple_object_detection.py # -*- coding: utf-8 -*- # Version: 0.1a9 from os.path import exists, isfile import cv2 as cv import imutils import numpy as np from matplotlib import pyplot as plt def multiple_objects_detection(template, image, scale=1.0, method='cv.TM_CCOEFF_NORMED', threshold=0.7, mo...
StarcoderdataPython
31873
from unittest import TestCase from src.lineout.data import * class TestDataUtils(TestCase): def test_get_result_list(self): sample_list = [{'id': 1, 'name': 'a'}, {'id': 2, 'name': 'b'}] paginated = { 'count': 2, 'previous': None, 'next': None, 'resu...
StarcoderdataPython
1799814
from Website.site_base import BaseHandler import tornado.web import tornado import SQL.table_simulation as SQLsim class RawPacketHandler(BaseHandler): @tornado.web.authenticated def get(self): if self.current_user is None: self.redirect('login.html?next=edit') return ...
StarcoderdataPython
3324194
<filename>examples/xor_ex.py #!/usr/bin/env python3 from symcollab.algebra import * from symcollab.xor import * a = Constant("a") b = Constant("b") c = Constant("c") x = Variable("x") y = Variable("y") z = Variable("z") print("xor(a,b,x,x,y,a,c) =", end = " ") print(xor(a, b, x, x, y, a, c))
StarcoderdataPython
1701954
# This file was automatically generated by SWIG (http://www.swig.org). # Version 3.0.12 # # Do not make changes to this file unless you know what you are doing--modify # the SWIG interface file instead. from sys import version_info as _swig_python_version_info if _swig_python_version_info >= (2, 7, 0): def swig_im...
StarcoderdataPython
1732252
<gh_stars>0 import display_page import movie cars = movie.Movie("Cars", "Story about live cars", "2006", " Pixar Animation Studios", "Walt Disney Pictures", " <NAME>", " Golden Globe Award for Be...
StarcoderdataPython
3320941
<reponame>osoco/better-ways-of-thinking-about-software """Entitlement Models""" import logging import uuid as uuid_tools from datetime import timedelta from django.conf import settings from django.contrib.sites.models import Site from django.db import IntegrityError, models, transaction from django.utils.timezone i...
StarcoderdataPython
3282058
"""Schema object tests""" import pytest from neoalchemy import Node, Property def test_simple_labeled_node(): node = Node('Node') assert node.labels == ('Node',) # cannot reset label once created with pytest.raises(AttributeError): node.labels = ('bob',) assert not node.schema def test_...
StarcoderdataPython
36999
<filename>src/pretix/base/templatetags/cache_large.py # # This file is part of pretix (Community Edition). # # Copyright (C) 2014-2020 <NAME> and contributors # Copyright (C) 2020-2021 rami.io GmbH and contributors # # This program is free software: you can redistribute it and/or modify it under the terms of the GNU Af...
StarcoderdataPython
197864
"""Network utils for alternative location tool.""" import json import netifaces import requests import socket class NetworkUtils(object): """Network utils for alternative location tool.""" def GetWanIP(self): """Gets the external ip address or the WAN IP address. Returns: The ip address as a strin...
StarcoderdataPython
1679712
# coding: utf-8 from __future__ import print_function import logging from PySide2.QtCore import Qt, Signal from PySide2.QtWidgets import QDockWidget LOGGER = logging.getLogger('ProfileInspector.dockable_widget') class DockableWindow(QDockWidget): close_event = Signal() def __init__(self, title): ...
StarcoderdataPython