text
string
size
int64
token_count
int64
#!/usr/bin/python3 """add.py""" from sys import argv import datetime import sqlite3 import pathlib PATH = pathlib.Path.cwd() HELP_TEXT = ''' Usage: add.py [-h] directory -h, --help bring up this help message directory directory with certs to add ''' def add_certs(cert_dir: str) -> None: """...
2,776
902
# -*- coding: utf-8 -*- """ Created with IntelliJ IDEA. Description: User: jinhuichen Date: 3/28/2018 4:17 PM Description: """ from mrq.dashboard.app import main if __name__ == '__main__': main()
209
93
#!/usr/bin/env python3 def reverse_words(s): return ' '.join(w[::-1] for w in s.split(' ')) def reverse_words_ext(s): # support other whitespaces strs, word = [], '' for c in s: if c.isspace(): if word: strs.append(word[::-1]) word = '' ...
556
197
import requests def ok(event, context): url = "http://ok:8080/" response = requests.request("GET", url) return response.text
140
47
""" Python Curve Generator @Guilherme Trevisan - github.com/TrevisanGMW/gt-tools - 2020-01-02 1.1 - 2020-01-03 Minor patch adjustments to the script 1.2 - 2020-06-07 Fixed random window widthHeight issue. Updated naming convention to make it clearer. (PEP8) Added length checker for selection befor...
11,166
4,109
import pygame from config import Config from core.ui import Table, Button from core.scene import Scene from core.manager import SceneManager from core.scene.preload import Preload class SummaryScene(Scene): def __init__(self, game): super().__init__(game) self._background = pygame.display.get_sur...
1,766
534
from __future__ import absolute_import from __future__ import print_function from __future__ import division from mwptoolkit.module.Encoder import graph_based_encoder,rnn_encoder,transformer_encoder
198
59
# Copyright 2010 Alon Zakai ('kripken'). All rights reserved. # This file is part of Syntensity/the Intensity Engine, an open source project. See COPYING.txt for licensing. from intensity.signals import client_connect, client_disconnect from intensity.base import quit class Data: counter = 0 def add(sender, **...
546
178
#!/usr/bin/python # -*- coding: utf-8 -*- __author__ = "Ricardo Ribeiro" __credits__ = ["Ricardo Ribeiro"] __license__ = "MIT" __version__ = "0.0" __maintainer__ = "Ricardo Ribeiro" __email__ = "ricardojvr@gmail.com" __status__ = "Development" import time from datetime import datetime, ...
694
281
""" Created by vcokltfre at 2020-07-08 """ import json import logging import time from datetime import datetime import discord from discord.ext import commands from discord.ext.commands import has_any_role class BotInfo(commands.Cog): def __init__(self, bot): self.bot = bot self.logger = logging....
1,388
466
import inspect import logging from collections import OrderedDict from functools import wraps from typing import TYPE_CHECKING, Any, Callable, Optional, Type, Union, cast, overload from django.core.paginator import InvalidPage, Page, Paginator from django.db.models import QuerySet from django.http import HttpRequest f...
6,486
2,029
# !/usr/bin/python3 from tkinter import * top = Tk() top.geometry("400x250") name = Label(top, text = "Name").place(x = 30,y = 50) email = Label(top, text = "Email").place(x = 30, y = 90) password = Label(top, text = "Password").place(x = 30, y = 130) sbmitbtn = Button(top, text = "Submit",act...
547
257
# -*- coding: utf-8 -*- # Generated by Django 1.9.6 on 2016-06-06 22:16 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('yafa', '0001_initial'), ] operations = [ migrations.RemoveField( ...
873
270
from django.urls import path from toys.views import (toy_list_view, toy_detail_view, toy_sql_view, toy_raw_sql_view, toy_aggregate_view) app_name = "toys" urlpatterns = [ path("toys/", toy_list_view, name="toys_list"), path("toys_sql/", toy_sql_view, name="toys_sql_list"), path("to...
501
204
'''This script goes along the blog post "Building powerful image classification models using very little data" from blog.keras.io. It uses data that can be downloaded at: https://www.kaggle.com/c/dogs-vs-cats/data In our setup, we: - created a data/ folder - created train/ and validation/ subfolders inside data/ - crea...
5,590
2,069
""" TODO: Once I finish the d zero and high paper, I will port the code here. TODO: also put the epochs training, for the ml vs maml paper with synthetic data. """
163
50
from setuptools import setup from os import path # read the contents of your README file curr_dir = path.abspath(path.dirname(__file__)) with open(path.join(curr_dir, "README.md"), encoding="utf-8") as f: long_description = f.read() setup( name="kedro-light", version="0.1", description="A lightweight...
692
235
import random from flask import Flask, request, render_template, jsonify app = Flask(__name__) data_list = [] with open('data.txt', 'r') as data_file: data_list = data_file.readlines() @app.route("/", methods=['GET']) def index(): index = random.randint(1, len(data_list) - 1) clue = dat...
1,217
430
# -*- coding: utf-8 -*- """Plotting.py for notebook 05_Preliminary_comparison_of_simulations_AGN_fraction_with_data This python file contains all the functions used for plotting graphs and maps in the 2nd notebook (.ipynb) of the repository: 05. Preliminary comparison of the 𝑓MM between simulation and data Script wr...
13,606
5,735
"""Small lightweight utilities used frequently in GOATOOLS.""" __copyright__ = "Copyright (C) 2016-2018, DV Klopfenstein, H Tang, All rights reserved." __author__ = "DV Klopfenstein" def extract_kwargs(args, exp_keys, exp_elems): """Return user-specified keyword args in a dictionary and a set (for True/False ite...
1,797
585
description = 'Monitors the status of the Forwarder' devices = dict( KafkaForwarder=device( 'nicos_ess.devices.forwarder.EpicsKafkaForwarder', description='Monitors the status of the Forwarder', statustopic='UTGARD_forwarderStatus', brokers=['172.30.242.20:9092']), )
309
114
from argparse import ArgumentParser import logging from .config import Config import sys def main(): ap = ArgumentParser() ap.add_argument("cfgfile", nargs="+", help="Codetree configuration file") verbosity = ap.add_mutually_exclusive_group(required=False) verbosity.add_argument("-v", "--verbose", act...
985
322
""" Methods for building Cognoma mutation classifiers Usage - Import only """ import pandas as pd from sklearn.metrics import roc_curve, roc_auc_score import plotnine as gg def theme_cognoma(fontsize_mult=1): return (gg.theme_bw(base_size=14 * fontsize_mult) + gg.theme(line=gg.element_line(color="#4...
5,862
1,716
from subprocess import run cmds = [ "3-way-merge", "ci", "help", "push", "stash", "add", "clean", "hook", "rebuild", "status", "addremove", "clone", "http", "reconstruct", "sync", "alerts", "close", "import", "redo", "tag", "all", ...
1,740
706
_msvc_copts = ["/std:c++17"] _clang_cl_copts = ["/std:c++17"] _gcc_copts = ["-std=c++17"] copts = select({ "@bazel_tools//tools/cpp:msvc": _msvc_copts, "@bazel_tools//tools/cpp:clang-cl": _clang_cl_copts, "//conditions:default": _gcc_copts, })
257
125
import logging import sys from trillian import TrillianLog from print_helper import Print from pprint import pprint def main(argv): logging.basicConfig(level=logging.INFO) trillian_log = TrillianLog.load_from_environment() Print.status('Checking signature on signed log root') validated_log_root = ...
1,154
362
""" Units module URLs """ from django.conf.urls import url, include from django.urls import path from rest_framework import routers from .viewsets import UnitSystemViewset, UnitViewset, \ ConvertView, CustomUnitViewSet from geocurrency.calculations.viewsets import ValidateViewSet, CalculationView app_name = 'uni...
875
277
from tabular import *
22
7
from django.contrib import admin from django.urls import include, path from rest_framework import routers from .shifts.views import ShiftView from .workers.views import WorkerView router = routers.DefaultRouter() router.register("workers", WorkerView) router.register("shifts", ShiftView) urlpatterns = [ path("ad...
383
115
from __future__ import division import numpy as np from scipy import integrate __all__ = ['area', 'simple'] def simple(p): pass def area(p): cumul = np.hstack(([0], integrate.cumtrapz(np.abs(np.gradient(p))))) return cumul / max(cumul)
257
96
# **************************************************************************** # # # # ::: :::::::: # # randominette.py :+: :+: :+: ...
6,451
2,019
# -*- coding: utf-8 -*- """This module provides a way to initialize components for processing pipeline. Init functions are stored into a dictionary which can be used by `Pipeline` to load components on demand. """ from .pipeline import Byte2html, Html2text, Html2image, Html2meta, Text2title def build_factories(): ...
750
217
def sampler(self, z, y=None): '''generate iamge given z''' with tf.variable_scope("generator") as scope: # we hope the weights defined in generator to be reused scope.reuse_variables() if not self.y_dim: s_h, s_w = self.output_height, self.output_width s_h2, s_w2 = conv_ou...
3,673
1,786
## how we measure the similarity between two lists w/ IC per each node ## we have a DAG strucutre ## goal is for each Gene !! output a 'semantic distance' # based on https://www.ncbi.nlm.nih.gov/pmc/articles/PMC2756558/ [but different] # with this two equal nodes will have distance '0' # maximum distance is -2log(1/...
14,915
5,264
import tfgraph def test_data_sets_naive_4(): assert tfgraph.DataSets.naive_4().shape == (8, 2) def test_data_sets_naive_6(): assert tfgraph.DataSets.naive_6().shape == (9, 2) def test_data_sets_compose(): assert tfgraph.DataSets.compose_from_path("./datasets/wiki-Vote/wiki-Vote.csv", ...
364
143
# -*- coding: utf-8 -*- """ :mod:`haystack.outputs` -- classes that create an output ============================================================================== """ from haystack import utils class Outputter(object): """ Outputter interface """ def __init__(self, memory_handler): self._memory_h...
668
193
#!/usr/bin/python3 import sys # f=open("reduce3.csv","w+") di={} for y in sys.stdin: Record=list(map(str,y.split(","))) if(len(Record)>3): Record=[Record[0]+","+Record[1],Record[2],Record[3]] s=int(Record[2][:-1]) if (Record[0],Record[1]) not in di: di[(Record[0],Record[1])]=[s,1] else: di[(Record[0],Record[...
631
337
# Copyright 2017-present, Bill & Melinda Gates 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 # # Unless required by applicable ...
9,622
2,815
from setuptools import setup, find_packages with open("README.md", encoding="utf-8") as f: long_description = f.read() setup( name="neureca", version="0.0.1", description="A framework for building conversational recommender systems", long_description=long_description, long_description_content_...
1,937
688
### # Thread rlock test. # # License - MIT. ### import time from threading import Thread, RLock # thread_test2 - Thread test2 function. def thread_test2(rlock): # { time.sleep(0.5) rlock.acquire() print('Third acquire.') rlock.release() # } # thread_test1 - Thread test1 function. def thread_test...
786
311
import shutil import tempfile from indigo.bingo import Bingo from tests import TestIndigoBase class TestBingo(TestIndigoBase): def setUp(self) -> None: super().setUp() self.test_folder = tempfile.mkdtemp() def tearDown(self) -> None: shutil.rmtree(self.test_folder) def test_mol...
1,319
495
# Copyright 2008-2018 Univa Corporation # # 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...
3,932
1,139
from power_sizing import calculate_power_luminance from power_sizing import calculate_number_and_power_of_tugs from conductor_sizing import conduction_capacity from conductor_sizing import minimum_section from conductor_sizing import voltage_drop from conductor_sizing import harmonic_rate from neutral_sizing import get...
2,264
815
# Generated by Django 3.1.6 on 2021-05-15 11:46 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('myapp', '0007_auto_20210317_1817'), ] operations = [ migrations.CreateModel( name='doctordata', fields=[ ...
784
240
#! /usr/bin/env python # -*- coding: utf-8 -*- # # >> # python-eventide, 2020 # LiveViewTech # << from uuid import UUID, uuid4 from datetime import datetime from operator import attrgetter from functools import total_ordering from dataclasses import ( field, asdict, fields, dataclass, _process_...
12,338
3,431
#!/usr/bin/env python3.6 # -*- coding: utf8 -*- ''' ELQuent.minifier E-mail code minifier Mateusz Dąbrowski github.com/MateuszDabrowski linkedin.com/in/mateusz-dabrowski-marketing/ ''' import os import re import sys import json import pyperclip from colorama import Fore, Style, init # ELQuent imports import utils.a...
10,926
3,655
############################################################################ # Theme setup html_theme = 'invitae' html_theme_path = ['themes'] if html_theme == 'sphinx_rtd_theme': import sphinx_rtd_theme html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] elif html_theme == 'bootstrap': import sphi...
2,305
772
def leiaInt(msg): while True: try: i = int(input(msg)) except (ValueError, TypeError): print('\033[1;3;31mERRO: Por favor, digite um número inteiro válido.\033[0;0;0m') continue except (KeyboardInterrupt): print('\n\033[1;3;33mUsuário preferiu ...
997
363
import json import logging import retrying import sdk_cmd LOG = logging.getLogger(__name__) def wait_for_brokers(client: str, brokers: list): """ Run bootstrap on the specified client to resolve the list of brokers """ LOG.info("Running bootstrap to wait for DNS resolution") bootstrap_cmd = ['/o...
10,851
3,553
#! /usr/bin/env python3 import prime description = ''' Prime pair sets Problem 60 The primes 3, 7, 109, and 673, are quite remarkable. By taking any two primes and concatenating them in any order the result will always be prime. For example, taking 7 and 109, both 7109 and 1097 are prime. The sum of these four primes...
1,242
444
# -*- coding: utf-8 -*- from __future__ import unicode_literals from . import __version__ as app_version app_name = "multilanguage_frappe_website" app_title = "Multilanguage Frappe Website" app_publisher = "DFP developmentforpeople" app_description = "Multilanguage Frappe Framework website example" app_icon = "octicon...
5,298
1,859
# -*- coding: utf-8 -*- from renormalizer.mps.tdh.propagation import unitary_propagation
90
37
from items.Item import Item class Boots_Of_Speed(Item): def __init__(self): Item.__init__(self, name='Boots of Speed', code=1001, cost=300, sell=210) self.sub_items = None def stats(self, champ): champ.move_speed += 25 return "%s move speed increase %d" % (champ.name, 25) def remove_stats(self, champ): ...
398
166
## train_models.py -- train the neural network models for attacking ## ## Copyright (C) 2016, Nicholas Carlini <nicholas@carlini.com>. ## ## This program is licenced under the BSD 2-Clause licence, ## contained in the LICENCE file in this directory. ## Modified for the needs of MagNet. import os import argparse impor...
12,045
4,203
import datetime import re import time import urllib from urllib import robotparser from urllib.request import urlparse from downloader import Downloader DEFAULT_DELAY = 5 DEFAULT_DEPTH = -1 DEFAULT_URL = -1 DEFAULT_AGENT = 'wswp' DEFAULT_RETRY = 1 DEFAULT_TIMEOUT = 60 DEFAULT_IGNORE_ROBOTS = False def link_crawler...
3,151
1,025
#Array.diff.py OKS function array_diff(a, b) { return a.filter(function(x) { return b,index(x) == -1; }); } #solution 2 for array,diff function array_diff(a, b) { return a.filter(e => !b.includes(e)); } function array_diff(a, b) { return a.filter(e => !b.includes(e)); } #Bouncing Balls ok ...
1,994
856
#!/usr/bin/env python import os import sys import yaml from optparse import OptionParser def main(run_info_yaml, lane, out_file, genome_build, barcode_type, trim, ascii, analysis, description, clear_description, verbose): if verbose: print "Verifying that %s exists" % run_info_yaml assert os.path.exists(r...
4,535
1,400
from django import forms #from app.models import Image # class ImageForm(forms.ModelForm): # class Meta: # model = Image # name = ['name'] # location = ['location']
196
56
#!/usr/bin/python3 """ create_account_with_captcha.py MediaWiki Action API Code Samples Demo of `createaccount` module: Create an account on a wiki with a special authentication extension installed. This example considers a case of a wiki where captcha is enabled through extensions like ConfirmEdi...
3,914
1,155
import sys,os import argparse from util.MongoUtil import MongoUtil from util.Generator import Generator #Custom help messages def help_msg(name=None): return '''main.py [-h] [--length LENGTH] [--search SEARCHFIELD SEARCHTEXT] ''' def search_usage(): return'''python main.py --search website example....
2,396
623
from basicnetworkswitch import * from cisconetworkswitch import *
66
17
from django.conf.urls import url from referralnote import views app_name = 'referral_note' #view_obj = views.ReferralNotes() urlpatterns = [ url(r'^(?P<p_id>[0-9]+)/delete_referralnote/(?P<notenum>[0-9]+)$', views.delete_refnote, name='delete_referralnote'), url(r'^(?P<p_id>[0-9]+)/edit_referralnote...
498
204
# thanks to max9111, https://stackoverflow.com/questions/41651998/python-read-and-convert-raw-3d-image-file import numpy as np from functools import lru_cache @lru_cache(maxsize=2) def imread_raw(filename : str, width : int = 1, height : int = 1, depth : int = 1, dtype = np.uint16): """Loads a raw image file (3D) ...
742
247
import random from brain_games.constants import MINIMAL_RANDOM, MAXIMAL_RANDOM def greeting(): return 'Find the greatest common divisor of given numbers.' def main_action(): first_el = random.randint(MINIMAL_RANDOM, MAXIMAL_RANDOM) second_el = random.randint(MINIMAL_RANDOM, MAXIMAL_RANDOM) correct_...
655
242
import os from ase.visualize import view from mpl_toolkits.mplot3d import Axes3D # noqa from scipy.optimize import curve_fit from tqdm import tqdm import matplotlib.pyplot as plt import numpy as np import seaborn as sns sns.set( style="ticks", rc={ "font.family": "Arial", "font.size": 40, ...
10,336
3,552
from django.conf import settings from django import http from django.template import RequestContext, loader def server_error(request, template_name='500.html'): """ 500 error handler. Templates: `500.html` Context: MEDIA_URL Path of static media (e.g. "media.example.org") """ ...
477
149
# -*- coding: utf-8 -*- # Generated by Django 1.11.7 on 2017-12-13 13:48 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('fleet_management', '0003_vehicledocument_document_type'), ('fleet_management', '0004_inciden...
372
142
import torch from ..attack.base_attack import BaseAttacker class Model_inversion(BaseAttacker): def __init__(self, target_model, input_shape): """implementation of model inversion attack reference https://dl.acm.org/doi/pdf/10.1145/2810103.2813677 Args: target_model: model...
1,481
440
""" Basic service for testing the service_utils run_main """ def main(to_send, config): print('Hello World Main...') connection_models = { 'out': { 'out_connection_1': { 'connection_type': 'requester', 'required_arguments': { 'this_is_a_test_arg': str, ...
448
132
from time import sleep from random import randint itens = ('Pedra', 'Papel', 'Tesoura') print('Suas opções: ') print("""[ 0 ] PEDRA [ 1 ] PAPEL [ 2 ] TESOURA""") computador = randint(0,2) jogador = int(input('Qual é a sua jogada? ')) print('JO') sleep(1) print('KEN') sleep(1) print('PO!!!') print('-=' * 11) print('Comp...
788
314
import wtdb import unittest class TestWtdbFunctions(unittest.TestCase): def test_n_swaps_zero(self): self.assertEqual( frozenset(), wtdb.n_swaps('foo', 'bar', 0), ) def test_n_swaps_single(self): self.assertSequenceEqual( { frozense...
2,708
944
# ENVISIoN # # Copyright (c) 2019 Jesper Ericsson # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, this # list o...
5,423
1,705
#! /usr/bin/env python # coding:utf-8 from __future__ import division, print_function import math # sqlalchemy import sqlalchemy from sqlalchemy.ext.declarative import declarative_base from sqlalchemy import create_engine from sqlalchemy import Column, TEXT, REAL, INTEGER from sqlalchemy.orm import sessionmaker from s...
26,442
7,963
#!/usr/bin/env python3 # Copyright 2018 Lael D. Barlow # # 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 ...
6,711
2,138
import os import os.path as osp import logging import argparse import math import yaml from tabulate import tabulate from torch.utils.data import Dataset from tqdm import tqdm from typing import Tuple, List import torch import torch.nn as nn import torch.nn.functional as functional import torch.distributed as dist f...
12,838
4,668
from django.conf.urls import url from . import views app_name = 'talent' urlpatterns = [ url(r'^$', views.IndexView.as_view(), name='index'), url(r'^musicians/$', views.MusicianIndex.as_view(), name='musicians'), url(r'^musicians/(?P<pk>[0-9]+)/$', views.MusicianDetail.as_view(), name='musician-detail'), ...
940
360
import discord from discord.ext.modules import ModularCommandClient if __name__ == "__main__": client = ModularCommandClient(intents=discord.Intents.none()) @client.event async def on_ready(): print("Logged on as {0}!".format(client.user)) client.load_extension("commands.hello_module") c...
402
127
# Copyright 2019 Benjamin Santos # # 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...
11,282
4,235
from typing import Any, Dict, List, Type, TypeVar, Union import attr from ..models.secret import Secret from ..types import UNSET, Unset T = TypeVar("T", bound="CryptFsConfig") @attr.s(auto_attribs=True) class CryptFsConfig: """Crypt filesystem configuration details""" passphrase: Union[Unset, Secret] = U...
1,842
593
# -*- coding: utf-8 -*- from django.shortcuts import render, HttpResponse,redirect from django.http import JsonResponse from .forms import RestaurantesForm from .models import restaurants, addr#, image from django.contrib.auth.decorators import login_required import logging log = logging.getLogger(__name__) # Create...
3,598
1,167
import cb, time, struct, sys, random, string try: import console console.set_color(0.0,0.2,1) print """ _____ _ _____ _ | |___ _| |___| __ | |_ _ ___ | --| . | . | -_| __ -| | | | -_| |_____|___|___|___|_____|_|___|___| _____ _ __/ ___/ ...
3,705
1,718
from django.urls import path from .views import * app_name = 'products' urlpatterns = [ path('create', CreateProduct.as_view(), name='create'), path('view/<int:pk>', ProductDetail.as_view(), name='detail'), path('list', ProductList.as_view(), name='list'), path('<int:pk>/update', ProductUpdate.as_view...
342
111
import functools import os import signal import sys from abc import ABC from enum import Enum from pathlib import Path from typing import Callable, ClassVar, List, Optional from jsonschema.exceptions import ValidationError as JsonSchemaValidationError from requests.exceptions import RequestException from yaml.error im...
13,004
3,730
""" Builds and runs application """ from app import app, user_datastore, db from api_module.api_routes import api from auth_module.auth_routes import auth app.register_blueprint(api) app.register_blueprint(auth) if __name__ == "__main__": # database = create_db(connection_str) # attach_db(g, database) app...
336
114
''' flask_miracle ------------- This module provides a fabric layer between the Flask framework and the Miracle ACL library. :copyright: (c) 2017 by Timo Puschkasch. :license: BSD, see LICENSE for more details. ''' from .base import Acl from .functions import check_all, check_any, set_current_...
381
126
from flask import Blueprint bp = Blueprint('tags', __name__) @bp.record_once def register(state): from sopy.tags import models
134
44
# -*- coding: utf-8 -*- """{{ cookiecutter.project_slug }} rest-api handlers.""" from .security import security_router __all__ = ("security_router",)
152
53
from datetime import datetime from .mixins import ArtistMixin, ExternalIDMixin, ExternalURLMixin, ImageMixin, TrackMixin from .object import SpotifyObject from .track import SimpleTrack class _BaseAlbum(SpotifyObject, TrackMixin, ImageMixin, ExternalURLMixin, ArtistMixin): _type = 'album' _track_class = SimpleTrac...
3,374
1,185
__version__ = "5.1.3" LOGGER_NAME = "connector.virustotal_intelligence"
73
31
from training.config_interface.BaseTrainingProcess import BaseTrainingProcess from training.config_interface.BaseTrainingEpoch import BaseTrainingEpoch
152
39
# -*- coding: utf-8 -*- # Copyright (c) 2017, masonarmani38@gmail.com and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe.model.document import Document class StationariesLog(Document): def on_submit(self): for item in self....
2,948
1,019
import time def main(request, response): delay = float(request.GET.first("ms", 500)) time.sleep(delay / 1E3); return [("Content-type", "text/javascript")], "export let delayedLoaded = true;"
205
69
import struct import os import sys import subprocess if len(sys.argv) != 2: print('Usage: python %s filename \n output is *.spv *.yariv and *.hex file \n' % sys.argv[0]) quit() inputfilepath = sys.argv[1] outputname = os.path.basename(inputfilepath) outdir = os.path.dirname(inputfilepath) ginfile = os.path.basen...
1,119
467
#!/usr/bin/env python3 import sys import logging import argparse import tqdm import dataset.budgetary from model import * from test import MockWorker from dataset import load_raw_csv from gui.estimation import Options as EstimationOpts from dataset.experimental_data import ExperimentalData logging.basicConfig(level...
3,672
1,213
# file KML.py # "Produces a kml file from the track as defined in ModuleConstructor.Track." # Strategy here is to produce two .kml files, one that references # google.com and one that references acserver.raf.ucar.edu, the latter # for use on the aircraft to avoid remote connections to google.com # in flight. The latter...
12,156
4,937
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Functions to make API calls. @author: amagrabi """ import requests def login(client_id, client_secret, project_key, scope, host = 'EU'): '''Authentification Args: client_id: client_id. client_secret: client_secret. project_key...
1,932
639
import sys, re, string, numpy p_strongs = numpy.arange(0.1, 0.9, 0.1) costs = range(3, 10, 1) for p_s in p_strongs: p_meds = numpy.arange(0.1, 1-p_s, 0.1) for p_m in p_meds: p_w = 1 - p_s - p_m for cost in costs: filename = str(p_s) + "_" + str(p_m) + "_" + str(p_w) + "_" + str(cos...
769
338
import boto3 as aws import botocore from shuttl import app ## Class for AWS S3 storage class Storage: bucket = None ##< the bucket the file belongs to s3 = aws.resource("s3") ##< The s3 instance @classmethod def GetBucket(cls, bucketName): try: cls.bucket = cls.s3.Bucket(bucketN...
1,625
479
#!/usr/bin/python # # This script is used to analyze, tabulate, and graph data generated by # the JAM weaver and by JAMScript performance instrumentation. It was # used to produce figures presented in the experimental results section # of ``Efficient Runtime Enforcement Techniques for Policy Weaving,'' # published at F...
21,822
7,820
# Copyright (c) 2011-2013 Peng Sun. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the COPYRIGHT file. # hone_control.py # a placeholder file for any control jobs HONE runtime generates
245
80