src
stringlengths
721
1.04M
from __future__ import absolute_import from __future__ import unicode_literals import pytest from git_code_debt.file_diff_stat import FileDiffStat from git_code_debt.metric import Metric from git_code_debt.metrics.imports import CheetahTemplateImportCount from git_code_debt.metrics.imports import is_python_import fro...
#! /usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### ## ## ## Copyright 2010-2012, Neil Wallace <neil@openmolar.com> ## ## ...
# Copyright (c) 2021, NVIDIA 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/licenses/LICENSE-2.0 # # Unless required by applic...
import logging import os from scrapy import signals from scrapy.exceptions import NotConfigured from logentries import LogentriesHandler from logentriesadapter import LogentriesAdapter, ScrapingHubFilter logger = logging.getLogger(__name__) class LogentriesExtension(object): def __init__(self, token): ...
import numpy as np import glob import dpcluster as dpc import pandas as pd import os import sys try: import matplotlib.pylab as plt import matplotlib as mpl except Exception, e: sys.stderr.write("Matplotlib is not available!") def loadData(filename, format="rttEstimate"): """Load a csv file in me...
#!/usr/bin/env python3 #title : distribution.py #description : Imports distributions and defines their default settings. #author : Enys Mones #date : 2015.06.20 #version : 0.1 #usage : python distribution.py #=================================================================...
from cloudshell.workflow.orchestration.sandbox import Sandbox from cloudshell.workflow.orchestration.teardown.default_teardown_logic import DefaultTeardownLogic class DefaultTeardownWorkflow(object): def __init__(self): pass def register(self, sandbox): """ :param Sandbox sandbox: ...
import numpy as np from theano.tensor import as_tensor_variable from ContinuousTimeMarkovModel.distributions import * from pymc3 import Model, sample, Metropolis, Dirichlet, Potential, Binomial, Beta, Slice, NUTS import theano.tensor as TT from ContinuousTimeMarkovModel.samplers.forwardS import * from ContinuousTimeMar...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Generate Kate syntax file for CMake # # Copyright (c) 2017-2019 Alex Turbov <i.zaufi@gmail.com> # # To install prerequisites: # # $ pip install --user click jinja2 yaml # # To use: # # $ ./generate-cmake-syntax.py cmake.yaml > ../syntax/cmake.xml # import click imp...
# This file is part of django-ca (https://github.com/mathiasertl/django-ca). # # django-ca is free software: you can redistribute it and/or modify it under the terms of the GNU # General Public License as published by the Free Software Foundation, either version 3 of the # License, or (at your option) any later version...
# coding: utf-8 class Services: USERS = 'Users' class Slugs: LOGIN = 'login' LOGOUT = 'logout' REMINDER_NEW_PASSWORD = 'reminder-new-password' CHANGE_PASSWORD = 'change-password' SIGNUP = 'signup' ACTIVATION_USER = 'activation-user' HOME_LOGIN = 'in' SITE = 'site' ...
import json from flask import Flask, request, current_app, render_template, redirect, url_for from signinghub_api import SigningHubAPI # Create a web application with Flask app = Flask(__name__) # Copy local_settings.py from local_settings_example.py # Edit local_settings.py to reflect your CLIENT_ID and CLIENT_SECRE...
# 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, ...
######### # Copyright (c) 2015 GigaSpaces Technologies Ltd. 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...
#------------------------------------------------------------------------------- # Copyright 2017 Cognizant Technology Solutions # # 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:/...
#https://stackoverflow.com/questions/25944883/how-to-send-an-email-through-gmail-without-enabling-insecure-access #several modificatons to original code, change body line as per comment #change from flow to run_flow #this is working now! Yay the modifications worked #you have to do an email confirmation im...
#!/usr/bin/env python from nose.tools import * from sensors import nmap,adns,apt,cpuload,cputemp def test_nmap_get_kind(): """nmap returns the correct kind""" test_nmap = nmap.NMAP() assert_equal(test_nmap.get_kind(), 'mpnmap') def test_nmap_icmp_echo_request(): """nmap const ICMP_ECHO_REQUEST is set...
"""Unit Test with pytest""" from unittest import mock import pytest from openid_wargaming.authentication import Authentication @pytest.fixture @mock.patch('openid_wargaming.authentication.create_return_to') def auth(mock_requests): mock_requests.return_value = 'http://somewhere' return Authentication() @m...
# This file is part of the TREZOR project. # # Copyright (C) 2012-2016 Marek Palatinus <slush@satoshilabs.com> # Copyright (C) 2012-2016 Pavol Rusnak <stick@satoshilabs.com> # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as pu...
from urllib.request import urlopen import time import numpy as np BASE_URL = 'https://ca.finance.yahoo.com/' powers = {'%': 10 ** (-2), 'M': 10 ** 6, 'B': 10 ** 9, 'T': 10 ** 12} def getUnixTime (dateTime): return int(time.mktime(dateTime.timetuple())) def parse_powers(x): power = x[-1] if (power in pow...
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014, 2015 CERN. # # Invenio is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of the # Li...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Author:Renato Arnellas Coelho renatoac at gmail dot com # # Script to update Sicol database # # Warning: # 1 - Add MySQL executable directory to system's PATH environment variable # 2 - This script _MUST_ be executed on root directory def updateDB(full_mode=True)...
# MONITOR BUTIA # FING # GRUPO 9 # 2015 from __future__ import division from monitor import ERROR_BOARD_DISCONECTED from monitor import ERROR_MODULE_NOT_PRESENT from monitor import ERROR_EXCEPTION from monitor import ERROR from monitor import MONITOR_COLOR_NO_ERR from monitor import MONITOR_RETURN_TYPE_LOW from monitor...
from __future__ import print_function from numpy.random import seed seed(1) import numpy as np import matplotlib matplotlib.use('Agg') from matplotlib import pyplot as plt import os import h5py import scipy.io as sio import cv2 import glob import gc from keras.models import load_model, Model, Sequential from keras.lay...
from PyQt5 import QtCore class QObjectListModel(QtCore.QAbstractListModel): """ QObjectListModel provides a more powerful, but still easy to use, alternative to using QObjectList lists as models for QML views. As a QAbstractListModel, it has the ability to automatically notify the view of specific cha...
# -*- coding: utf-8 -*- """ A file compress utility module. You can easily programmatically add files and directorys to zip archives. And compress arbitrary binary content. - :func:`zip_a_folder`: add folder to archive. - :func:`zip_everything_in_a_folder`: add everything in a folder to archive. - :func:`zip_many_fil...
#/bin/env python import urllib, json, datetime from xml.parsers import expat class c4s : def __init__(self): self.cvmfsBaseVersionFile = 'cvmfsVersion.txt' self.requestedVersion = '' self.myVO = 'LHCb' self.cvmfsColumnNo = 202 self.wlcgTopoColumnNo = 144 self.topoDict = {'WLCG':{}, self.myV...
# -*- coding: utf-8 -*- ############################################################################## # # Swiss Postfinance File Delivery Services module for Odoo # Copyright (C) 2015 Compassion CH # @author: Nicolas Tran # # This program is free software: you can redistribute it and/or modify # it unde...
"""distutils.unixccompiler Contains the UnixCCompiler class, a subclass of CCompiler that handles the "typical" Unix-style command-line C compiler: * macros defined with -Dname[=value] * macros undefined with -Uname * include search directories specified with -Idir * libraries specified with -lllib * library...
import theano import numpy import os from theano import tensor as T from collections import OrderedDict from utils.tools import numpy_floatX class LSTM(object): def __init__(self, nh, nc, de, cs, ne_char=None, de_char=None, ne_src=None, ne_tgt=None, emb_src=None, emb_tgt=None, max_char=10): ...
# 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, software # d...
""" SD_AddSnippet Add a snippet to local/global database. A new snippet is defined by: - snippet name: directly taken from the name of the function - snippet description: taken from the comment (if there's one) of the function - syntactic and semantic by...
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2012-2013 University of Dundee & Open Microscopy Environment # All Rights Reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundat...
# -*- coding: utf-8 -*- """ Copyright (c) 2015 Red Hat, Inc All rights reserved. This software may be modified and distributed under the terms of the BSD license. See the LICENSE file for details. """ from __future__ import unicode_literals, absolute_import import os from textwrap import dedent HERE = os.path.dirna...
#!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################ # # MODULE: v.random.probability # AUTHOR(S): Anna Petrasova # PURPOSE: Generates random vector points based on probability raster # COPYRIGHT: (C) 2013 by the GRASS Development Team # # ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # 1 2 3 4 5 6 7 8 9 9 # 3456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 """ Packs all Python executable scripts and modules into executable...
#!/usr/bin/python2 # This only runs under Python2 import math import time import random import datetime from node import Node from node import length from node import total_length from node import dump import matplotlib.pyplot as plt import numpy l_min = None pic = 0 # v = [-100,4100,-100,2100] def framec( solution...
# Copyright(c) Maxim Kolosov 2009-2013 pyirrlicht@gmail.com # http://pybass.sf.net # BSD license __version__ = '0.5.5' __versionTime__ = '2013-11-29' __author__ = 'Maxim Kolosov <pyirrlicht@gmail.com>' __doc__ = ''' pybass.py - is ctypes python module for BASS (http://www.un4seen.com). BASS is an audio libr...
# -*- coding: utf-8 -*- from __future__ import unicode_literals import json from collections import OrderedDict from django.core.urlresolvers import reverse from django.db import models from django.db.transaction import atomic from django.template.defaultfilters import slugify from django.utils.crypto import get_rand...
#Noughts and crosses board = ['1','2','3','4','5','6','7','8','9'] player1char = 'X' player2char = 'O' def show_board (): """Loops through the board list to display the players' positions""" counter = 1 linecounter = 1 line = '' for item in board: line = line + item #Add the ve...
import logging from remoto import Connection from .registers import registered_services from ics_demo.dao import host_dao from ics_demo.helpers.exc import DuplicatedError, AlreadyExistsError, NotFoundError, InconsistentError from ics_demo.helpers.base import uuidgen, valid_ipaddr from ics_demo.helpers.remotes import ...
import os import sys import time import logging import tempfile import threading if sys.version_info[0] == 2: sys.path.insert( 0, os.path.join(os.path.dirname(__file__), "..", "lib", "python2")) from SimpleXMLRPCServer import SimpleXMLRPCServer from xmlrpclib import Binary else: sys.path.insert...
from datetime import datetime from io import StringIO import itertools import numpy as np import pytest import pandas.util._test_decorators as td import pandas as pd from pandas import ( DataFrame, Index, MultiIndex, Period, Series, Timedelta, date_range, ) import pandas._testing as tm ...
import math def suma_digitos(numero): suma = 0 while numero > 0: suma = suma + numero%10 numero = numero // 10 return suma def esPrimo(n): i = 1 divisores = 0 while i <= n: if n%i == 0: divisores = divisores + 1 i = i + 1 return divisores == 2 ...
# -*- coding: utf-8 -*- # Copyright 2012 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...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # ****************************************************************************** # $Id: gdal2tiles.py d712a530aa1b0dabf9717dd935996dd7b9fd8ced 2020-11-15 15:12:13 +0100 Even Rouault $ # # Project: Google Summer of Code 2007, 2008 (http://code.google.com/soc/) # Support: ...
from pytest import mark from joblib import Memory import numpy as np from lap import lapjv, lapmod from lap.lapmod import get_cost try: from lap_old import lapjv as lapjv_old except ImportError: print( '''If you get here, you do not have the old lapjv to compare to. git clone git@github...
#!/usr/bin/env python # Get the issuers for the supplied certificates from the AIA # extension. Note that this is not very clever and may supply # intermediates that are not needed and fail to supply intermediates # that are needed. # Based on pyasn1 example code. from __future__ import print_function from base64 im...
import os import platform import subprocess import datetime as dt import time import calendar import sys # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # General Parameters - Tools - Proxy Network - Output Directory # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Path declarati...
from src.common.Observable import* from src.game.AttackSpell import * from src.game.AttackWeapon import * from src.game.Attributes import * from src.game.visit import * from src.game.Heroes import * #from src.game.AttackInventory import* from random import* class Creatures(Observable, GameAttributes, Visitor): de...
#!/usr/bin/env python ''' usage: booklet.py my.pdf Uses Form XObjects and reportlab to create booklet.my.pdf. Demonstrates use of pdfrw with reportlab. ''' import sys import os from reportlab.pdfgen.canvas import Canvas import find_pdfrw from pdfrw import PdfReader from pdfrw.buildxobj import pagexobj from pd...
# Copyright 2015 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 required by applicable law or a...
# -*- coding: utf-8 -*- ############################################################################### # # Copyright (C) 2001-2014 Micronaet SRL (<http://www.micronaet.it>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License a...
# Copyright (C) 2013-2014 Fox Wilson, Peter Foley, Srijay Kasturi, Samuel Damashek, James Forcier and Reed Koser # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the Licen...
from yowsup.common import YowConstants from yowsup.layers import YowLayerEvent, YowProtocolLayer from .keystream import KeyStream from yowsup.common.tools import TimeTools from .layer_crypt import YowCryptLayer from yowsup.layers.network import YowNetworkLayer from .autherror import AuthError from .protocolentities imp...
# python implemented queue ADT # A new exception class defined for handling empty errors class Empty(Exception): ''' Error attempting to access an element from an empty container. ''' pass class ArrayQueue: '''FIFO queue implementation using a python list as underlying storage.''' DEFAULT_CAPA...
#!/usr/bin/env python ##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ##~ Copyright (C) 2002-2004 TechGame Networks, LLC. ##~ ##~ This library is free software; you can redistribute it and/or ##~ modify it under the terms of the BSD style License as found in the ##~ LICENSE file included with this distribution....
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2016 CERN. # # Invenio is free software; you can redistribute it # and/or modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of the # License, or (at your option) any later...
#-*- coding: utf-8 -*- import urllib2 import re import CommonFunctions common = CommonFunctions from resources.lib import utils from resources.lib import globalvar import json title=['RMC Decouverte'] img=['rmcd'] readyForUse=True url_video_json='https://edge.api.brightcove.com/playback/v1/accounts/%s/vi...
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import unicode_literals import codecs import os from setuptools import find_packages, setup def read(file_name): file_path = os.path.join(os.path.dirname(__file__), file_name) with codecs.open(file_path, encoding='utf-8') as open_file: re...
""" CleverWrap.py Python wrapper for Cleverbot's API. http://www.cleverbot.com/api Copyright 2017 Andrew Edwards 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 witho...
# coding: utf-8 """ Wavefront REST API <p>The Wavefront REST API enables you to interact with Wavefront servers using standard REST API tools. You can use the REST API to automate commonly executed operations such as automatically tagging sources.</p><p>When you make REST API calls outside the Wavefront REST ...
'''Implements the Cloud.com API''' from cloudtool.utils import describe import urllib import urllib2 import os import xml.dom.minidom class CloudAPI: @describe("server", "Management Server host name or address") @describe("responseformat", "Response format: xml or json") def __init__(self, server="127.0.0...
import numpy as np import os import random from collections import defaultdict, Counter from sklearn.utils import resample, shuffle import math def createFeatures(dataWin1, dataWin2, dataWin3): # given three raw data windows compute velocity accelaration # and change in direction vecData = np.array(np...
import sys import struct import binascii import argparse import tftp from tftp import SocketBase from tftp import get_opcode from tftp import default_port from tftp import make_data_packet from tftp import make_ack_packet class State(object): START, DATA = range(2) # Make packet functions. def make_request_pa...
#!/usr/bin/env python # -.- coding: utf-8 -.- # Author : Deniz Turgut # Created : 09.02.2012 from collections import namedtuple from PyQt4 import QtGui, QtCore # each group item has a 'name' and a list of 'children' consisting # of each child's QPersistentModelIndex (pmi) groupItem = namedtuple('groupItem',['name', ...
from django.shortcuts import get_object_or_404 import django_filters from funfactory.urlresolvers import reverse from rest_framework import viewsets, serializers from rest_framework.response import Response from mozillians.common.helpers import absolutify from mozillians.groups.models import Group, GroupMembership, S...
# This file is generated by codegen.py. DO NOT EDIT! from __future__ import annotations import uuid from typing import TYPE_CHECKING, Callable, List, Optional from gaphor.core.modeling.element import Element from gaphor.core.modeling.properties import ( association, attribute, derived, derivedunion, ...
from webpay.model.card import Card from .model import Model class Charge(Model): def __init__(self, client, data): Model.__init__(self, client, data) def _instantiate_field(self, key, value): if key == 'card': return Card(self._client, value) else: return Mode...
#!/usr/bin/python2 from gevent import monkey monkey.patch_all() import platform import subprocess from threading import Thread import time from datetime import timedelta from flask import Flask, render_template, send_from_directory from flask.ext.socketio import SocketIO, emit, disconnect app = Flask(__name__) socket...
__author__ = "Berserker66" langversion = 1 langname = "English" ##updater # text construct: "Version "+version+available+changelog #example: Version 3 available, click here to download, or for changelog click here available = " available, click here to download" changelog = ", or for changelog click here" ##world ge...
""" Experiment stop (experiment_stop.py) This script takes a video and calculates the frame number of when the experiment was stopped, based on overall pixel changes. D.Goldschmidt - 09/08/16 """ import warnings warnings.filterwarnings("ignore") import numpy as np import cv2 import os import matplotlib.pyplot a...
import os from unipath import Path from ..util import admin_emails from django.conf import global_settings # Repository root is 4 levels above this file REPOSITORY_ROOT = Path(__file__).ancestor(4) # This is the root of the Django project, 'cfgov' PROJECT_ROOT = REPOSITORY_ROOT.child('cfgov') V1_TEMPLATE_ROOT = PROJ...
#!/usr/bin/env python from model import Model from model import DupValues from model import DistTypes from model import ObjType import allocator import bounds from allocator import DoesNotExistException import argparse import random import time import csv import sys current_ms_time = lambda: int(round(time.time() * ...
#!/usr/bin/python #-------------------------------------------------------------------------------------------------- # vulnerabilities.py: Python module used by CveAdvisory.py #-------------------------------------------------------------------------------------------------- #import sqlite3 as lite #from vfeed import ...
#!/usr/bin/env python """Types-related part of GRR API client library.""" from grr_api_client import utils from grr.proto import api_pb2 from grr.proto import flows_pb2 class Error(Exception): pass class UnknownFlowName(Error): pass class Types(object): """Object that helps users to deal with GRR type sys...
#!/usr/bin/env python # Unladen # Copyright (C) 2014 Ryan Finnie # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # ...
# Input Daemon for the Visually Impared # For use with a device that outputs serial import uinput #interface between python and the uinput kernel module import time #for time.sleep() import serial #the keyboard this program interfaces with uses serial import os import sys # Easier debugging :^) class termcolour: ...
# Licensed to Tomaz Muraus under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # Tomaz muraus licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use this file except in...
# Copyright 2021 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 or agreed to in writing, ...
from spinoff.util.testing import assert_not_raises from spinoff.util.pattern_matching import match, ANY, IGNORE, IS_INSTANCE, NOT FLATTEN = True def NO(outlen, pattern, data): x = match(pattern, data, flatten=FLATTEN) assert not x[0] if isinstance(x, tuple) else not x, x if FLATTEN: assert isin...
"""Photo service.""" import json import base64 from six import PY2 # fmt: off from six.moves.urllib.parse import urlencode # pylint: disable=bad-option-value,relative-import # fmt: on from datetime import datetime from pyicloud.exceptions import PyiCloudServiceNotActivatedException from pytz import UTC class Photo...
# -*- coding: utf-8 -*- # # Copyright 2016, 2017 Ramil Nugmanov <stsouko@live.ru> # This file is part of MWUI. # # MWUI is free software; you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation; either version 3 of the Licen...
from __future__ import print_function # Python 2/3 compatibility import boto3 import json import uuid import time import decimal dynamodb = boto3.resource('dynamodb', region_name='us-east-1') sec_table = dynamodb.Table('Securities') quotes_table = dynamodb.Table('Quotes.EOD') with open("quotes.json") as json_file: ...
# coding=utf-8 import re original_names_string = '่’ธ็พŠ็พ”ใ€่’ธ็†ŠๆŽŒใ€่’ธ้นฟๅฐพๅ„ฟใ€็ƒง่Šฑ้ธญใ€็ƒง้›้ธกๅ„ฟใ€็ƒงๅญ้น…ใ€ๅค็…ฎๅ’ธ้ธญใ€้…ฑ้ธกใ€่…Š่‚‰ใ€ๆพ่Šฑใ€ๅฐ่‚šๅ„ฟใ€ๆ™พ่‚‰ใ€้ฆ™่‚ ใ€ไป€้”ฆ่‹็›˜ใ€็†้ธกใ€็™ฝ่‚šๅ„ฟใ€ๆธ…่’ธๅ…ซๅฎ็Œชใ€ๆฑŸ็ฑณ้…ฟ้ธญๅญใ€็ฝๅ„ฟ้‡Ž้ธกใ€็ฝๅ„ฟ้นŒ้น‘ใ€ๅคไป€้”ฆใ€ๅคๅญ้น…ใ€ๅค่™พใ€็ƒฉ่™พใ€็‚่™พไปๅ„ฟใ€ๅฑฑ้ธกใ€ๅ…”่„ฏใ€่œ่Ÿ’ใ€้“ถ้ฑผใ€ๆธ…่’ธๅ“ˆไป€่š‚ใ€็ƒฉ้ธญ่…ฐๅ„ฟใ€็ƒฉ้ธญๆกๅ„ฟใ€ๆธ…ๆ‹Œ้ธญไธๅ„ฟใ€้ป„ๅฟƒ็ฎกๅ„ฟใ€็„–็™ฝ้ณใ€็„–้ป„้ณใ€่ฑ†้ผ“้ฒ‡้ฑผใ€้”…็ƒง้ฒ‡้ฑผใ€็ƒ€็šฎ็”ฒ้ฑผใ€้”…็ƒง้ฒค้ฑผใ€ๆŠ“็‚’้ฒค้ฑผใ€่ฝฏ็‚ธ้‡Œ่„Šใ€่ฝฏ็‚ธ้ธกใ€ไป€้”ฆๅฅ—่‚ ใ€้บป้…ฅๆฒนๅทๅ„ฟใ€็†˜้ฒœ่˜‘ใ€็†˜้ฑผ่„ฏๅ„ฟใ€็†˜้ฑผ็‰‡ๅ„ฟใ€็†˜้ฑผ่‚šๅ„ฟใ€้†‹็†˜่‚‰็‰‡ๅ„ฟใ€็†˜็™ฝ่˜‘ใ€็ƒฉไธ‰้ฒœใ€็‚’้“ถ้ฑผใ€็ƒฉ้ณ—้ฑผใ€ๆธ…่’ธ็ซ่…ฟใ€็‚’็™ฝ่™พใ€็‚้’่›คใ€็‚’้ข้ฑผใ€็‚่Šฆ็ฌ‹ใ€่Š™่“‰็‡•่œใ€็‚’่‚ๅฐ–ๅ„ฟใ€ๅ—็‚’...
import sys sys.path.append("/Users/Prerna/Desktop/Prerna/NTU/Courses-Year4-Sem1/NLP/SemEval15/code"); import extractTypes #importing file for extracting types from input from collections import OrderedDict # OrderedDict to sort feature names in dictionary struct #filename = "test_input.tsv"; #filename = "../...
""" Tahmatassu Web Server ~~~~~~~~~~~~~~~~~~~~~ File upload and listing related utility functions :copyright: (c) 2014 by Teemu Puukko. :license: MIT, see LICENSE for more details. """ from os import listdir from os.path import isfile, join from app import app def file_suffix(filename): parts = filename.rsplit('.', ...
# 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, software # distributed under the Li...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import functools import operator import numpy as np from .. import Variable from ..conventions import pop_to from ..core import indexing from ..core.utils import (FrozenOrderedDict, NdimSizeLenMixin, ...
# -*- coding: utf-8 -*- """ Django settings for qoala project. For more information on this file, see https://docs.djangoproject.com/en/1.6/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.6/ref/settings/ """ # Build paths inside the project like this: os.path....
import os.path as op from functools import wraps from flask import Blueprint, current_app, render_template, abort, g, url_for from flask_admin import babel from flask_admin._compat import with_metaclass, as_unicode from flask_admin import helpers as h # For compatibility reasons import MenuLink from flask_admin.menu...
# v0.2 obtained on March 12, 2019 """ Modification of Chris Beaumont's mpl-modest-image package to allow the use of set_extent. """ from __future__ import print_function, division import matplotlib rcParams = matplotlib.rcParams import matplotlib.image as mi import matplotlib.colors as mcolors import matplotlib.cbook...
# This file is part of Pimlico # Copyright (C) 2020 Mark Granroth-Wilding # Licensed under the GNU LGPL v3.0 - https://www.gnu.org/licenses/lgpl-3.0.en.html from __future__ import print_function from pimlico.cli.subcommands import PimlicoCLISubcommand from pimlico.utils.email import send_pimlico_email class EmailCm...
#!/usr/bin/python # -*- coding: utf-8 -*- from Tkinter import * import Tkinter as tk from tkFont import Font import ttk from lectures_sensor import PowerServer from database import Database import time import commands import os class Tkinter(object): def __init__(self): super(Tkinter, self)...
import asyncio from . import contexts from . import log BUF_SIZE = 2**13 _logger = log.pkg_logger.getChild('relay') async def _relay_data_side( reader: asyncio.StreamReader, writer: asyncio.StreamWriter, ) -> None: """Pass data and EOF from reader to writer.""" while True: buf = awa...
import time from random import random, randint, choice from direct.directnotify import DirectNotifyGlobal from direct.task import Task from toontown.battle import SuitBattleGlobals from toontown.toonbase.ToontownGlobals import IDES_OF_MARCH import SuitDNA from SuitInvasionGlobals import * class SuitInvasionManagerAI:...
import csv from .abstractwriter import AbstractWriter from cutevariant.core.sql import get_samples class PedWriter(AbstractWriter): """Writer allowing to export samples of a project into a PED/PLINK file. Attributes: device: a file object typically returned by open("w") Example: >>> wi...
""" ======================================================== Compute real-time evoked responses with FieldTrip client ======================================================== This example demonstrates how to connect the MNE real-time system to the Fieldtrip buffer using FieldTripClient class. This example was tested ...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 OpenStack 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 requ...