text stringlengths 38 1.54M |
|---|
import time
import os
def startCronjob():
os.system("echo ----------------------------------------------------------")
os.system("echo ------------------------running---------------------------")
os.system("echo -------------------CRONJOB PAGOFACIL----------------------")
os.system('python PagoFacil.py')
os.syst... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright Kitware Inc.
#
# Licensed under the Apache License, Version 2.0 ( the "License" );
# you may not use this file except in compliance with the License.
# You may obtain a copy of ... |
import json
from sagemaker import Endpoint
import os
def handler(event, context):
"""Delete SageMaker endpoint and endpoint configuration"""
print(json.dumps(event))
endpoint = Endpoint(event["EndpointName"], os.environ["AWS_REGION"])
endpoint.cleanup()
return event |
"""
This module contains classes for game.
"""
monst_count = 0
class Room:
"""
this class creates rooms in a game
"""
def __init__(self, name: str):
self.list_of_rooms = list()
self.name = name
self.descr = ""
self.character = None
self.room_item = None
de... |
# -*- python -*-
# Package : omniidl
# nesc.py Created on: 2008/3/16
# Author : Pruet Boonma (lulu)
#
# Copyright (C) 2008 University of Massachusetts Boston
#
# This file is part of omniidl.
#
# omniidl is free software; you can redistribute it and/or modify it
... |
import library
import predicate as Predicate
import variable as Variable
dep_modifiers = library.dep_modifiers
def dep_acl(token, variables, predicates, cond_tokens, passive_tokens, num_of_terms, isa_tokens):
target_token = token.head
if not library.add_to_subj_list(target_token, token, variables, pre... |
# n = int(input("Enter the no till u want to print the table"))
# m = int(input("Enter the no which digit table you want to print"))
# # n = 20
# # m = 14
# for i in range(1, m + 1):
# print(n * i)
# print(" ")
'''
1
1 2
1 2 3
1 2 3 4
1 2 3 4 5
1 2 3 4 5 6
'''
m = 6
for row in range(1,m):
for col in range(... |
#!/usr/bin/env python3
import pydle
import config
import os
import importlib
import re
import traceback
import threading
import copy
import time
Waifu = pydle.featurize(pydle.features.RFC1459Support, pydle.features.WHOXSupport,
pydle.features.ISUPPORTSupport,
... |
import torchvision, torch
from copy import deepcopy
import numpy as np
class ImageTransformations():
__all__ = ['get_list_of_transformations', '__call__']
'''
All images taken as parameters by class methods must be PIL format
Example usage:
transforms, decriptive_transformations = ImageTransforma... |
from SetTestParameters import InitializeGlobals
def pytest_generate_tests(metafunc):
# Prepare the globals
global_dict, target_dev, ref_dev = InitializeGlobals(metafunc)
# Prepare the parametors for the target function.
device_name = ''
if target_dev:
device_name = target_dev[0]
logFol... |
a = input("请输入证件的路径:")
b = input("请输入您的姓名:")
c = "D:\Python\ "
d = c + b +".jpg"
print(d)
f1 = open(file= a,mode="rb")
f2 = open(file= d,mode="wb")
data = f1.read()
f2.write(data)
f2.close()
f1.close()
|
import requests
url = 'http://172.17.50.43/creative'
r = requests.get(url)#
print(r.text)
#This will get the status code
print('Status code:\n ******')
print("\t*", r.status_code)
print('*****')
#This will only get the headers only
h = requests.head(url)
print('Header:n\******')
#To print line by line
for x in h.header... |
from .adjust_code import adjust, remove_whitespace, wrap_in_function, wrap_in_exception_guard
from .binary_operation_test_case import BinaryOperationTestCase
from .builtin_function_test_case import BuiltinFunctionTestCase
from .builtin_two_arg_function_test_case import BuiltinTwoargFunctionTestCase
from .expected_failu... |
"""
Filters decide whether something is active or not (they decide about a boolean
state). This is used to enable/disable features, like key bindings, parts of
the layout and other stuff. For instance, we could have a `HasSearch` filter
attached to some part of the layout, in order to show that part of the user
interfa... |
import numpy
from reikna.cluda import ocl_api, dtypes, Module, functions
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from reikna.helpers import product
from integrator import Integrator
def get_nonlinear(dtype, interaction, tunneling):
r"""
Nonlinear module
.. math::
... |
import cv2
x = cv2.VideoCapture(0)
while True:
ret , photo = x.read()
cv2.imshow ('hi',photo)
if cv2.waitKey(1) == 13:
cv2.destroyAllWindows()
break
x.release()
|
import requests
import os
import re
import json
import time
import random
import timeit
import urllib
from datetime import datetime
from dateutil import tz
djj_bark_cookie=''
djj_sever_jiang=''
djj_tele_cookie=''
result=''
osenviron={}
msg=''
hd={}
urllist=[]
hdlist=[]
btlist=[]
bdlist=[]
taskidlist=[]
d... |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
from urllib2 import Request, urlopen, URLError, HTTPError
def findAdmin():
f = open("txtfile.txt","r");
link = raw_input("Enter Site Name \n(ex : example.com or www.example.com ): ")
print "\n\nAvilable links : \n"
while True:
sub_link = f.readline()
if not sub... |
from django.shortcuts import render, redirect, get_object_or_404
from django.http import HttpResponse
from .models import Recipes
from .forms import RecipesForm
def home(request):
Recipe_list = Recipes.objects.order_by('id')
return render(request,"app_recipe/home.html", {'Recipe_list':Recipe_list})
def creat... |
from django.contrib import admin
from scrapeSBRodds.models import Game
class GameAdmin(admin.ModelAdmin):
list_display = ('game_id', 'team_away', 'score_away', 'team_home', 'score_home', 'date')
admin.site.register(Game, GameAdmin)
|
from testrecorder.panels import Panel
from django.template.loader import render_to_string
from testrecorder.urls import _PREFIX
from django.utils.safestring import mark_safe
from testrecorder.settings import DEFAULT_FUNC_NAME
class FunctionNamePanel(Panel):
name = 'FunctionName'
has_content = True
fu... |
# Generated by Django 3.1 on 2020-08-10 13:44
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('reviews', '0004_review_misc_tags'),
]
operations = [
migrations.RemoveField(
model_... |
#inputString = "abcabcbb"
# the answer is "abc", which the length is 3.
#inputString = "au"
# the answer is "b", with the length of 1.
inputString = "pwwkew"
# the answer is "wke", with the length of 3. Note that the answer must be a substring, "pwke" is a subsequence and not a substring.
class Solution:
def lengt... |
from django.urls import path, reverse_lazy
from . import views
from django.contrib.auth.views import LoginView, LogoutView
#app_name = 'accounts'
urlpatterns = [
path('login/', LoginView.as_view(template_name='generic_form.html'), name='login'),
path('logout/', LogoutView.as_view(), name='logout'),
path('p... |
# Two coding quizzes follow. The first requires you to perform an
# intrinsic rotation sequence about the Y and then Z axes.
# The second quiz requires you to perform an extrinsic rotation about
# the Z and then Y axes.
from sympy import symbols, cos, sin, pi, sqrt
from sympy.matrices import Matrix
# Create symbol... |
import sqlalchemy as db
import fetch_data as fd
def get_data(galaxy, messier):
engine = fd.create_session()
connection = engine.connect()
metadata = db.MetaData()
con_table = db.Table('data_galaxies', metadata, autoload=True, autoload_with=engine)
if galaxy is None:
query = db.select([con_t... |
import pandas as pd
import numpy as np
if __name__ == "__main__":
# df = pd.DataFrame(np.linspace(start=0, stop=100, num=101))
df = pd.DataFrame(np.array([1, 1, 1, 1, 1, 1, 2]))
for ii_value in range(0, 11, 1):
line = df.quantile(ii_value / 10.0, axis=0, interpolation='midpoint').values[0]
... |
# -*- coding: utf-8 -*-
DELATS_LEN = 3
class Host(object):
'''
交换机类
'''
def __init__(self, address, building, floor, model, monitor, name=None, delaysLen=DELATS_LEN):
self.address = address
self.building = building
self.floor = floor
self.model = model
self.nam... |
import praw
from configs import * ## configs is a hidden file
import pandas as pd
reddit = praw.Reddit(client_id=CLIENT_ID, client_secret=SECRET, user_agent=AGENT)
hot_posts = reddit.subreddit('Singapore').hot(limit=10)
for post in hot_posts:
print(post.title)
posts = []
ml_subreddit = reddit.subreddit('Singap... |
#!/home/anirudha/anaconda3/bin/python
## Problem Statement ##
'''
Write a program to find the node at which the intersection of two singly linked lists begins.
For example, the following two linked lists:
A: a1 → a2
↘
c1 → c2 → c3
↗
B: b1 → b2 → b... |
from __future__ import absolute_import
from django.conf import settings
from sentry.utils.services import LazyServiceWrapper
from .base import SearchBackend # NOQA
backend = LazyServiceWrapper(SearchBackend, settings.SENTRY_SEARCH, settings.SENTRY_SEARCH_OPTIONS)
backend.expose(locals())
|
k, r = map(int, input().split())
shovels = 1
price = k
while str(price)[-1] not in ['0', str(r)]:
price += k
shovels += 1
print(shovels) |
#!/usr/bin/python3
"""
Module that contains the function search_replace
"""
def search_replace(my_list, search, replace):
""" replaces all occurences of an element by another """
return ([elem if elem is not search else replace for elem in my_list])
|
__author__ = 'nik'
import math
K = 5
def classify(item, training_set):
distances = []
for training_item in training_set:
distance = math.sqrt((math.pow(training_item[1] - item[0], 2) + math.pow(training_item[2] - item[1], 2)))
distances.append((training_item[0], distance))
distances.sor... |
# File Name: changes
# Description: can find changes to a mpath using a saved version of the mpath before changes.
#### TOD0 ####
# make __init__() able to take in parameters or str_constructor
# add __repr__() to changes objects: ADD, DEL, MOV, UPD
# add __str__() to changes objects: ADD, DEL, MOV, UPD
# add clear... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author : naturegong
# @File : forms.py
# @Time : 4/10/20 4:05 PM
from captcha.fields import CaptchaField
from django import forms
from users.models import UserProfile
class LoginForm(forms.Form):
"""登录表单验证"""
# 用户名密码不能为空
username = forms.CharField(r... |
# coding: utf-8
from pyspark import SparkConf, SparkContext
import pyspark
conf = SparkConf()
#set validateOutputSpecs to false to ignore writing file to exists output directory
conf.set("spark.hadoop.validateOutputSpecs", "false")
#sc = SparkContext.getOrCreate()
#sc.stop()
sc = SparkContext(appName = 'FindTopTenMov... |
# Generated by Django 2.0.5 on 2018-05-19 15:33
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('shipping', '0004_auto_20160728_2034'),
('tieredweightzone', '0001_initial'),
]
# Fake tieredweightzone1
operations = [
]
|
import ledger
from ledger import Account, Transaction
import itertools
def write(ledger_, outFile):
s = "\n".join(transaction.serialize() for transaction in ledger_.transactions)
with outFile.open("w") as f:
f.write(s)
def read(inFile):
with inFile.open("r") as f:
lines = f.readlin... |
from django.shortcuts import render
from django.views.generic.list import ListView
from django.views.generic.detail import DetailView
from app1.models import Notice, Profile
# from app1.forms import ProfileForm
from django.utils.decorators import method_decorator
from django.contrib.auth.decorators import login_require... |
# pylint:disable=unused-variable
# pylint:disable=unused-argument
# pylint:disable=redefined-outer-name
import random
from http import HTTPStatus
from typing import Any, Optional
import pytest
from osparc.api.solvers_api import SolversApi
from osparc.exceptions import ApiException
from osparc.models import Solver
fr... |
#!/usr/bin/env python
from __future__ import print_function
import flupan
def get_full_annotation(passage):
'''
Test example case
'''
pp = flupan.PassageParser()
p = pp.parse_passage(passage)
print("The input passage:",p.original, sep="\n")
print("Refor... |
"""
Store object's element key data in memory.
"""
from django.conf import settings
from evennia.utils import logger
from muddery.server.utils import utils
class CharacterQuests(object):
"""
The storage of all character's quest's objectives.
"""
# data storage
storage_class = utils.class_from_pa... |
import sys, requests
from bs4 import *
#from functions import *
valid_parameters = ["-default", "-o", "-c", "-r", "-l", "-f", "-maple", "-mathematica", "-prog", "-crossrefs", "-k", "-a", "-extensions", "-s", "-example"]
parameters = ["-default"]
valid_type_of_sort = ["-ask", "-relevance", "-references", "-number", "-m... |
#! /usr/bin/env python
from __future__ import print_function
# System
import random
import time
# ROS
import rospy
# TU/e Robotics
from robot_skills import get_robot_from_argv
rospy.init_node("audio_test")
robot = get_robot_from_argv(index=1)
hmi = robot.hmi
s = robot.speech
robot.head.look_at_standing_person()
... |
import os, sys
file_path = os.path.dirname(os.path.abspath(__file__))
if not (file_path in sys.path):
sys.path.append(file_path)
from PySide2.QtGui import QKeySequence
from PySide2.QtCore import Signal, Slot
from PySide2.QtWidgets import QApplication, QMainWindow, QWidget
from PySide2.QtWidgets import QVBoxLayou... |
from django import forms
from django.core import validators
def starts_with(value):
if(value[0].lower!='d'):
raise forms.ValidationError('name starts with d or D')
class Student(forms.Form):
name=forms.CharField(widget=forms.TextInput(attrs={'class':'form-control'}))
email=forms.CharField(widget=f... |
#! /usr/bin/env python
# -*- coding=utf8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
import numpy as np
import model_keys
_global_learning_rate = 0.01
def set_global_learning_rate(rate):
global _global_learning_rate
... |
import game.chapter_one.main
import game.chapter_two.main
from game.engine import Engine, SceneMap
print("Starting the engine...")
a_map = SceneMap()
a_game = Engine(a_map)
a_game.play()
|
"""
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 in writing, so... |
#invoke this buld with scons -Q debug=0
#url: http://www.scons.org/doc/1.1.0/HTML/scons-user/x2361.html
env = Environment()
debug = ARGUMENTS.get( 'debug', 0 )
print 'Debug is ' + debug
if int( debug ) ==0 :
print 'debug is 0 take some action'
env.Program('hello.c') |
from jinja2_htmltemplate.translate import HtmlTemplate
from nose.tools import eq_
def test_tmpl_include():
t = HtmlTemplate()
out = t.from_string('<TMPL_INCLUDE NAME="foo.html">')
eq_('{% include "foo.html" %}', out)
|
"""
Logger Demo
"""
import logging
class myLoggerConsole():
def testLog(self):
#create logger object that will create a log record object from the message string. It will pass it to the handler below
my_logger = logging.getLogger('sample_log')
#This sets the level of the logger. THis will ... |
import sys
from subprocess import call
common = """
#!/bin/bash -login
#PBS -l walltime=00:00:30
#PBS -l nodes=4:ppn=1
#PBS -l mem=1gb
#PBS -N parallel4
#PBS -t 1-10
module load NumPy
module load SciPy
module load mpi4py
cd ~/ParallelProc/hmwk2
"""
jobs = ["mpirun -n 4 python sum_reducCol.py 10 4 ${PBS_ARRAYID}",
"... |
#!/usr/bin/python
# Figure 1e
from neuron import h,gui
execfile('Cell.py')
execfile('STN.py')
execfile('simrun.py')
stn = None
stn = STN()
t_vec = h.Vector()
v_vec = h.Vector()
t_vec.record(h._ref_t)
v_vec.record(stn.soma(0.5)._ref_v)
tstop = 2500
stn.amp = -25
durlist = [300,450,600]
delaylist = [800,650,500]
fi... |
# Run TRP analysis
# Runs normal TRP followed by qPCR and PCR
# Running +target achieved by second sample of input with target already added at 3.33x of final concentration
# Handles arbitrary prefix/suffix
# Uses appropriate extension split master mix
from Experiment.sample import Sample
from Experiment.experiment im... |
from .interpolable import Interpolable
from .translation2D import Translation2D
from .rotation2D import Rotation2D
import math
class RigidTransform2D(Interpolable):
'''
classdocs
'''
kEPS = 1e-9
class Delta:
dX = 0
dY = 0
dTheta = 0
def __init__(se... |
import pytest
@pytest.mark.math
def test_one_plus_one():
assert 1 + 1 == 2
@pytest.mark.math
def test_one_plus_two():
a = 1
b = 2
c = 3
assert a + b == c
def inc(x):
return x + 1
@pytest.mark.math
def test_answer():
assert inc(3) == 4
#handles exceptions
@pytest... |
# coding= utf-8
import json
from django.http import HttpResponse
from models import t_user
def addUser(request):
if request.method == 'POST':
received_json_data = json.loads(request.body,encoding='utf-8')
userName = received_json_data.get("name")
userAlias = received_json_data.get("alias")... |
import random
from locust import TaskSet, task
import hlsplayer as hlsplayer
SECONDS = 1000 # ms in seconds
class UserBehavior(TaskSet):
@task
def play_lgi_vxpl(self):
url = "https://media.readyq.tv/live/test/playlist.m3u8"
duration = random.randint(60, 600)
self.client.play(url, dur... |
from tkinter import *
from tkinter import ttk
root = Tk()
btn1 = ttk.Button(root, text="Hello George from ttk")
btn1.pack()
btn2 = ttk.Button(root, text="Hello 2 from ttk")
btn2.pack()
style = ttk.Style()
style.theme_use('vista')
#style.theme_names()
#('winnative', 'clam', 'alt', 'default', 'classic', 'vista', 'xpnati... |
import csv
import os
# Path to file (renamed for simplicity)
path_read = os.path.join("Resources", "election_data.csv")
path_write = os.path.join("Resources", "election_results.txt")
# Create empty dict to keep track of votes
candidates = {}
with open(path_read) as csv_file:
csv_read = csv.reader(csv_file)
h... |
def solution(n):
answer = 0
ch = [False] * (n + 1)
for i in range(2, n + 1):
if ch[i] == False:
answer += 1
for j in range(i, n + 1, i):
ch[j] = True
return answer
print(solution(10)) |
from sklearn.cross_validation import train_test_split
from sklearn.grid_search import GridSearchCV
from sklearn.metrics import classification_report
from sklearn.metrics import confusion_matrix
from sklearn.decomposition import RandomizedPCA
from sklearn.svm import SVC
import cv2
from time import time
import os
import ... |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Servicio',
fields=[
('id_servicio', models.IntegerField(primary_key=True, se... |
# William Craddock
# 18-09-14
# Class Exercises - Revision Exercise - 5
print("Enter the dimensions of the fridge in cm")
print()
fridge_height = int(input("Enter the fridge's height: "))
fridge_width = int(input("Enter the fridge's width: "))
fridge_depth = int(input("Enter the fridge's depth: "))
print()
p... |
from openpyxl import load_workbook
wb = load_workbook("sample.xlsx")
ws = wb.active
# ws.delete_rows(8) #8번째 줄에있는 7번 학생 데이터 삭제
# ws.delete_rows(8,3) #8번째 줄부터 총 3줄 삭제
# wb.save("sample_delete_row.xlsx")
# ws.delete_cols(2) #2번째 열 삭제
ws.delete_cols(2,2) #2번째 열로부터 총 2개의 열 삭제 (영어, 수학 삭제)
wb.save("sample_delete_col.xlsx... |
#
# Copyright (c) 2023 Airbyte, Inc., all rights reserved.
#
from unittest.mock import Mock
import pytest
import requests
from source_twilio.source import SourceTwilio
from source_twilio.streams import (
Accounts,
Addresses,
Alerts,
Applications,
AvailablePhoneNumberCountries,
AvailablePhoneNu... |
# from django.shortcuts import render
# Create your views here.
from django.shortcuts import render
from django.http import HttpResponse
from django.core.management.base import BaseCommand
from urllib.request import urlopen
from bs4 import BeautifulSoup
def IplTopScorer(requests, num):
page=urlopen('https://w... |
import time
import common
import subprocess
import pytest
from common import clients, random_labels, volume_name # NOQA
from common import core_api, pod # NOQA
from common import SIZE, DEV_PATH
from common import check_device_data, write_device_random_data
from common import check_volume_data, write_volume_random_d... |
import json
import pyautogui
import requests
from PIL import Image
from PIL import ImageChops
import cv2
import tinydb
poi_db = tinydb.TinyDB("assets/db/poi_dofus_hunt.json")
map_db = tinydb.TinyDB("assets/db/map_id_pos.json")
POI_ID_URL = lambda id: "https://i18napi.herokuapp.com/poi/{}".format(id)
MAP_POS_URL = lam... |
valor1=int(input('Digite um número '))
valor2=int(input('Digite outro número '))
soma= valor1+valor2
print('A soma entre {} e {} vale {}'.format(valor1, valor2, soma))
|
'''
Created on Nov 26, 2018
@author: iaskarov
'''
class FatalException(Exception):
def __init__(self,*args,**kwargs):
Exception.__init__(self,*args,**kwargs)
class errno(object):
HTTP_SUCCESS = 200;
HTTP_SRV_FAILURE = 500;
HTTP_CLT_FAILURE = 400;
DB_CONN_ERR = "Database conn... |
import socket
class user:
def __init__(self , sot , username = "kong"):
self.username = username ;
self.sot = sot ;
def sendMsg(self , msg):
self.sot.send(msg.encode())
def recvMsg(self):
data = self.sot.recv(1024);
data = data.decode();
return data;
|
# -*- coding: utf-8 -*-
# Generated by Django 1.11.16 on 2018-10-07 17:53
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('mentor', '0001_initial'),
]
operations = [
migrations.AlterField(
... |
from __future__ import print_function
import argparse
import json
import numpy as np
import os
from keras import Input, Model
from app.services.paths import *
from keras.models import Sequential, load_model
from keras.layers import Dense, Dropout
from keras.layers import LSTM, Bidirectional
from keras.utils import to... |
import numpy as np
class FSS(object):
def __init__(self):
pass
def fit(self):
pass
def optimize(self):
pass
def score(self):
pass |
#!/usr/bin/env python
import fileinput
import time
#popunjavam sve potrebne tablice potrebne za rad analizatora
#lista svih stanja automata
SvaStanja = []
#pocetno stanje u obliku liste, mozda moze biti prosireno eprijelazom
PocetnoStanje = []
#lista svih prihvatljivih stanja
PrihvatljivaStanja = []
#popis svih pri... |
from rest_framework import serializers
from ticket_booking_app.models import Movie, ShowTime, BookSeats
class MovieSerializer(serializers.ModelSerializer):
class Meta:
model = Movie
fields = ('movie_title','movie_genre')
class ShowTimeSerializer(serializers.ModelSerializer):
cinema_name = seri... |
import unittest
class DivZeroTestCase(unittest.TestCase):
def test_should_raise_exception(self):
with self.assertRaises(ZeroDivisionError):
1 / 0
if __name__ == '__main__':
unittest.main() |
import sys
nums = []
vals = {}
for l in open(sys.argv[1]).readlines():
parts = l.strip().split()
if len(parts) == 4:
x, y, v, s = parts[0], parts[1], parts[2], parts[3]
v = str(round(float(v), 2))
value = "$" + v + "$"
if float(v) < 0.1:
value = '\\textbf{' + str(... |
# Generated by Django 3.1.4 on 2021-01-07 06:51
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('nexus', '0008_ticket'),
... |
import discord
from redbot.core import commands, Config, checks
from discord.ext import tasks
import brawlstats
from time import time
class Tracking(commands.Cog):
def __init__(self, bot):
self.bot = bot
self.bsconfig = Config.get_conf(None, identifier=5245652, cog_name="BrawlStarsCog")
... |
from cs50 import SQL
from flask import Flask, redirect, render_template, request, session, send_from_directory
from flask_session import Session
from werkzeug.security import generate_password_hash, check_password_hash
from datetime import date, datetime
import xlsxwriter, os
from helper import login_required
# Confi... |
#!/usr/bin/env python
from Executor import Executor
from Writeback import Writeback
class BranchUnit(object):
""" A specialised execution unit for performing branches, with it's own pipeline. """
def __init__(self, myid, cpu, rob):
""" ID is for debugging and display purposes. """
self._i... |
def another_function(a):
b = a
a += 2
print('a is ' + str(a))
print('b is ' + str(b))
print('a + b is ' + str(a + b))
return b
def main():
x = 5
y = another_function(x)
print('y is ' + str(y))
return 0
main()
|
#!/usr/bin/env python
# coding: utf-8
# In[1]:
import torchvision.models as models
from torch import nn
import os
import torchvision
from torchvision import datasets
import torchvision.transforms as transforms
import torch
import matplotlib.pyplot as plt
#%matplotlib inline
import numpy as np
import torchvision
fro... |
# (C) Copyright 2021 IBM Corp.
# (C) Copyright 2021 Inova Development Inc.
# All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-... |
from cx_Freeze import setup, Executable
from EDNeutronAssistant import __version__
NAME = "EDNeutronAssistant"
shortcut_table = [
(
"DesktopShortcut",
"DesktopFolder",
NAME,
"TARGETDIR",
"[TARGETDIR]EDNeutronAssistant.exe",
None,
None,
None,
... |
with open('lines.txt','r') as a:
# data1 = a.readline()
# data2 = a.readline()
data = next(a)
print(data)
# print(data2)
print(a.closed)
|
# Generated by Django 3.1.5 on 2021-06-25 06:21
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('moviereviews', '0011_auto_20210625_1131'),
]
operations = [
migrations.AlterField(
model_name='movies2',
name='relea... |
import numpy as np
import sys
import pickle
import os
sys.path.append('../')
# from Supervised_method_KP_Extraction.read_train_test_data import get_candidates, get_features_of_candidate
from Supervised_method_KP_Extraction.feature_engineering import extract_candidate_features
from Supervised_method_KP_Extraction.extrac... |
__all__ = ['snake_v1', 'snake_v2']
def make(env_name, **kwargs):
Env = __import__('envs.%s' % env_name, fromlist=[env_name]).Env
return Env(**kwargs) |
#===------------------------------------------------------------------------===#
#
# NAME : serve
# PURPOSE : Runs a web server that exposes the API of the gitjson program.
# COPYRIGHT : (c) 2014 Sean Donnellan. All Rights Reserved.
# LICENSE : The MIT License (see LICENSE.txt for details)
# DESCRI... |
#File to generate accuracy plot from output of question8_3.py
import matplotlib.pyplot as plt
import itertools
#Creating two empty lists to store x and y axis
x = []
y = []
with open('a.out') as f:
for line in itertools.islice(f, 4, 104):
word = line.split()
x.append(float(word[1])+1)
y.append(float... |
import random
def marker():
while True:
marker1=input("Player 1 choose x or o")
if marker1=='x':
marker2='o'
return(marker1,marker2)
elif marker1=='o':
marker2='x'
return(marker1,marker2)
else:
print("enter valid marker")
board=[' ']*9
def printboard(board... |
# Generated by Django 3.0 on 2020-01-26 08:21
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('controlapp', '0004_gameunit'),
]
operations = [
migrations.DeleteModel(
name='GameUnit',
),
]
|
from functions.functions_kpi_analysis import KPI_Analysis
from functions.functions_kpi_failedQA import KPI_FaildedQA
## run site re-allocation and update qa recipients all together.
KPI_Analysis()
KPI_FaildedQA() |
import json
import urllib
import pandas as pd
import numpy as np
import matplotlib
# To prevent server errors on AWS EC", avoid DISPLAY of figure (only save as png)
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from random import randint
# Codes called by the website
# make the plots
# get coordinates+trajecto... |
# Generated by Django 2.2.6 on 2019-11-18 04:04
from django.db import migrations
class Migration(migrations.Migration):
initial = True
dependencies = [
('AssetMgmt', '0004_screen_lastknown'),
]
operations = [
migrations.CreateModel(
name='AssetManagement',
f... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.