text stringlengths 2 999k |
|---|
'''Autogenerated by xml_generate script, do not edit!'''
from OpenGL import platform as _p, arrays
# Code generation uses this
from OpenGL.raw.GLES1 import _types as _cs
# End users want this...
from OpenGL.raw.GLES1._types import *
from OpenGL.raw.GLES1 import _errors
from OpenGL.constant import Constant as _C
... |
"""
unittests UIPro/pyodbc: issue #89 on github
"""
from __future__ import absolute_import, print_function, division
from unittest_support import IOProPyodbcTest
import unittest
import numpy as np
class TestIssue89(IOProPyodbcTest):
def test_issue_89(self):
#note that the issue results in a segfault.
... |
import torch
import torch.nn as nn
import numpy as np
import torch.nn.functional as F
from model.models import FewShotModel
class ScaledDotProductAttention(nn.Module):
''' Scaled Dot-Product Attention '''
def __init__(self, temperature, attn_dropout=0.1):
super().__init__()
self.temperature =... |
from .vis import disp_to_color, tensor_to_color, disp_err_to_color, group_color
from .show_result import ShowDisp, ShowConf, ShowResultTool
from .save_result import SaveResultTool
from .vis_hooks import DistStereoVisHook
from .sparsification_plot import sparsification_plot
|
#!/usr/bin/env python
## ! DO NOT MANUALLY INVOKE THIS setup.py, USE CATKIN INSTEAD
from distutils.core import setup
from catkin_pkg.python_setup import generate_distutils_setup
# fetch values from package.xml
setup_args = generate_distutils_setup(
packages=['rail_people_detector'],
package_dir={'': 'src'},
)... |
# Copyright (c) 2021 The sqlalchemy-bigquery Authors
#
# 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, mer... |
# This import verifies that the dependencies are available.
import sqlalchemy_pytds # noqa: F401
from .sql_common import BasicSQLAlchemyConfig, SQLAlchemySource
class SQLServerConfig(BasicSQLAlchemyConfig):
# defaults
host_port = "localhost:1433"
scheme = "mssql+pytds"
def get_identifier(self, sche... |
#!/usr/local/bin/python
# to test the embedded-code script, without the enclosing C app
import inventory # inventory, buyers
import traceback # stack dump on errors
from ordersfile import orders # [(product, quant, buyer)]
names = {} ... |
import numpy as np
import random
import cancer_data
from sklearn import tree
import time
from sklearn.model_selection import train_test_split
x = cancer_data.feature
y = cancer_data.label
seed = random.seed(1990)
X_train, X_test, y_train, y_test = train_test_split(x, y, train_size=0.70, random_state=seed)
clf = tre... |
#!/usr/bin/env python
# coding=utf-8
import numpy as np
import pandas as pd
class CalcTools(object):
@classmethod
def is_zero(cls, data_frame):
return np.where(data_frame > -0.000001,
np.where(data_frame < 0.000001, True, False)
, False)
def change_... |
import os
import unittest
from satsearch.parser import SatUtilsParser
testpath = os.path.dirname(__file__)
class Test(unittest.TestCase):
""" Test main module """
args = 'search --datetime 2017-01-01 -p eo:cloud_cover=0/20 eo:platform=landsat-8'
@classmethod
def get_test_parser(cls):
""" G... |
# coding: utf-8
# In[1]:
from __future__ import division
# # KAGGLE ONLY PURPOSES
# 2017
#
# Machine Learning Practical
#
# University of Edinburgh
#
# Georgios Pligoropoulos - s1687568
#
# Coursework 4 (part 8)
# ### Imports, Inits, and helper functions
# In[2]:
jupyterNotebookEnabled = False
plotting = F... |
#!/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.0OA
#
# Authors:
# - Wen Guan, <wen.guan@cern.ch>, 2020 - 2021
import copy
im... |
"""A `Type` and `Op` classes to work with numpy.ndarrays symbolically."""
import builtins
import logging
import numbers
import warnings
from collections.abc import Sequence
from functools import partial
import numpy as np
import theano
import theano.scalar.sharedvar
from theano import compile, config, gof, printing
... |
import glob
import shutil
from abc import ABC, abstractmethod
from pathlib import Path
from typing import List, Optional, Tuple
import cv2
import numpy as np
from albumentations import BboxParams, Compose, Resize
from pascal_voc_writer import Writer
from pydicom import dcmread
from pydicom.pixel_data_handlers.util imp... |
#!/usr/bin/env python3
#
# MIT License
#
# Copyright (c) 2020-2021 EntySec
#
# 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... |
"""
Common evaluation utilities.
"""
from collections import OrderedDict
from numbers import Number
import numpy as np
import rlkit.pythonplusplus as ppp
def get_generic_path_information(paths, stat_prefix=''):
"""
Get an OrderedDict with a bunch of statistic names and values.
"""
statistics = Orde... |
import random
import re
from streamlink.plugin import Plugin
from streamlink.plugin.api import http
from streamlink.plugin.api import validate
from streamlink.compat import urlparse, parse_qsl
from streamlink.stream import HLSStream
from streamlink.stream import HTTPStream
class LiveMe(Plugin):
url_re = re.compi... |
"Commonly-used date structures"
from google.appengine._internal.django.utils.translation import ugettext_lazy as _
WEEKDAYS = {
0:_('Monday'), 1:_('Tuesday'), 2:_('Wednesday'), 3:_('Thursday'), 4:_('Friday'),
5:_('Saturday'), 6:_('Sunday')
}
WEEKDAYS_ABBR = {
0:_('Mon'), 1:_('Tue'), 2:_('Wed'), 3:_('Thu'... |
# coding: utf-8
# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... |
# Copyright 2012 OpenStack Foundation
# 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 requ... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2019-06-16 16:45
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('photos', '0002_tags'),
]
operations = [
migr... |
#!/usr/bin/python
"""test the facility which enables usage of the with-statement
:author: `Patrick Kanzler <patrick.kanzler@fablab.fau.de>`_
:organization: `python-escpos <https://github.com/python-escpos>`_
:copyright: Copyright (c) 2016 `python-escpos <https://github.com/python-escpos>`_
:license: MIT
"""
import e... |
# coding=utf-8
import math
import os
import random
import PIL.Image
import PIL.ImageDraw
import PIL.ImageFilter
import PIL.ImageFont
import PIL.ImageOps
from . import shapes as _shapes
_SS_DICT = _shapes.supershapes_dict()
_EDGES_PER_COMPLEXITY = 400
_DEFAULT_COMPLEXITY = 1.0
_DEFAULT_FONT = os.path.join(os.path.di... |
# uncompyle6 version 2.9.10
# Python bytecode 2.7 (62211)
# Decompiled from: Python 3.6.0b2 (default, Oct 11 2016, 05:27:10)
# [GCC 6.2.0 20161005]
# Embedded file name: type_Result.py
from types import *
class Result:
def __init__(self):
self.__dict__['action'] = 0
self.__dict__['variable'] = ''... |
#!/usr/bin/env python2
# Copyright (c) 2014-2015 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""
Run Regression Test Suite
This module calls down into individual test cases via subprocess. It will
... |
"""
Tests ideas are taken mostly from https://github.com/dalab/hyperbolic_nn/blob/master/util.py with some changes
"""
import torch
import random
import numpy as np
import pytest
import warnings
import itertools
import geoopt
from geoopt.manifolds import stereographic
@pytest.fixture(scope="function", autouse=True, p... |
from django.core.exceptions import ImproperlyConfigured
class BrushfireException(Exception):
pass
class BrushfireConfigException(ImproperlyConfigured):
pass
|
from biicode.common.exception import BiiException
__author__ = 'victor'
import unittest
from biicode.common.model.brl.brl_user import BRLUser
class BRLUserTest(unittest.TestCase):
def test_simple_name(self):
_ = BRLUser("testuser1")
_ = BRLUser(" testuser2 ")
_ = BRLUser(" TestUser3 ")
... |
import numpy
import torch
from allennlp.common import Params
from allennlp.common.testing.test_case import AllenNlpTestCase
from allennlp.modules.attention.attention import Attention
from numpy.testing import assert_almost_equal
from seq2rel.modules.attention.multihead_attention import MultiheadAttention
class TestMu... |
import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
from dnc import DNC
from layers import GraphConvolution
'''
Our model
'''
class GCN(nn.Module):
def __init__(self, voc_size, emb_dim, adj, device=torch.device('cpu:0')):
super(GCN, self).__init__()
self.voc_size =... |
__all__ = ["Samsung"] |
# This is part of our final project for the Computer Networks Graduate Course at Georgia Tech
# You can take the official course online too! Just google CS 6250 online at Georgia Tech.
#
# Contributors:
#
# Akshar Rawal (arawal@gatech.edu)
# Flavio Castro (castro.flaviojr@gmail.com)
# Logan Blyth (lbly... |
from predictionserver.servermixins.memoserver import MemoServer
from predictionserver.servermixins.ownershipserver import OwnershipServer
import time
import itertools
from redis.exceptions import DataError
class PromiseDaemon(MemoServer, OwnershipServer):
def __init__(self, **kwargs):
super().__init__(**... |
class Empresa():
def __init__(self,nom="",ruc=0,dire="",tele=0,ciud="",tipEmpr=""):
self.nombre=nom
self.ruc=ruc
self.direccion=dire
self.telefono=tele
self.ciudad=ciud
self.tipoEmpresa=tipEmpr
def datosEmpresa(self):#3
self.nombre=input("Ingresar nombre ... |
# -*- coding: utf-8 -*-
"""Cisco DNA Center Sync Virtual Account Devices data model.
Copyright (c) 2019-2021 Cisco Systems.
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, in... |
import click
from parsec.cli import pass_context, json_loads
from parsec.decorators import custom_exception, json_output
@click.command('wait_for_invocation')
@click.argument("invocation_id", type=str)
@click.option(
"--maxwait",
help="Total time (in seconds) to wait for the invocation state to become termina... |
import model
import view
class SingleMove:
def __init__(self, friendly, friendly_color, enemy, enemy_color):
self.board = model.board
self.checkers = model.checkers
self.buildGame(friendly, friendly_color, enemy, enemy_color)
self.view(view.win1)
view.runAI(True)
#... |
# -*- coding: utf-8 -*-
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from fixture.session import SessionHelper
from fixture.group import GroupHelper
from fixture.contact import ContactHelper
from selenium.webdriver.support.select import Select
import re
import random
import strin... |
# Copyright (C) 2010-2011 Richard Lincoln
#
# 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, merge, publish... |
#! /usr/bin/env python3
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
import matplotlib.cm as cm
def gen_normal(size, shape=[8, 8]) :
w1 = np.random.normal(0, 0.1, size)
w1 *= 1000
np.mod(w1, 128)
w1 = w1.astype(int)
w1 = np.reshape(w1, shape)
print(w1)
return... |
from tkinter import *
root = Tk()
root.title("Listbox Demo")
def on_add():
text = txtContent.get()
listbox.insert(END, text)
def on_del():
selections = listbox.curselection()
for i in reversed(selections):
listbox.delete(i)
def on_show():
# items = [ l.split() for l in listbox.get(0, END... |
class Basic:
def __init__(self, identifier):
self._identifier = identifier
def __eq__(self, other):
return isinstance(other, Basic) and self.identifier == other.identifier
def __str__(self):
return self.identifier
@property
def identifier(self):
return self._identi... |
import torch
from ._ext import ctc_decode
class CTCBeamDecoder(object):
"""
PyTorch wrapper for DeepSpeech PaddlePaddle Beam Search Decoder.
Args:
labels (list): The tokens/vocab used to train your model.
They should be in the same order as they are in your model's outputs.... |
# ===============================================================================
# Copyright 2012 Jake Ross
#
# 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... |
from torchvision.models.detection.faster_rcnn import FasterRCNN
from torchvision.models.detection.backbone_utils import resnet_fpn_backbone
class FRCNNObjectDetector(FasterRCNN):
def __init__(self, num_classes=91, **kwargs):
backbone = resnet_fpn_backbone(backbone_name='resnet50', pretrained=False)
... |
"""
This model translates default strings into localized strings.
"""
from muddery.server.database.gamedata.honours_mapper import HONOURS_MAPPER
class HonoursHandler(object):
"""
This model stores all descriptions on all conditions.
"""
def set_honours(self, winners, losers):
"""
Set ... |
#from py_rgbd_grabber.realsense import Realsense
from py_rgbd_grabber.kinect2 import Kinect2
import time
import cv2
import numpy as np
import os
if __name__ == '__main__':
sensor = Kinect2()
# will manage the other process automagically
with sensor:
# main loop
while True:
st... |
import maya.mel as mel
from zen.isIterable import isIterable
from zen.melGlobalVar import MelGlobalVar
from zen.removeAll import removeAll
from zen.removeDuplicates import removeDuplicates
from zen.melEncode import melEncode
def deferExec(*args,**keywords):
#defaults
melCommand=False
repeatable=True
showErrors=True... |
## module polyFit
''' c = polyFit(xData,yData,m).
Returns coefficients of the polynomial
p(x) = c[0] + c[1]x + c[2]x^2 +...+ c[m]x^m
that fits the specified data in the least
squares sense.
sigma = stdDev(c,xData,yData).
Computes the std. deviation between p(x)
and the data.
''' ... |
from django.conf.urls.defaults import *
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
url(r'^$', 'bookings.views.index'),
url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
url(r'^admin/', include(admin.site.urls)),
)
|
from django.apps import AppConfig
class RiyoappConfig(AppConfig):
name = 'riyoapp'
|
# -*- coding: utf-8 -*-
import ctypes
import numpy as np
import matplotlib.pyplot as plt
import numpy.ctypeslib as ctl
import scipy.stats
from enum import Enum
from .base import SMLM, NullableFloatArrayType
from smlmlib import gaussian
from smlmlib.context import Context
from smlmlib.psf import PSF
from smlmlib.cali... |
import os
from os.path import join as join_path, abspath
from jinja2 import FileSystemLoader, Environment
SRC_DIR = os.path.dirname(__file__)
HTML_DIR = join_path(".", "html")
def renderTemplate(file_location:str, search_path:str=HTML_DIR, out_name:str=None, template_args={}):
out_name = file_location if (out_n... |
"""
Django settings for django_test project.
Generated by 'django-admin startproject' using Django 3.2.4.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.2/ref/settings/
"""
from pat... |
import http.client
import os
import requests
import json
import csv
import pandas as pd
from base64 import b64encode
conn = http.client.HTTPSConnection("opendata.aemet.es")
print("Coloque su API KEY de opendata.aemet.es\n")
api = input()
print(f"API, {api} \n")
print("Coloque el código de la estación, ejemplo de la es... |
# IMPORTATION STANDARD
# IMPORTATION THIRDPARTY
import pytest
# IMPORTATION INTERNAL
from openbb_terminal.stocks.discovery import ark_model
@pytest.fixture(scope="module")
def vcr_config():
return {
"filter_headers": [("User-Agent", None)],
"filter_query_parameters": [
("period1", "1... |
from processes.utils.propara_metadata import ProparaMetadata
# Input: Gold ProPara grids from '../../tests/fixtures/decoder_data/grids-new-format.tsv'
# Output: system output file
# format: paraid \t stepid \t participant \t before_val \t after_val
paras = dict()
metadata_file = '../../tests/fixtures/decoder... |
#!/usr/bin/env python
# =============================================================================
# MODULE DOCSTRING
# =============================================================================
"""
Test MAF layer in tfep.nn.flows.maf.
"""
# ===================================================================... |
# Import the gTTS module for text
# to speech conversion
from gtts import gTTS
# This module is imported so that we can
# play the converted audio
from playsound import playsound
# It is a text value that we want to convert to audio
text_val = 'Welcome to hacktoberfest 21.Hacktoberfest, in its 8t... |
'''
source:https://github.com/WolffyChen/PytorchToCaffe/blob/master/pytorch_to_caffe.py
'''
import torch
import torch.nn as nn
import traceback
from Caffe import caffe_net
import torch.nn.functional as F
from torch.autograd import Variable
from Caffe import layer_param
from torch.nn.modules.utils import _pair
import n... |
from register_bank import Register
from helpers import bin2dec, dec2bin
# RISC-V opcodes repo license
'''
Copyright (c) 2010-2017, The Regents of the University of California
(Regents). All Rights Reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that t... |
#==========================================================#
# Shoreline extraction from satellite images
#==========================================================#
# Kilian Vos WRL 2018
#%% 1. Initial settings
# load modules
import os
import numpy as np
import pickle
import warnings
warnings.filterwarnings("ignor... |
import numpy as np
import simphony.core as core
from simphony.core import ComponentInstance as inst
import simphony.DeviceLibrary.ebeam as dev
import simphony.DeviceLibrary.sipann as lib
import simphony.simulation as sim
import matplotlib.pyplot as plt
# --------------------------------------------------------------... |
# Copyright 2016 The TensorFlow 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 applica... |
import torch
torch.autograd.set_detect_anomaly(True)
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
# Positional encoding (section 5.1)
class Embedder:
def __init__(self, **kwargs):
self.kwargs = kwargs
self.create_embedding_fn()
def create_embed... |
# -*- coding: utf-8 -*-
"""
mundiapi
This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ).
"""
import mundiapi.models.get_recipient_response
class GetBalanceResponse(object):
"""Implementation of the 'GetBalanceResponse' model.
Balance
Attributes:
... |
import time
import datetime
import os
import shutil
import logging
from json import loads
from pygit2 import Repository, discover_repository, init_repository #pylint: disable=E0611
import requests as req
from .git import GitClient
from .gogs import GitApi
logger = logging.getLogger(__name__)
UPDATE_INTERVAL = datet... |
"""test utilities
(part of web.py)
"""
import unittest
import sys, os
import web
TestCase = unittest.TestCase
TestSuite = unittest.TestSuite
def load_modules(names):
return [__import__(name, None, None, "x") for name in names]
def module_suite(module, classnames=None):
"""Makes a suite from a module."""
... |
import numpy as np
__all__ = ["fig2tensor"]
def fig2tensor(fig):
"""
Convert matplotlib figure to a tensor
:param fig: figure object
:return: image tensor
"""
fig.canvas.draw()
img = np.frombuffer(fig.canvas.tostring_rgb(), dtype=np.uint8)
img = np.expand_dims(
img.reshape(fig... |
from dependency_management.requirements.ExecutableRequirement import (
ExecutableRequirement)
from dependency_management.requirements.PlatformRequirement import (
PlatformRequirement)
from dependency_management.requirements.Command import (
Command)
class PortageRequirement(PlatformRequirement):
"""
... |
# Generated by Django 3.1.5 on 2021-01-26 16:28
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('giris', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='satıs',
name='adres',
field... |
# Copyright 2015 The TensorFlow 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 applica... |
"""
This module provies a Nobeyama Radioheliograph `~sunpy.timeseries.TimeSeries`
source.
"""
from collections import OrderedDict
import matplotlib.pyplot as plt
import numpy as np
import pandas
import astropy.units as u
from astropy.time import TimeDelta
import sunpy.io
from sunpy import config
from sunpy.time impo... |
#!/usr/bin/env python3
# Copyright (c) 2014-2018 The Bitsend Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test mempool re-org scenarios.
Test re-org scenarios with a mempool that contains transactions
that sp... |
#!/usr/bin/env python3
import re
from ranking.management.modules.common import REQ, BaseModule, parsed_table
from ranking.management.modules.excepts import ExceptionParseStandings
class Statistic(BaseModule):
def get_standings(self, users=None, statistics=None):
season = self.get_season()
def ... |
#!/usr/bin/python3
import requests
import json
from datetime import date
import psycopg2
from psycopg2.errors import UniqueViolation
def InsertSQL(movie):
global cursor
#Movies
genres=movie.pop('genres')
#JSON atrs
movie['belongs_to_collection']=json.dumps(movie['belongs_to_collection'])
m... |
"""
This file was autogenerated based on code in ubelt
"""
from os.path import abspath
from os.path import exists
from os.path import expanduser
from os.path import isdir
from os.path import join
import os
from os.path import split
from os.path import dirname
from os.path import relpath
from os.path import splitext
fro... |
# coding=UTF-8
import h5py
import numpy as np
import json
from DataClass.BassClass.ReaderBase import *
'''
MDFReader.py: Access measurement data from a MDF file.
'''
class ComplexEnconding(json.JSONEncoder):
def default(self, o):
if isinstance(o, complex):
return "{real}+{image}i".format(real... |
"""Run the simple SAT solver on the binary case of van der waerden's problem.
This problem asks for the smallest number n so that a binary number of n digits
that contains either j digits 0 or k digits 1, for given integers j and k.
"""
from __future__ import division
def _van_der_waerden_helper(j, n, sign):
cl... |
import string
import sys
import json
import cPickle as pickle
from common import keyify,readTable,getFormats
from TierUpdate import makeTable
tiers = ['Uber','OU','BL','UU','BL2','RU','BL3','NU','BL4','PU']
file = open('keylookup.pickle')
keyLookup = pickle.load(file)
file.close()
def getUsage(filename,col,weight,us... |
"""The client and server for a basic ping-pong style heartbeat.
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2008-2010 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distributed as pa... |
# -*- coding: utf-8 -*-
"""
Created on Tue May 26 13:17:06 2020
@author: Chandan
"""
import engine as en
from engine import Engine, wait_for_command
import query
import process
ass = Engine()
ass.engine_rate(210)
def listen():
command = en.wait_for_command()
try:
result = None
if query... |
# -*- coding: utf-8 -*-
# Copyright 2011 Google 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-2.0
#
# Unless require... |
from django.conf.urls import url
from . import views
urlpatterns = [
url(r"^addpoly/$", views.add_poly, name="addpoly"),
url(r"^getpoints/$", views.get_points, name="getpoints"),
url(r"^getele/$", views.get_ele, name="getele"),
url(r"^delroute/$", views.delete_route, name="delroute"),
url(r"^delp... |
SECP256K1_p = (
0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f
)
SECP256K1_a = (
0x0000000000000000000000000000000000000000000000000000000000000000
)
SECP256K1_b = (
0x0000000000000000000000000000000000000000000000000000000000000007
)
SECP256K1_xG = (
0x79be667ef9dcbbac55a06295ce870b... |
import random
random. |
# -*- coding: utf-8 -*-
# Copyright (C)2014 DKRZ GmbH
"""Recipe r"""
import os
from mako.template import Template
from birdhousebuilder.recipe import conda
r_install_script = Template(
"""
% for pkg in pkg_list:
install.packages("${pkg}", dependencies = TRUE, repo="${repo}")
% endfor
"""
)
def install_pkgs(pkgs, r... |
# coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
from __future__ import unicode_literals, division, print_function
from pymatgen.util.testing import PymatgenTest
from pymatgen.core.lattice import Lattice
from pymatgen.core.structure import Structure
from pym... |
def fabo(num):
def fb(n):
if n <= 0:
print("Enter a valid number")
elif n == 1:
return 0
elif n == 2:
return 1
else:
return(fb(n-1)+fb(n-2))
return num(n)
return fb
@fabo
def fb_num(n):
print(n,"this is t... |
from django.db import migrations
def create_site(apps, schema_editor):
Site = apps.get_model("sites", "Site")
custom_domain = "prtowingllc-34237.botics.co"
site_params = {
"name": "Prtowingllc",
}
if custom_domain:
site_params["domain"] = custom_domain
Site.objects.update_or_... |
from setuptools import find_packages, setup
setup(
name='mpc',
version='0.0.3',
description="A fast and differentiable MPC solver for PyTorch.",
author='Brandon Amos',
author_email='brandon.amos.cs@gmail.com',
platforms=['any'],
license="Apache 2.0",
url='https://github.com/locuslab/mpc... |
# coding: utf-8
"""
Copyright 2016 SmartBear Software
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 applica... |
"""
Reset only the mode inference objects
This helps us experiment with different mode inference methods without
resetting the entire pipeline.
Useful while mode inference is the most recent data object, and we need to
experiment with it to make it better.
"""
"""
This is similar to `bin/reset_pipeline.py` but *much* ... |
# -*- coding: utf-8 -*-
"""
pygments.lexers.inferno
~~~~~~~~~~~~~~~~~~~~~~~
Lexers for Inferno os and all the related stuff.
:copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from testflows._core.contrib.pygments.lexer import... |
from coincurve import PrivateKey
from eth_utils import remove_0x_prefix
def sign(privkey: str, msg: bytes, v=0) -> bytes:
assert isinstance(msg, bytes)
assert isinstance(privkey, str)
pk = PrivateKey.from_hex(remove_0x_prefix(privkey))
assert len(msg) == 32
sig = pk.sign_recoverable(msg, hasher=... |
import os
import re
import sys
import platform
import subprocess
from setuptools import setup, Extension, find_packages
from setuptools.command.build_ext import build_ext
from distutils.version import LooseVersion
with open('README.rst') as f:
readme = f.read()
class CMakeExtension(Extension):
def __init__... |
# class Solution:
# def intersect(self, nums1: List[int], nums2: List[int]) -> List[int]:
# interArray = []
# for i in nums1:
# if i in nums2:
# interArray.append(i)
# nums2.remove(i)
# return interArray
# Fast version:
# from c... |
import sys
import time
import numpy
import os
import subprocess
import win32api
__job = None
def win32_limit(max_memory: int = None, max_processes: int = None):
"""
Sets per-process limits on Windows systems.
WARNING: Currently creates a single job, so affects all spawned processes.
"""
# check... |
# Pyrogram - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-2020 Dan <https://github.com/delivrance>
#
# This file is part of Pyrogram.
#
# Pyrogram is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.