content stringlengths 5 1.05M |
|---|
import math
import numpy as np
import tributary.streaming as ts
rng = range(-10, 11)
def foo_range():
for _ in rng:
yield (_, 1)
pos_rng = range(1, 11)
def foo_pos():
for _ in pos_rng:
yield (_, 1)
neg_rng = range(-10, 0)
def foo_neg():
for _ in neg_rng:
yield (_, 1)
ze... |
import sys
import logging
import re
from typing import Text, Dict, Any
from rasa_sdk import Action, Tracker
from rasa_sdk.executor import CollectingDispatcher
from py2neo import Graph
from markdownify import markdownify as md
logger = logging.getLogger(__name__)
p = 'data/medical/lookup/Diseases.txt'
disease_names =... |
#!/usr/bin/env python3
# import sys
import dpkt
import os
from pyfiglet import Figlet
import time
#Simple ASCII Art Banner Display
def banner_message(message):
if message == "start":
f = Figlet(font='slant')
return(f.renderText("PCAParser"))
#Live Capture function
#Live Capture was the... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @File : memory.py
# @Author: zixiao
# @Date : 2019-04-07
# @Desc :
import numpy as np
class Memory:
def __init__(self, size, w, h, frame_len):
self.size = size
self.index = 0
self.count = 0
self.num_in_memory = 0
self.frame... |
#!/usr/bin/env python2.7
import json
import jwt
import os
import random
import re
import select
import subprocess
import socket
import time
import threading
import traceback
import zmq
import requests
import six.moves.queue
from datetime import datetime, timedelta
from functools import partial
from jsonrpc import JSONR... |
def init():
return {
"kafka_metrics_topic": "telemetry.metrics",
"kafka_job_queue": "{}.analytics.job_queue"
}
|
import torch.optim as optim
def sgd_optimizer(model, learning_rate, momentum, l2_factor=0.0):
"""Create optimizer.
Args:
model: Model instance.
learning_rate: Learning rate for the optimizer.
momentum: Momentum of optimizer.
l2_factor: Factor for L2 regularization.
Re... |
import py_compile
import sys
import csv
import os.path as _p
import pathlib
if len(sys.argv) == 2:
# directory mode
dir = sys.argv[1]
with open(_p.join(dir, '.py_compile')) as fin, open(_p.join(dir,'.py_compile.done'), 'w') as fout:
wrt = csv.writer(fout, doublequote=False, escapechar='\\')
... |
from . import TestCase
class TestGetSet(TestCase):
def test_get(self):
self.assertEqual(None, self.ssdb.get('None'))
def test_set(self):
self.assertEqual(1, self.ssdb.set(b'set', b'set'))
self.assertEqual(1, self.ssdb.set(b'set', b'set'))
self.assertEqual(b'set', self.ssdb.get... |
from django.shortcuts import render
from rest_framework import generics, permissions
from .models import Employee
from .serializers import EmployeeSerializer
from django.views.generic.base import TemplateResponseMixin
# Create your views here.
class EmployeeListView(generics.ListCreateAPIView):
'''
This generat... |
from random import randint
from time import sleep
def turn(player_lives: int, player_name: str, sentence: str, sentence_out: str) -> list: # [state_of_choice, reformed_sentence, lives_to_remove]
found = False
letters = "qwertzuiopasdfghjklyxcvbnm"
counter = 0
if player_lives > 0:
letter = input(f"{pla... |
# Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: MIT-0
from dataclasses import dataclass
from typing import Optional
from neptune_load.sigv4_signer.sigv4_signer import SigV4Signer
from pipeline_control.adapters.neptune_loader.neptune_loader_configuration import (
... |
#!/usr/bin/env python3
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... |
from django.shortcuts import render
from django.template.loader import render_to_string
from django.http import HttpResponse,JsonResponse
from .models import *
from django.views.generic import ListView
from my_utils.decorator import ajax_login_requird
from django.views.decorators.http import require_http_methods
from s... |
import argparse
import sys
from pathlib import Path
from hairy_hashes.hashes import rm_duplicate_hashes
def main() -> None:
"""Remove files with duplicate SHA256 hashes."""
try:
parser = argparse.ArgumentParser(
description="Remove files with duplicate SHA256 hashes.",
formatt... |
#!/usr/bin/env python
# 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
#
# Authors:
# - Danila?
# - Paul Nilsson, [email protected], 2019
import ... |
#!/usr/bin/env python
"""
Module :py:class:`DLDGraphics` for MCP DLD detectors for COLTRIMS experiments
===============================================================================
from psana.hexanode.DLDGraphics import DLDGraphics
kwargs = {'STAT_NHITS':True,...}
p = DLDProcessor()
s = DLDStatisti... |
def count_robots(a):
|
'''
Created on Aug 4, 2020
@author: willg
'''
import fnmatch
import json
import os
import re
from datetime import datetime
import humanize
from pathlib import Path
import shutil
import common
user_delimiter = "C,'6WeWq~w,S24!z;L+EM$vL{3M,HMKjy9U2dfH8F-'mwH'[email protected]*!StX*:D7^&P;d4@AcWS3)8f64~6CB^B4{s`... |
#
# @author Kevin Jesse
# @email [email protected]
#
from operator import itemgetter
import re
import random
import control
import responseCtrl
import movieCtrl
import database_connect
cur = database_connect.db_connect()
def genre(meta_info):
"""
:param meta_info: this contains the input scoring infor... |
import rhinoscriptsyntax as rs
obj = rs.GetObject("Select a srf", rs.filter.surface)
# obj = rs.GetObject("Select object", rs.filter.surface + rs.filter.polysurface)
intervalx = rs.GetReal("intervalx", 1)
intervaly = rs.GetReal("intervaly", 2)
Secx = rs.GetReal("mullion width", 0.15)
Secy = rs.GetReal("mullion depth... |
from fontbakery.checkrunner import (
INFO
, WARN
, ERROR
, SKIP
, PASS
, FAIL
, Section
)
import os
from .shared_conditions import is_variable_font
from fontbakery.callable import condition, check, disable
from fontbakery.... |
import os
import random
import numpy as np
import zipfile
import collections
from mxnet import nd, gluon
from mxnet.gluon import utils as gutils, data as gdata
def data_iter_consecutive(corpus_indices, batch_size, num_steps, ctx=None):
"""Sample mini-batches in a consecutive order from sequential data."""
# O... |
import enum
"""
This module contains all the possible random distributions names
that can be set in each of the Space variables
"""
class ExtendedEnum(enum.Enum):
@classmethod
def list(cls):
return list(map(lambda c: c.value, cls))
class IntegerDistributions(ExtendedEnum):
unifor... |
import logging
from typing import List, Union
import click
import numpy as np
from vpype import (
LayerType,
LengthType,
LineCollection,
LineIndex,
VectorData,
global_processor,
layer_processor,
multiple_to_layer_ids,
)
from .cli import cli
@cli.command(group="Operations")
@click.ar... |
# -*- coding: utf-8 -*-
"""
Created on Wed Oct 12 08:44:56 2016
@author: chyam
Purpose: Re-label classes for text classification.
"""
import argparse
import pandas as pd
import preputils as pu
def main():
argparser = argparse.ArgumentParser(description='This script will re-label classes of a text classification d... |
from keckdrpframework.primitives.base_primitive import BasePrimitive
import math
class CalcPrelimDisp(BasePrimitive):
"""Calculate dispersion based on configuration parameters.
The parameters of the grating equation are calculates as:
alpha = grating_angle - 13 - adjustment_ange (180 for BH, RH and
... |
#import Scientific_numerics_package_id
#package = Scientific_numerics_package_id.getNumericsPackageName()
#del Scientific_numerics_package_id
#if package == "Numeric":
# from LinearAlgebra import *
#elif package == "NumPy":
from numpy.oldnumeric.linear_algebra import *
#elif package == "Numarray":
# from nu... |
from .models import Collector
|
# Copyright 2021 Cortex Labs, 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 the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... |
names = ["shakira", "ndagire", "seruwagi"];
for name in names:
if(len(name) >= 10):
print("Those name is so long cheiiii")
print("Those name isnot so long") |
def pig_latin(word):
a={'a','e','i','o','u'}
#make vowels case insensitive
vowels=a|set(b.upper() for b in a)
if word[0].isalpha():
if any(i in vowels for i in word):
if word.isalnum():
if word[0] in vowels:
pig_version=word+'way'
... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import argparse
import subprocess
import os
import errno
import getpass
import re
import codecs
import shutil
import platform
"""Utils prepared for makefile
This module will include:
sphinx
offline distribution
...
Exam... |
# Copyright 2020 Efabless 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... |
import torch.nn.functional as F
import torch.nn as nn
from . import BaseTask, register_task
from ..dataset import build_dataset
from ..utils import Evaluator
@register_task("node_classification")
class NodeClassification(BaseTask):
r"""
Node classification tasks.
Attributes
-----------
dataset : ... |
import datetime
from urllib.parse import quote
from django.conf import settings
from django.contrib.auth import user_logged_in
from django.dispatch import receiver
from django.http import HttpResponse
from django.utils import translation
from django.utils.translation import LANGUAGE_SESSION_KEY, get_language
def is_... |
"""A simple densely connected baseline model."""
import typing
import torch
from mzcn.engine.base_model import BaseModel
from mzcn.engine.param_table import ParamTable
from mzcn.engine import hyper_spaces
class DenseBaseline(BaseModel):
"""
A simple densely connected baseline model.
Examples:
>... |
# Copyright (c) Charl P. Botha, TU Delft.
# All rights reserved.
# See COPYRIGHT for details.
import config
from install_package import InstallPackage
import os
import shutil
import utils
BASENAME = "gdcm"
GIT_REPO = "git://git.code.sf.net/p/gdcm/gdcm "
GIT_TAG = "v2.0.17"
dependencies = ['SWIG', 'VTK'... |
from pathlib import Path
import re
p = Path(
r"C:\Program Files (x86)\Steam\steamapps\common\Spelunky 2\Mods\Extracted\Data\Levels"
)
tile_code_re = re.compile(
r"^\\\?(?P<name>\w+)(%(?P<pct>\d{2})(?P<second_name>\w+)?)?\s+(?P<code>.)"
)
codes = set()
for lvl_file in p.glob("*lvl"):
for line in lvl_file... |
import os
import sys
import subprocess
import time
toolkit_directory = "Toolkit"
toolkit_repo = "https://github.com/milos85vasic/Apache-Factory-Toolkit.git"
if __name__ == '__main__':
exists = True
steps = []
if not os.path.exists(toolkit_directory):
exists = False
steps.extend(
... |
import csv
from datetime import date
import itertools
import logging
from django.conf import settings
from django.core.management import BaseCommand
from django.utils import timezone
from api.barriers.models import PublicBarrier
from api.barriers.public_data import public_release_to_s3
from api.metadata.constants imp... |
from dataclasses import dataclass
from typing import Tuple
from wai.annotations.domain.image import Image
from opex import ObjectPrediction
@dataclass
class OPEXObject:
"""
Internal representation of an OPEX annotation.
"""
prediction: ObjectPrediction
label: str
@classmethod
def from_st... |
from pathlib import Path
import numpy
from matplotlib import pyplot
from neodroidvision.regression.denoise.spectral_denoise import fft_im_denoise
if __name__ == "__main__":
def plot_spectrum(im_fft):
"""
:param im_fft:
:type im_fft:
"""
from matplotlib.colors import LogNorm
# A logarith... |
import tweepy
import inspect
from bottle import PluginError
class TweepyPlugin(object):
name = 'tweepy'
api = 2
def __init__(self, consumer_key, consumer_secret, access_token, access_token_secret, keyword='api'):
self.consumer_key = consumer_key
self.consumer_secret = consumer_se... |
#!/usr/bin/python
# coding:utf-8
import pymysql
from managehtml import *
from md5 import *
import os
sqlservername='localhost'
sqluser='simpledrive'
sqlpasswd='simpledrive'
sqldatabase='simpledrive'
def manageUserandServer(username):
isadmin=''
signupstate = ''
invitecode = ''
with o... |
from typing import Dict
from .rules import *
from .util import *
import copy
consumes_amount_prefix = "consumes_amount_"
allocates_amount_prefix = "allocates_amount_"
deallocates_amount_prefix = "deallocates_amount_"
def parse(filename: str, include_path, definitions, extra_args):
index = Index.create(True)
... |
#The svm class uses the package CVXOPT, Python Software for Convex Optimization, that is not part of the standard python,
#but is included in Anaconda for example.
import numpy as np
import warnings
#Everything else is imported locally when needed
class SVMClass:
#####################################################... |
import json
import os
import warnings
import random
import string
import csv
import time
import datetime
import io
import hashlib
from flask import (
Blueprint, flash, Flask, g, redirect, render_template, request, url_for, jsonify, Response
)
from survey.figure_eight import FigureEight
from core.models.metrics i... |
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'IPGroup'
db.create_table('iprestrict_ipgroup', (
('id', self.gf('django.db.models.field... |
data_stacked = data.stack() |
"""
htmlgen
Kind of like HTMLGen, only much simpler. Like stan, only not. The
only important symbol that is exported is ``html``.
You create tags with attribute access. I.e., the ``A`` anchor tag is
``html.a``. The attributes of the HTML tag are done with keyword
arguments. The contents of the tag are the non-ke... |
# coding: utf-8
# /*##########################################################################
#
# Copyright (c) 2015-2016 European Synchrotron Radiation Facility
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to d... |
import time
import sys
import array
import struct
import serial
from ga144 import GA144
class FlashReader(GA144):
def __init__(self, port, dumpfile, length):
du = open(dumpfile, "wb")
length = int(length, 0)
print 'length', length
GA144.__init__(self)
self.loadprogram("fla... |
# -*- coding: utf-8 -*-
"""Veil domain entity."""
import sys
from enum import Enum, IntEnum
from typing import List, Optional
from uuid import uuid4
try:
from aiohttp.client_reqrep import ClientResponse
except ImportError: # pragma: no cover
ClientResponse = None
from ..base import (VeilApiObject, VeilCacheC... |
#!/usr/bin/env python
#
# Jiao Lin <[email protected]>
#
from mcvine.applications.InstrumentBuilder import build
components = ['source', 'sample', 'monitor']
App = build(components)
name = "sqekernel-test"
if __name__ == '__main__': App(name).run()
# End of file
|
import unittest
from centralized_pre_commit_conf.update_gitignore import get_updated_gitignore_content
GITIGNORE_INFO_TEXT = "# fervpierpvjepvjpvjepvjperjverpovpeorvpor"
class TestUpdateGitignore(unittest.TestCase):
def test_nothing(self):
text, mode = get_updated_gitignore_content("", set(["a", "b", "c... |
#!/usr/bin/python
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "Licen... |
""" User Management Module
This module reads the 'users.conf' file and gets all users's info.
"""
__all__ = ["UserMgr"]
import ConfigParser
class UserMgr:
"""User Manager
The format of the user_info is:
user_info = {
"username": "maple",
"password": "valley",
"ethernet_interface"... |
"""Units of measure module."""
from pathlib import Path
import json
from functools import lru_cache
# Bifrost weights and measures module
# Temporary version based on pagoda code
# todo: Replace with RESQML uom based version at a later date
version = '5th May 2021'
# physical constants
feet_to_metres = 0.3048
metre... |
# -*- coding: utf-8 -*-
__author__ = "Ariel Rodrigues"
__version__ = "0.1.0"
__license__ = ""
"""
Module Docstring
params: {
join_data: string,
embeddings: string
}
"""
import luigi
import logging
import datetime
import utils
log = logging.getLogger(__name__)
class CNN(luigi.Task):
params = luigi.Dic... |
import hashlib
def genetere_rate_cache_key(source: int, currency: int) -> str:
key = (f'latest-rates-{source}-{currency}' * 100).encode()
return hashlib.md5(key).hexdigest()
# return f'latest-rates-{source}-{currency}'
|
from collections import Counter
def find_repeated_dna_sequences(s: str) -> list[str]:
if len(s) < 10:
return []
counter = Counter(s[i: i + 10] for i in range(len(s) - 10 + 1))
return [key for key in counter if counter[key] > 1]
if __name__ == "__main__":
print(find_repeated_dna_sequ... |
import os
import operator, functools
from typing import List, Tuple
from concurrent.futures import ProcessPoolExecutor
def make_double(n):
print('PID[{}]:\t{}'.format(os.getpid(), n))
return n*2
def multi_processing(func, inputs, n_max_workers=None):
p_executor = ProcessPoolExecutor(max_workers=n_max_workers)
wi... |
aux=0
n=int(input())
while n!=0:
aux=10*aux+n%10
n=int(n/10)
print(aux)
|
import argparse
import base64
import logging
import os
import sys
from typing import (
Any,
Dict,
)
import requests
import yaml
DESCRIPTION = """Load a Galaxy model store into a running Galaxy instance.
See the corresponding galaxy-build-objects script for one possible way to
create a model store to use with... |
#! /usr/bin/env python3
import logging
from ops.charm import CharmBase
from ops.main import main
from ops.model import ActiveStatus, MaintenanceStatus, BlockedStatus
import subprocess
import os
logger = logging.getLogger(__name__)
class SuricataCharm(CharmBase):
"""Class representing this Operator charm."""
... |
"""
This script evaluates the performance of the
AKKEffProofOfRetrievability Proof of
retrievability implemented in
koppercoin.crypto.AKKEffProofOfRetrievability.py
"""
from koppercoin.crypto.AKKEffProofOfRetrievability import *
from koppercoin.crypto.AKKProofOfRetrievability import GQProofOfRetrievability as SlowGQPro... |
from google_api_python_tools.dataproc.job import DataProcJob
from google_api_python_tools.dataproc.operation import DataProcOperation
from google_api_python_tools.dataproc.constants import DataprocImageVersion
class DataProcCluster(object):
class ClusterJob(object):
def __init__(self, cluster):
... |
__version__ = '1.1.51' |
#!/usr/bin/python2.6
import os, sys
import networkx # http://networkx.lanl.gov/
import cPickle
'''Parse some html pages and build an adjacency matrix.
Written by Eric Brochu and Nando de Freitas.
Modified by Kevin Murphy, 20 Feb 2011.
'''
def parseFiles(folder):
'''Make a dictionary, keys are filenames, value is ... |
from typing import Any
import cv2
from .image_binary import ImageBinary
class ImageGray:
def __init__(self, image_bytes) -> None:
self.image_bytes = image_bytes
def apply_clahe(self, clip_limit, tile_size) -> Any:
clahe = cv2.createCLAHE(clipLimit=clip_limit, tileGridSize=tile_size)
r... |
# -*- coding: utf-8 -*-
__all__ = ['Reverse', 'UrlBuildingError']
from .url import URL
from .url_templates import UrlBuildingError
from ..utils import cached_property
class Location(object):
'''
Class representing an endpoint in the reverse url map.
'''
# XXX For backward compatibility, some subcla... |
import matplotlib.pyplot as plt
plt.plot([1, 2, 3, 4])
plt.ylabel('some numbers')
plt.show() |
import sys, datetime
from PyQt5.QtWidgets import QApplication, QMainWindow, QMessageBox, QTableWidget, QTableWidgetItem
from PyQt5.QtCore import QStringListModel
from PyQt5.QtGui import QIcon, QStandardItemModel
from PyQt5 import uic
form_class = uic.loadUiType("GUI/Qt/MoreInfo.ui")[0]
'''
변수명 ... |
from .cllexer import COOL_LEXER
from .cllexer import tokens as COOL_TOKENS
|
import threading
import unittest
from peewee import *
from playhouse.kv import PickledKeyStore
from playhouse.kv import KeyStore
class KeyStoreTestCase(unittest.TestCase):
def setUp(self):
self.kv = KeyStore(CharField())
self.ordered_kv = KeyStore(CharField(), ordered=True)
self.pickled_k... |
# Generated by Django 2.2.11 on 2020-03-24 09:52
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('wiki', '0003_auto_20200324_0906'),
]
operations = [
migrations.AlterModelOptions(
name='wikientry',
options={'order... |
"""
Base class for OceanMonkey commands
"""
import abc
class MonkeyCommand(abc.ABC):
@abc.abstractmethod
def execute(self):
""" """
@abc.abstractmethod
def print_help(self):
""""""
CommandType = {
"startproject": 1,
"run": 2
}
class Commands:
STARTPROJECT = CommandType["... |
import xml.etree.ElementTree as ET
import urllib.request
import sys
import os
import time
from datetime import datetime
import sys
rss_feeds = []
assert len(sys.argv) <= 3, "Too many arguments"
if len(sys.argv) == 1:
rss_path = "links.txt"
else:
rss_path = sys.argv[1]
if len(sys.argv) <= 2:
re... |
import requests
params = (
('include_profile_interstitial_type', '1'),
('include_blocking', '1'),
('include_blocked_by', '1'),
('include_followed_by', '1'),
('include_want_retweets', '1'),
('include_mute_edge', '1'),
('include_can_dm', '1'),
('include_can_media_tag', '1'),
('skip_... |
#!/usr/bin/env python3
#
# This example shows how to run a combined fluid-kinetic simulation with
# with both the hot-tail and runaway electron grids.
#
# Run as
#
# $ ./basic.py
# $ ../../build/iface/dreami dream_settings.h5
#
# ###################################################################
import numpy as n... |
from moeda import *
from dado import *
preco = leia_dinheiro('Digite o preço: R$')
resumo(preco, 35, 22)
|
# Generated by Django 2.0.5 on 2018-06-07 07:39
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('hrmsapp', '0009_auto_20180606_0959'),
]
operations = [
migrations.RemoveField(
model_name='educational_info',
name='... |
# vim: ts=4:sw=4:expandtabs
__authors__ = "Zach Mott, David Fox, Jason Dunn"
from django.views import generic
from django.shortcuts import redirect
from django.utils.text import slugify
from quizard.forms import AssignmentSearchForm
from NavLocationMixin import NavLocationMixin
class Index(NavLocationMixin, gener... |
"""
Python library to fetch trending repositories/users using github-trending-api
Made by Hedy Li,
Code on GitHub
"""
from typing import Optional
import requests
def fetch_repos(
language: str = "",
spoken_language_code: str = "",
since: str = "daily",
) -> dict:
"""Fetch trending repositories on G... |
from django.conf.urls import include, url
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from zentral.conf import saml2_idp_metadata_file, settings as zentral_settings
# base
urlpatterns = [
url(r'^', include('base.urls', namespace='base')),
url(r'^admin/users/', include('accounts.urls', n... |
from owoify import Owoifator
owoifator = Owoifator()
owoifator.owoify("foldr") # Hewwo fwiend (*^ω^)
owoifator.owoify("foldl") # Hewwo fwiend (*^ω^)
owoifator.owoify("loss") # Hewwo fwiend (*^ω^)
owoifator.owoify("losses") # Hewwo fwiend (*^ω^)
owoifator.owoify("nan") # Hewwo fwiend (*^ω^)
owoifator.owoify("tf.r... |
# 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:constants.bzl", "REPO_CFG")
load("//antlir/bzl:oss_shim.bzl", "python_unittest")
load("//antlir/bzl/image/feature:new.bzl",... |
import pandas as pd
from pypfopt.efficient_frontier import EfficientFrontier
from pypfopt import risk_models
from pypfopt import expected_returns
def weights(data):
#df = pd.read_csv("complete_new.csv",parse_dates=[0], index_col=0,infer_datetime_format=True)
df = data
fund = df.iloc[0:,0:5]
mu = expec... |
import sys
from telethon.network.connection.tcpabridged import ConnectionTcpAbridged
from telethon.sessions import StringSession
from ..Config import Config
from .client import udyclient
__version__ = "0.02"
loop = None
if Config.STRING_SESSION:
session = StringSession(str(Config.STRING_SESSION))
else:
ses... |
from django.conf.urls import url
from django.contrib import admin
from django.views.generic.base import TemplateView
from api.views import *
from django.urls import path
from .views import movie_times
from .views import movie_list
urlpatterns = [
url(r'^admin/', admin.site.urls),
path('movietimes/', movie_time... |
import os
import shutil
import urllib
import urllib2
import json
from subprocess import call, Popen
from time import sleep
from nosuch.oscutil import *
UseLoopMIDI = False
def killtask(nm):
call(["c:/windows/system32/taskkill","/f","/im",nm])
def mmtt_action(meth):
url = 'http://127.0.0.1:4444/dojo.txt'
params = ... |
# pylint: skip-file
"""Compute deuteron lowest energy state in 3s1 3d1 coupled channel (bound).
Computes lowest energy eigenvalue for a set of reference SRG evolved potentials
as well as the manually SRG evolved potential to show the implementation is
numerically equivalent to the reference implementation.
"""
from _... |
from math import exp, factorial as fat
def poisson(lamb, k):
return exp(-lamb) * lamb**k / fat(k)
while (True):
print('*** Calcular Distribuição de Poisson ***')
lb = float(input('Lambda (taxa média de evento ocorrer no intervalo) .....: '))
x = input("X (número de eventos [X] ou [X¹ X²] (para intervalos... |
import hashlib
import json
from http.cookies import SimpleCookie
import requests
import urllib3
TIMEOUT = 5
class QuantumGatewayScanner:
def __init__(self, host, password, use_https=True):
self.verify = False
if use_https:
self.scheme = 'https'
urllib3.disable_w... |
#
# (C) 2014-2017 Seiji Matsuoka
# Licensed under the MIT License (MIT)
# http://opensource.org/licenses/MIT
#
import pickle
import unittest
from kiwiii.stats import graphgen
data = {
"nodes": {"records": [
{"id": 1, "value": "a"},
{"id": 2, "value": "b"},
{"id": 3, "value": "c"}
]},
... |
from tornado import ioloop, web
import os
class WebServer:
"""Creates the webserver used as the control interface for dummyRDM
"""
def __init__(self):
pass
class MainHandler(web.RequestHandler):
def get(self):
self.render("templates/index.html")
def make_app(self):
... |
# Copyright 2017 Google 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 the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, softwa... |
# Copyright 2012 Google Inc. All Rights Reserved.
__author__ = '[email protected] (Ben Vanik)'
class DebuggerProtocol(object):
"""An abstract debugger protocol.
Protocols implement asynchronous command channels for controlling remote
debuggers. The debugging interface has been normalized (somewhat) and the
... |
"""Shared definitions"""
PROGRAMNAME = 'metaindexmanager'
ANY_SCOPE = 'any'
ALL_SCOPE = 'all'
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.