text
string
size
int64
token_count
int64
__all__ = ['Element', 'Server', 'ExternalEntity', 'Datastore', 'Actor', 'Process', 'SetOfProcesses', 'Dataflow', 'Boundary', 'TM', 'Action', 'Lambda', 'Threat'] from .pytm import Element, Server, ExternalEntity, Dataflow, Datastore, Actor, Process, SetOfProcesses, Boundary, TM, Action, Lambda, Threat
304
103
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright(c) 2021 The MITRE Corporation. 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/lice...
7,344
2,240
import os import argparse from tqdm import tqdm import torch from torch.autograd import Variable from torch.utils import model_zoo # http://scikit-learn.org from sklearn.metrics import accuracy_score from sklearn.metrics import average_precision_score from sklearn.svm import LinearSVC from sklearn.svm import SVC imp...
8,580
2,868
import csv import os from collections import deque BASE_DIR = os.path.dirname(os.path.abspath(__file__)) INPUT_PATH = os.path.join(BASE_DIR, 'goods_source.csv') OUTPUT_PATH = os.path.join(BASE_DIR, 'result.csv') FILE_ENCODE = 'shift_jis' INPUT_COLS = ('id', 'goods_name', 'price') def import_csv(): """入力データの読み込...
4,089
1,736
#!/usr/bin/python def a(val): return b(val) def b(val): return c(val) def c(val): return d(val) def d(val): return e(val) def e(val): return f(val) def f(val): return g(val, 2) def g(v1, v2): return h(v1, v2, 3) def h(v1, v2, v3): return i(v1, v2, v3, 4) def i(v1, v2, v3, v4): return j(v1, v2, v3, v4, 5) d...
440
260
import pandas as pd import numpy as np import swifter def money_precision_at_k(y_pred: pd.Series, y_true: pd.Series, item_price, k=5): y_pred = y_pred.swifter.progress_bar(False).apply(pd.Series) user_filter = ~(y_true.swifter.progress_bar(False).apply(len) < k) y_pred = y_pred.loc[user_filter] y_tru...
821
326
import numpy as np size = 9 percentage_max = 0.08 xis = np.linspace(0.1 * (1-percentage_max), 0.1 * (1+percentage_max), size) E_n = [ 85219342462.9973, 85219254693.4412, 85219173007.4296, 85219096895.7433, 85219025899.6604, 85218959605.1170, 85218897637.6421, 85218839657.9502, 85218785358.0968 ] percentage ...
598
445
#!/usr/bin/env python # -*- coding: utf-8 -*- from caqe import app app.run(debug=True, threaded=True)
102
43
"""hydra cli. Usage: hydra cli ls slaves hydra cli ls apps hydra cli ls task <app> hydra cli [force] stop <app> hydra cli scale <app> <scale> hydra cli (-h | --help) hydra cli --version Options: -h --help Show this screen. --version Show version. """ __author__ = 'sushil' from docopt imp...
4,059
1,491
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
1,378
417
############################ Copyrights and license ############################ # # # Copyright 2017 Chris McBride <thehighlander@users.noreply.github.com> # # Copyright 2017 Simon <spam@esemi.ru> ...
7,464
1,932
"""Tests for remote module.""" from unittest.mock import Mock, call, patch from samsungtvws.remote import SamsungTVWS def test_send_key(connection: Mock) -> None: """Ensure simple data can be parsed.""" open_response = ( '{"data": {"token": 123456789}, "event": "ms.channel.connect", "from": "host"}' ...
3,005
1,180
import logging from watchFaceParser.models.elements.common.imageSetElement import ImageSetElement class BatteryGaugeElement(ImageSetElement): def __init__(self, parameter, parent, name = None): super(BatteryGaugeElement, self).__init__(parameter = parameter, parent = parent, name = name) def draw3(s...
518
158
import inspect import numpy as np class TypeCheck(object): """ Decorator that performs a typecheck on the input to a function """ def __init__(self, accepted_structures, arg_name): """ When initialized, include list of accepted datatypes and the arg_name to enforce the check on....
3,092
889
# -*- coding: utf-8 -*- import unittest from openprocurement.api.tests.base import snitch from openprocurement.api.tests.base import BaseWebTest from openprocurement.tender.belowthreshold.tests.base import test_lots from openprocurement.tender.belowthreshold.tests.tender import TenderResourceTestMixin from openprocur...
3,770
1,250
from __future__ import print_function, division import os import numpy as np import h5py def dict_2_h5(fname, dic, append=False): '''Writes a dictionary to a hdf5 file with given filename It will use lzf compression for all numpy arrays Args: fname (str): filename to write to dic (dic...
3,791
1,359
# -*- coding: utf-8 -*- """ Created on Sat Mar 23 21:57:48 2019 INSTITUTO FEDERAL DE EDUCAÇÃO, CIÊNCIA E TECNOLOGIA DO PÁRA - IFPA ANANINDEUA @author: Prof. Dr. Denis C. L. Costa Discentes: Heictor Alves de Oliveira Costa Lucas Pompeu Neves Grupo...
1,786
804
class Solution: def trap(self, height): """ :type height: List[int] :rtype: int """ if not height: return 0 left = 0 right = len(height)-1 total_area = 0 if height[left] <= height[right]: m = left else: m =right while(left < right): if height[left] <= height[right]: # move m...
1,170
489
# list(map(int, input().split())) # int(input()) import sys sys.setrecursionlimit(10 ** 9) ''' DP A[n] = A[n-3] + A[n-4] + ... + A[0] (O(S**2)) ここで,A[n-1] = A[n-4] + A[n-5] + ... + A[0]より, A[n] = A[n-3] + A[n-1]とも表せる.(O(S)でより高速.) ''' mod = 10 ** 9 + 7 def main(*args): S = args[0] A = [0 for s in range(S+1)]...
607
362
from openmdao.main.factory import Factory from analysis_server import client, proxy, server class ASFactory(Factory): """ Factory for components running under an AnalysisServer. An instance would typically be passed to :meth:`openmdao.main.factorymanager.register_class_factory`. host: string ...
2,517
661
# Generated by Django 2.1 on 2018-08-24 09:25 from django.db import migrations, models import web.models class Migration(migrations.Migration): dependencies = [ ('web', '0006_organizationmember_user'), ] operations = [ migrations.AlterField( model_name='organizationpartner',...
474
154
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. load("//antlir/bzl:maybe_export_file.bzl", "maybe_export_file") load("//antlir/bzl:shape.bzl", "shape") load( "//antlir/bzl:target_tagger....
1,726
590
from typing import Tuple, List, Optional import json import sys import os import shlex import asyncio import argparse import logging import tempfile from urllib.parse import urlparse logger = logging.getLogger(__name__) def find_sqlmat_json() -> Optional[dict]: json_path = os.getenv('SQLMAT_JSON_PATH') if jso...
6,165
2,059
import requests from sys import stderr import re def submit(session, problem_id, language, source): language_code = { 'c': 1, 'java': 2, 'c++': 3, 'pascal': 4, 'c++11': 5 } url = "http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=25&page=save_submission" data = { 'problemid': '', ...
457
210
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ @author: Ada Gjermundsen year: 2019 - 2021 This script is used to calculate the eddy-induced overturning in CESM2 and NorESM2 (LM and MM) south of 50S for the CMIP experiments piControl and abrupt-4xCO2 after 150 the average time is 30 years The result is used in FIGU...
5,028
1,880
import json import re class Planner(object): def __init__(self, api_client): self.api_client = api_client def set_template(self, template): self.wflowns = self.api_client.get_export_url() + "workflows/" + template + ".owl#" self.wflowid = self.wflowns + template def _set_binding...
4,161
1,190
############################################################################## # # Copyright (c) 2004 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOF...
2,410
732
# Generated by Django 2.2 on 2020-11-07 01:03 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('bullet_point', '0005_bulletpoint_created_location'), ] operations = [ migrations.AddField( model_name='bulletpoint', n...
420
140
import pkg_resources from fastapi import FastAPI from fastapi.openapi.utils import get_openapi from starlette.responses import RedirectResponse, JSONResponse from routers import auth, media, video, photo, user, igtv, clip, album, story, hashtag, direct app = FastAPI() app.include_router(auth.router) app.include_route...
1,840
584
#!/usr/bin/env python3 from mycelium import CameraD435 from mycelium_utils import Scripter class ScripterExt(Scripter): def run_main(self): self.camera = CameraD435( configuration_mode=self.cfg.d435['configuration_mode'], enable_rgb_stream=self.cfg.d435['enable_rgb_stream'], ...
1,065
371
from PIL import Image from pitop import Pitop pitop = Pitop() miniscreen = pitop.miniscreen rocket = Image.open("/usr/lib/python3/dist-packages/pitop/miniscreen/images/rocket.gif") miniscreen.play_animated_image(rocket)
224
84
#!/usr/bin/python -tt import sys, re, math from decimal import * # TODO: work on naming scheme # TODO: add more ORIs # TODO: assemblytree alignment # TODO: Wobble, SOEing # TODO: (digestion, ligation) redundant products # TODO: for PCR and Sequencing, renormalize based on LCS # TODO: tutorials dna_alphabet = {'A':'A...
119,428
37,245
# -*- coding: UTF-8 -*- """Helper for working with flask""" import logging from flask import Flask from flask import request from typing import Text class FlaskHelper(object): """ Helper class for interacting with flask framework. Improves testability by avoiding accessing flask global/thread-local objec...
753
226
# Imports import numpy as np import pandas as pd import sys import tqdm import warnings import time import ternary from ternary.helpers import simplex_iterator import multiprocessing as mp warnings.simplefilter("ignore") if sys.platform == "darwin": sys.path.append("/Users/aymericvie/Documents/GitHub/evology/evol...
2,789
978
print("@"*30) print("Alistamento - Serviço Militar") print("@"*30) from datetime import date ano_nasc = int(input("Digite seu ano de nascimento: ")) ano_atual = date.today().year idade = ano_atual - ano_nasc print(f"Quem nasceu em {ano_nasc} tem {idade} anos em {ano_atual}") if idade == 18: print("É a hora de se...
727
289
# coding=utf-8 # Licensed Materials - Property of IBM # Copyright IBM Corp. 2017 """Testing support for streaming applications. Allows testing of a streaming application by creation conditions on streams that are expected to become valid during the processing. `Tester` is designed to be used with Python's `unittest` ...
25,990
7,122
from flask import request, jsonify, Blueprint from .. import piglatin main = Blueprint('main', __name__) @main.route('/', methods=['GET', 'POST']) def index(): response = """ Please use the endpoint /translate to access this api. Usage: "{}translate?text=Translate+this+text+into+Piglatin." ...
702
226
from turtle import Screen from paddle import Paddle from ball import Ball import time from scoreboard import ScoreBoard screen = Screen() screen.bgcolor('black') screen.setup(width=800, height=600) screen.title('pong') # Turn off animation to show paddle after it has been shifted screen.tracer(0) right_paddle = Pad...
1,240
478
""" Multistate Sales Tax Calculator """ import os from decimal import Decimal from decimal import InvalidOperation def prompt_decimal(prompt): """ Using the prompt, attempt to get a decimal from the user """ while True: try: return Decimal(input(prompt)) except InvalidOperation: ...
1,579
536
r""" :mod:`util.verify` -- Input verification ======================================== Common input verification methods. """ # Mandatory imports import numpy as np __all__ = ['verify_tuple_range'] def verify_tuple_range( input_range: tuple, allow_none: bool = True, name: str = None, step: bool = None, ...
2,650
823
import numpy as np import requests from django.db.models import Q from api.models import Photo, User from api.util import logger from ownphotos.settings import IMAGE_SIMILARITY_SERVER def search_similar_embedding(user, emb, result_count=100, threshold=27): if type(user) == int: user_id = user else: ...
2,349
776
# """ """ # end_pymotw_header import struct import binascii values = (1, "ab".encode("utf-8"), 2.7) print("Original values:", values) endianness = [ ("@", "native, native"), ("=", "native, standard"), ("<", "little-endian"), (">", "big-endian"), ("!", "network"), ] for code, name in endianness:...
621
240
# -*- coding: utf-8 -*- """Module grouping network-related utilities and functions.""" from queue import Empty, Queue from threading import Thread import requests import urllib3 from requests.adapters import HTTPAdapter import pydov request_timeout = 300 class TimeoutHTTPAdapter(HTTPAdapter): """HTTPAdapter w...
7,307
1,896
from flask.helpers import make_response from flask.templating import render_template from . import main @main.route('/', methods=['GET', 'POST']) @main.route('/index', methods=['GET', 'POST']) def index(): resp = make_response( render_template('main/index.html')) return resp
305
99
import sbol2 import pandas as pd import os import logging from openpyxl import load_workbook from openpyxl.worksheet.table import Table, TableStyleInfo from openpyxl.utils.dataframe import dataframe_to_rows from openpyxl.styles import Font, PatternFill, Border, Side from requests_html import HTMLSession #wasderivedfro...
11,470
3,197
# # Copyright 2021 Ocean Protocol Foundation # SPDX-License-Identifier: Apache-2.0 # import json import os import time from collections import namedtuple import requests from eth_utils import remove_0x_prefix from ocean_lib.data_provider.data_service_provider import DataServiceProvider from ocean_lib.enforce_typing_sh...
17,145
5,276
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ @author: Frank Nussbaum (frank.nussbaum@uni-jena.de), 2019 """ import numpy as np #import scipy #import abc #import time from scipy.optimize import approx_fprime from scipy.linalg import eigh from scipy import optimize from cgmodsel.utils import _logsumexp_condprob...
18,655
6,613
""" Linear solvers that are used to solve for the gradient of an OpenMDAO System. (Not to be confused with the OpenMDAO Solver classes.) """ # pylint: disable=E0611, F0401 import numpy as np from scipy.sparse.linalg import gmres, LinearOperator from openmdao.main.mpiwrap import MPI from openmdao.util.graph import fix...
17,758
5,317
def fahr_to_cels(a): return (a-32)/1.8 def cels_to_fahr(b): return(b*1.8)+32 c=50 d=10 print("{0} °F is {1}°C.".format(c,fahr_to_cels(c))) print("{0}°C is {1}°F.".format(d,cels_to_fahr(d)))
198
116
import csv import re ''' Delete char in substring of original string. Used this function when, you want to delete a character in a substring but not in the rest of the original string. Returns a string -- PARAMETERS -- text: original string start: start of subString end: end of subString char: char to delete,...
4,134
1,692
import arcade from .menu_view import MenuView TEXT_COLOR = arcade.csscolor.WHITE class CreditsView(MenuView): def __init__(self, parent_view): super().__init__() self.parent_view = parent_view def on_draw(self): arcade.start_render() arcade.draw_text( "Credits",...
672
224
# -*- coding: utf-8 -*- from __future__ import (absolute_import, division, unicode_literals, print_function) __all__ = ['MultiLayerPerceptronBackend'] import os import sys import math import time import types import logging import itertools log = logging.getLogger('sknn') import numpy import theano import sklearn....
15,885
4,836
import django_filters from django.forms import TextInput from src.accounts.models import User from src.application.models import Quiz, StudentGrade class UserFilter(django_filters.FilterSet): username = django_filters.CharFilter(widget=TextInput(attrs={'placeholder': 'username'}), lookup_expr='icontains') fi...
773
225
# Made by Kerberos # this script is part of the Official L2J Datapack Project. # Visit http://www.l2jdp.com/forum/ for more details. import sys from com.l2jserver.gameserver.instancemanager import QuestManager from com.l2jserver.gameserver.model.quest import State from com.l2jserver.gameserver.model.quest import QuestS...
1,677
619
s = [4, 2] if '2' in s: print(s)
37
24
# Copyright 2018 The AI Safety Gridworlds 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 b...
10,859
3,759
from setuptools import find_packages, setup import deepdow DESCRIPTION = "Portfolio optimization with deep learning" LONG_DESCRIPTION = DESCRIPTION INSTALL_REQUIRES = [ "cvxpylayers", "matplotlib", "mlflow", "numpy>=1.16.5", "pandas", "pillow", "seaborn", "torch>=1.5", "tensorboar...
956
370
""" modeling """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import time import shutil import numpy as np import tensorflow as tf from tensorflow.contrib import rnn from tensorflow.contrib import layers from utils_cnn import Norm class C_MODE...
12,139
3,516
#!/usr/bin/env python3 import io import unittest import unittest.mock from typing import Any, Callable, List, Tuple, Union import torch from captum._utils.typing import BaselineType, TensorOrTupleOfTensorsGeneric from captum.attr._core.kernel_shap import KernelShap from tests.helpers.basic import ( BaseTest, ...
13,582
5,312
# -*- coding: utf-8 -*- # Define here the models for your scraped items # # See documentation in: # http://doc.scrapy.org/en/latest/topics/items.html import scrapy class JobItem(scrapy.Item): title = scrapy.Field() url = scrapy.Field() text = scrapy.Field() labels = scrapy.Field() city = scrapy....
899
309
# -*- coding: utf-8 -*- # Copyright (c) 2020-2021 Ramon van der Winkel. # All rights reserved. # Licensed under BSD-3-Clause-Clear. See LICENSE file for details. from django.conf import settings from django.test import TestCase from django.urls import reverse from TestHelpers.e2ehelpers import E2EHelpers # updat...
6,519
2,454
import FWCore.ParameterSet.Config as cms from L1Trigger.TrackTrigger.ProducerSetup_cff import TrackTriggerSetup from L1Trigger.TrackerTFP.Producer_cfi import TrackerTFPProducer_params from L1Trigger.TrackerTFP.ProducerES_cff import TrackTriggerDataFormats from L1Trigger.TrackerTFP.ProducerLayerEncoding_cff import Trac...
1,179
386
"""A python library for intuitively creating CUI/TUI interfaces with pre-built widgets. """ # # Author: Jakub Wlodek # Created: 12-Aug-2019 # Docs: https://jwlodek.github.io/py_cui-docs # License: BSD-3-Clause (New/Revised) # # Some python core library imports import sys import os import time import copy impo...
60,446
15,825
# coding: utf-8 """ Isilon SDK Isilon SDK - Language bindings for the OneFS API # noqa: E501 OpenAPI spec version: 3 Contact: sdk@isilon.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ import pprint import re # noqa: F401 import six class AuthAccessAccessItemFile(o...
5,578
1,686
#!/usr/bin/python3 import pymysql class Connection: SQL_HOST = 'localhost' SQL_USR = '' SQL_PWD = '' SQL_DB = 'HOSPITAL' # initialize database object def __init__(self, usr, pwd): self.USR = usr self.PWD = pwd # return an database connection def __ente...
10,772
3,158
"""Generate charts from with .npy files containing custom callables through replay.""" import argparse from datetime import datetime import errno import numpy as np import matplotlib.pyplot as plt import os import pytz import sys def make_bar_plot(vals, title): print(len(vals)) fig = plt.figure() plt.hist...
5,040
1,664
import algoliasearch from os import environ from . import algolia_helper from . import snippeter from . import emails from . import helpers from . import fetchers from .helpdesk_helper import add_note, get_conversation, \ get_emails_from_conversation, get_conversation_url_from_cuid from deployer.src.algolia_inte...
6,447
1,735
import sys from sqlalchemy.exc import DatabaseError from . import cli from .configuration import settings, init as init_config from .observer import HelpdeskObserver, MaximumClientsReached from .models import init as init_models, metadata, engine, check_db from .smtp import SMTPConfigurationError __version__ = '0....
1,131
335
# -*- coding: utf-8 -*- import scrapy import re from locations.items import GeojsonPointItem DAY_DICT = { 'Mon': 'Mo', 'Tue': 'Tu', 'Wed': 'We', 'Thu': 'Th', 'Fri': 'Fr', 'Sat': 'Sa', 'Sun': 'Su', 'Monday': 'Mo', 'Tuesday': 'Tu', 'Wednesday': 'We', 'Thursday': 'Th', 'Th...
3,422
1,235
#!/usr/bin/env python from app import app app.run(debug = True)
65
24
from unittest.mock import patch from app.twitter_learning_journal.dao.os_env import os_environ @patch('app.twitter_learning_journal.dao.os_env.os') def test_os_environ(mock_os): expected_value = 'environment_value' mock_os.environ.__contains__.return_value = True # patch in statement mock_os.environ.__...
831
270
import pymongo myclient = pymongo.MongoClient() mydb = myclient["mydb"] hor = mydb["HoR"] sen = mydb["Senator"] gov = mydb["Governor"] def write(fileJSON): myDoc = fileJSON if( "hor" in myDoc.values()): hor.insert_one(myDoc) elif( "senate" in myDoc.values()): sen.insert_one(myDoc) else...
477
187
""" Test get_obj_value set_obj_value has_obj_value """ import pytest from dayu_widgets import utils class _HasNameAgeObject(object): def __init__(self, name, age): super(_HasNameAgeObject, self).__init__() self.name = name self.age = age @pytest.mark.parametrize('obj', ( {'name': 'xi...
1,444
510
import sys, yaml, test_appliance def main(args=None): collections = [] import test_yaml collections.append(test_yaml) if yaml.__with_libyaml__: import test_yaml_ext collections.append(test_yaml_ext) return test_appliance.run(collections, args) if __name__ == '__main__': main()...
322
108
""" Webcam Detection with Tensorflow calssifier and object distance calculation """ __version__ = "0.1.0" __author__ = "Tim Rosenkranz" __email__ = "tim.rosenkranz@stud.uni-frankfurt.de" __credits__ = "Special thanks to The Anh Vuong who came up with the original idea." \ "This code is also based off of ...
22,969
6,915
import json import logging import config as cfg from modules.const import Keys, AttrKey from modules.zabbix_sender import send_to_zabbix logger = logging.getLogger(__name__) SMART_ATTR_KEY = "ata_smart_attributes" NVME_ATTR_KEY = "nvme_smart_health_information_log" def send_attribute_discovery(result): """ zab...
4,107
1,625
import itertools from midi_to_statematrix import UPPER_BOUND, LOWER_BOUND def startSentinel(): def noteSentinel(note): position = note part_position = [position] pitchclass = (note + LOWER_BOUND) % 12 part_pitchclass = [int(i == pitchclass) for i in range(12)] return part...
2,007
693
# The MIT License (MIT) # Copyright (c) 2018 by EUMETSAT # # Permission is hereby granted, free of charge, to any person obtaining a copy of # this software and associated documentation files (the "Software"), to deal in # the Software without restriction, including without limitation the rights to # use, copy, modify,...
7,861
2,450
import threading from queue import Queue, Empty from time import sleep from libAnt.drivers.driver import Driver from libAnt.message import * class Network: def __init__(self, key: bytes = b'\x00' * 8, name: str = None): self.key = key self.name = name self.number = 0 def __str__(self...
4,209
1,141
# -*- coding: utf-8 -*- """ Created on Thu Sep 30 12:17:04 2021 @author: Oli """ import pytest import pandas as pd import numpy as np import netCDF4 as nc import os from copy import deepcopy os.chdir(os.path.dirname(os.path.realpath(__file__))) wd = os.getcwd().replace('\\', '/') exec(open("test_set...
5,168
1,967
from django.shortcuts import render, redirect from bookalo.pyrebase_settings import db, auth from bookalo.models import * from bookalo.serializers import * #from bookalo.functions import * from rest_framework import status, permissions from rest_framework.decorators import api_view, permission_classes from rest_...
2,514
902
import os import unittest from nefit import NefitClient, NefitResponseException class ClientTest(unittest.TestCase): def test_exceptions(self): client = NefitClient( os.environ.get("NEFIT_SERIAL", 123456789), os.environ.get("NEFIT_ACCESS_KEY", "abc1abc2abc3abc4"), "asdd...
572
190
import datetime from django.db import transaction def compute_diff(obj1, obj2): """ Given two objects compute a list of differences. Each diff dict has the following keys: field - name of the field new - the new value for the field one - value of the field in o...
5,080
1,395
# Copyright 2018 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). import itertools from pathlib import PurePath from typing import Iterable from pants.base.build_root import BuildRoot from pants.engine.addresses import Address, Addresses, BuildFileAddre...
3,257
949
# Copyright 2014 PerfKitBenchmarker Authors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
5,887
1,636
# Generated by the protocol buffer compiler. DO NOT EDIT! from google.protobuf import descriptor from google.protobuf import message from google.protobuf import reflection from google.protobuf import descriptor_pb2 # @@protoc_insertion_point(imports) import google.protobuf.descriptor_pb2 import netmessages_pb2 impo...
154,604
63,667
#!/usr/bin/env python import json from auth0_client.Auth0Client import Auth0Client from auth0_client.menu.menu_helper.common import * from auth0_client.menu.menu_helper.pretty import * try: users = {} client = Auth0Client(auth_config()) results = client.active_users() print(pretty(results)) except...
369
121
from __future__ import absolute_import from django.contrib import admin from .models import Deposit, Withdrawal, Support from .forms import DepositForm, WithdrawalForm # Register your models here. @admin.register(Deposit) class DepositAdmin(admin.ModelAdmin): # form = DepositForm list_display = ["__str__", "...
852
273
import os DEBUG = True DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': '/tmp/piston.db' } } DATABASE_ENGINE = 'sqlite3' DATABASE_NAME = '/tmp/piston.db' INSTALLED_APPS = ( 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessi...
818
304
""" Combinatorial maps This module provides a decorator that can be used to add semantic to a Python method by marking it as implementing a *combinatorial map*, that is a map between two :class:`enumerated sets <EnumeratedSets>`:: sage: from sage.combinat.combinatorial_map import combinatorial_map sage: class...
14,958
4,358
import os from xdress.utils import apiname package = 'cppproj' packagedir = 'cppproj' includes = ['src'] plugins = ('xdress.autoall', 'xdress.pep8names', 'xdress.cythongen', 'xdress.stlwrap', ) extra_types = 'cppproj_extra_types' # non-default value dtypes = [ ('map', 'str', 'int'), ('set', 'in...
5,048
2,006
import os import subprocess import routines.config as config import routines.helpers as helpers def get_static_info(): """ Outputs data concerning the computer in the C-AWS station """ startup_time = None data_drive_space = None camera_drive_space = None # Get system startup ...
1,259
400
import FWCore.ParameterSet.Config as cms from RecoMuon.TrackingTools.MuonServiceProxy_cff import MuonServiceProxy dtEfficiencyMonitor = cms.EDAnalyzer("DTChamberEfficiency", MuonServiceProxy, debug = cms.untracked.bool(True), TrackCollection = cms.InputTag("standAloneMuons"), theMaxChi2 = cms.do...
654
253
from gym_reinmav.envs.mujoco.mujoco_quad import MujocoQuadEnv from gym_reinmav.envs.mujoco.mujoco_quad_hovering import MujocoQuadHoveringEnv from gym_reinmav.envs.mujoco.mujoco_quad_quat import MujocoQuadQuaternionEnv
217
99
#!/usr/bin/env python3 # vim:softtabstop=4:ts=4:sw=4:expandtab:tw=120 from ansimarkup import AnsiMarkup, parse import csv import datetime import operator import os from pathlib import Path import re import sys import traceback _VERBOSE = False user_tags = { 'error' : parse('<bold><red>'), 'nam...
3,075
1,174
import unittest import shutil from rdyn.alg.RDyn_v2 import RDynV2 class RDynTestCase(unittest.TestCase): def test_rdyn_simplified(self): print("1") rdb = RDynV2(size=500, iterations=100) rdb.execute(simplified=True) print("2") rdb = RDynV2(size=500, iterations=100, max_ev...
625
261
import os from .kface import KFace from .ms1m import MS1M from .bin_datasets import BIN from .ijb import IJB def build_datasets(data_cfg, batch_size, cuda, workers, mode, rank=-1): assert mode in ['train', 'test'] cfg = data_cfg[mode] if cfg['dataset'] == 'kface': dataset =...
1,436
470
"""""" # Standard library modules. import abc # Third party modules. from django.core.mail import send_mail from django.template import Engine, Context # Local modules. from .models import RunState # Globals and constants variables. class Notification(metaclass=abc.ABCMeta): @classmethod def notify(self, ...
1,316
377
#!/usr/bin/env python2 import random import itertools import numpy import sys import json import copy def make_bins_ltpFR3(semArray): """ Creates four equal-width bins of WAS scores, identical to those used in ltpFR2. Then combine the middle two to give three bins: low similarity, medium similarity, and h...
16,783
4,885
# Copyright 2019 The FastEstimator 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 appl...
1,568
494