text
string
size
int64
token_count
int64
import warnings from django.test import SimpleTestCase from django.utils.deprecation import RemovedInDjango20Warning from django.utils.safestring import mark_safe from ..utils import render, setup class UnorderedListTests(SimpleTestCase): @setup({'unordered_list01': '{{ a|unordered_list }}'}) def test_unor...
3,833
1,486
import numpy as np import nltk import re import pandas as pd import sys import pickle from sklearn.pipeline import Pipeline from sklearn.metrics import classification_report from sklearn.model_selection import train_test_split from sklearn.multioutput import MultiOutputClassifier from sklearn.ensemble import RandomFore...
5,218
1,587
#!/usr/bin/python # -*- coding: utf-8 -*- # # getauditrecords.py January 2020 # # Extract list of audit records from SAS Infrastructure Data Server using REST API. # # Examples: # # 1. Return list of audit events from all users and applications # ./getauditrecords.py # # Change History # # 10JAN2020 Comments ad...
3,850
1,262
""" File contains handler for ReferenceDataRequest """ import asyncio import uuid from typing import Dict from typing import List from .base_handler import HandlerBase from .base_request import RequestBase from .requests import Subscription from .utils.blp_name import RESPONSE_ERROR from .utils.log import get_logger ...
6,345
1,670
import cytochrome_lib #This is a cytochrome library import matplotlib.pyplot as plt import numpy as np version = "Last update: Aug 8, 2017" desription = "This code calculates population distribution in the cytochrome b6f protein and plots kinetic profiles for two different models: \n'nn' and 'np' models \n The outpu...
4,759
2,246
from __future__ import unicode_literals from django.conf import settings try: from django.contrib.contenttypes.fields import GenericForeignKey except ImportError: from django.contrib.contenttypes.generic import GenericForeignKey from django.contrib.contenttypes.models import ContentType from django.db import m...
10,062
2,850
from math import floor import pandas as pd def filter_param_cd(df, code): """Return df filtered by approved data """ approved_df = df.copy() params = [param.strip('_cd') for param in df.columns if param.endswith('_cd')] for param in params: #filter out records where param_cd doesn't cont...
3,684
1,218
import json import requests import pandas as pd import websocket # Get Alpaca API Credential endpoint = "https://data.alpaca.markets/v2" headers = json.loads(open("key.txt", 'r').read()) def hist_data(symbols, start="2021-01-01", timeframe="1Hour", limit=50, end=""): """ returns historical b...
3,681
1,199
import asyncio from yaps.api import protocol from yaps.utils.log import Log SLEEP_SLOT_TIME = 1 # In seconds. class State: PING_PONG = 1 PING_PONG_1_MISS = 2 PING_PONG_2_MISS = 3 class Subscription: """ Abstraction for handling a subscription. This class has utilites that ...
4,420
1,265
import pickle bad_fid = pickle.load(open('autogenfid.pkl', 'rb')) comdata = 'com_pp.txt' good_fid = [] outfile = './output/dataset.coms' fo = open(outfile, 'w') for line in open(comdata): tmp = line.split(',') fid = int(tmp[0].strip()) if bad_fid[fid]: continue com = tmp[1].strip() com...
487
203
""" Cubic symmetric graphs. Most of the embeddings realised here were taken from MathWorld. """ from mpmath import * from functools import reduce from shibuya.generators import cu, star_radius, ring_edges, lcf_edges from shibuya.generators import all_unit_distances, circumcentre from shibuya.generators import fixparams...
22,588
11,829
#!/cygdrive/c/Python27/python.exe # Daniel J. Parente, Ph.D. # Swint-Kruse Laboratory # Physician Scientist Training Program # University of Kansas Medical Center # This code is adapted from the example available at # http://pandasplotting.blogspot.com/2012/04/added-kde-to-scatter-matrix-diagonals.html # Creates a s...
937
335
import pygame; import numpy as np; from math import sin, cos; pygame.init(); width, height, depth = 640, 480, 800; camera = [width // 2, height // 2, depth]; units_x, units_y, units_z = 8, 8, 8; scale_x, scale_y, scale_z = width / units_x, height / units_y, depth / units_z; screen = pygame.display.set_mode((width, he...
4,143
1,676
import grasp_net, grasp_params, h5py, aolib.img as ig, os, numpy as np, aolib.util as ut net_pr = grasp_params.im_fulldata_v5() net_pr = grasp_params.gel_im_fulldata_v5() checkpoint_file = '/home/manu/ros_ws/src/manu_research/manu_sawyer/src/tensorflow_model_is_gripping/training/net.tf-6499' gpu = '/gpu:0' db_file = ...
1,444
636
from API.db import db from datetime import datetime from passlib.apps import custom_app_context as pwd_context class User(db.Model): __tablename__ = "users" def __init__(self, username, password): self.username = username self.password = pwd_context.hash(password) self.limit = 0 ...
3,683
1,220
import unittest from Dice import Dice class TestDice(unittest.TestCase): def setUp(self): self.sides = 8 self.dice = Dice(self.sides) def test_roll(self): for i in range(1000): self.assertLessEqual(self.dice.roll(), self.sides) def test_error(self): self.asse...
418
156
"""Command line tool to extract meaningful health info from accelerometer data.""" import accelerometer.accUtils import argparse import collections import datetime import accelerometer.device import json import os import accelerometer.summariseEpoch import sys import pandas as pd import numpy as np import matplotlib.p...
16,694
4,621
from django.shortcuts import render from .models import VetsInfoTable # Create your views here. def home(request): context = { "name": "Home" } return render(request, 'index.html', context) def view_vets(request): obj = VetsInfoTable.objects.all() context = { "vets_data": obj...
382
128
import sys import math import random # Figure out what we should name our output file, and how big it should be if len(sys.argv) != 3: # Make sure we get a file argument, and only that print("Incorrect number of arguments found, should be \"generate <file> 10^<x>\"") for i in range(10): with open("./gen/%s%d"...
542
196
from django.urls import path from wagtail.snippets.views import chooser, snippets app_name = 'wagtailsnippets' urlpatterns = [ path('', snippets.index, name='index'), path('choose/', chooser.choose, name='choose_generic'), path('choose/<slug:app_label>/<slug:model_name>/', chooser.choose, name='choose')...
963
344
import pytest from easydict import EasyDict import numpy as np import gym from copy import deepcopy from ding.envs.env import check_array_space, check_different_memory, check_all, demonstrate_correct_procedure from ding.envs.env.tests import DemoEnv @pytest.mark.unittest def test_an_implemented_env(): demo_env =...
1,974
784
# -*- encoding: utf-8 -*- """Unit tests for src/evergreen/metrics/buildmetrics.py.""" from __future__ import absolute_import from unittest.mock import MagicMock import pytest import evergreen.metrics.buildmetrics as under_test from evergreen.errors.exceptions import ActiveTaskMetricsException from evergreen.task imp...
18,474
5,922
#!/usr/bin/env python # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved import pickle as pkl import sys import torch """ Usage: # download your pretrained model: wget https://github.com/LikeLy-Journey/SegmenTron/releases/download/v0.1.0/tf-xception65-270e81cf.pth -O x65.pth # run the conver...
813
363
import random from floodsystem.utils import sorted_by_key # noqa from floodsystem.geo import stations_by_distance, stations_within_radius, rivers_with_station, stations_by_river,rivers_by_station_number from floodsystem.stationdata import build_station_list '''def test_geo(): #Task 1A #does the function ...
2,953
996
#!/usr/bin/env python3 import os import aws_cdk as cdk # For consistency with TypeScript code, `cdk` is the preferred import name for # the CDK's core module. The following line also imports it as `core` for use # with examples from the CDK Developer's Guide, which are in the process of # being updated to use `cdk`....
724
230
# -*- coding: utf-8 -*- """ Authors: Tim Hessels UNESCO-IHE 2017 Contact: t.hessels@unesco-ihe.org Repository: https://github.com/wateraccounting/wa Module: Generator/Sheet3 """ import os def Create(Dir_Basin, Basin, Simulation, Dir_Basin_CSV_a, Dir_Basin_CSV_b): """ This functions create the monthly ...
1,565
589
"""The user command.""" from json import dumps from .base import Base from bonita.api.bonita_client import BonitaClient class User(Base): """Manage user""" def run(self): # bonita process [deploy <filename_on_server>|get <process_id>|enable <process_id>|disable <process_id>] #print('You sup...
2,481
745
from config import ANET_CFG import sys sys.path.append(ANET_CFG.DENSE_FLOW_ROOT+'/build') from libpydenseflow import TVL1FlowExtractor import action_caffe import numpy as np class FlowExtractor(object): def __init__(self, dev_id, bound=20): TVL1FlowExtractor.set_device(dev_id) self._et = TVL1F...
1,809
672
#####################################################. # This file stores all the functions # # used for genrating all parameters # #####################################################. from rdkit.Chem import AllChem as Chem from rdkit.Chem import rdMolTransforms import os import pandas...
9,921
3,879
# Copyright 2014 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...
3,446
1,043
from flask import Blueprint from apps.auth.business.wxlogin import WxLoginBusiness from apps.auth.extentions import validation, parse_json_form from library.api.render import json_detail_render wxlogin = Blueprint("wxlogin", __name__) @wxlogin.route('/', methods=['POST']) @validation('POST:wx_user_code') def wxuser...
952
360
# -*- coding: utf-8 -* # ALGG 03-01-2017 Creación de módulo jornada_teorica. class JornadaTeorica(object): def __init__(self, conn): '''Constructor''' # Conexión. self.__conn = conn def get_jt(self, centro_fisico_id = None, anno = None): '''Devuelve: (...
4,374
1,402
''' This code was based on these repositories, so special thanks to: https://github.com/datademofun/spotify-flask https://github.com/drshrey/spotify-flask-auth-example ''' from flask import Flask, request, redirect, g, render_template, session from spotify_requests import spotify app = Flask(...
3,645
1,089
from ckan import model from ckan.lib.cli import CkanCommand from ckan.lib.munge import munge_title_to_name, substitute_ascii_equivalents from ckan.logic import get_action from ckan.lib.helpers import render_markdown from ckan.plugins import toolkit import logging log = logging.getLogger(__name__) class MigrationCom...
7,275
1,992
# -*- coding: utf-8 -*- import numpy as np import cv2 from scipy.misc import imsave import matplotlib.pyplot as plt import analysis import imageprocess import datainterface import imagemosaicking town_names = ['昂素镇', '敖勒召其镇', '布拉格苏木', '城川镇', '二道川乡', \ '毛盖图苏木', '三段地镇', '上海庙镇', '珠和苏木'] for index in rang...
13,826
6,215
import logging import os import unittest from logging.config import fileConfig from src.lambda_function import validate_configurations as validate # create logger assuming running from ./run script fileConfig('tests/logging_config.ini') logger = logging.getLogger(__name__) class TestLambdaFunction(unittest.TestCase...
2,593
737
import numpy as np import tensorflow from keras import Input, optimizers from keras import backend as K from keras.engine import Model from keras import layers from keras.layers import Bidirectional, LSTM, merge, Reshape, Lambda, Dense, BatchNormalization K.clear_session() print("设置显卡信息...") # 设置tendorflow对显存使用按需增长 co...
1,954
739
from flask_socketio import SocketIO NOTI = 'notification' class MySocket(): def __init__(self, app, async_mode): self.socketio = SocketIO(app, async_mode=async_mode) def get_socketio(self): return self.socketio def noti_emit(self, msg, room=None): if room: self.soc...
467
155
import pytest from weaverbird.backends.sql_translator.metadata import SqlQueryMetadataManager from weaverbird.backends.sql_translator.steps import translate_filter from weaverbird.backends.sql_translator.types import SQLQuery from weaverbird.pipeline.conditions import ComparisonCondition from weaverbird.pipeline.steps...
2,128
669
""" Load tests from :class:`unittest.TestCase` subclasses. This plugin implements :func:`loadTestsFromName` and :func:`loadTestsFromModule` to load tests from :class:`unittest.TestCase` subclasses found in modules or named on the command line. """ # Adapted from unittest2/loader.py from the unittest2 plugins branch....
4,322
1,187
from app import app, db import models import views if __name__ == '__main__': app.run() # No need to do (debug=True), as in config.py, debug = true is already set. # app.run(debug=True) # app.run(debug=True, use_debugger=False, use_reloader=False)
265
93
import sys sys.path.append("./pysphere") from pysphere import VIServer from pysphere.resources.vi_exception import VIException, VIApiException, \ FaultTypes import sys if len(sys.argv) != 6: sys.exit("error = please check arguments") serverName = sys.argv[1] login =...
789
281
import json import logging import tensorflow as tf from easy_rec.python.protos.dataset_pb2 import DatasetConfig from easy_rec.python.protos.feature_config_pb2 import FeatureConfig from easy_rec.python.utils.config_util import get_compatible_feature_configs from easy_rec.python.utils.convert_rtp_fg import load_input_...
1,431
495
import pytest @pytest.fixture(scope="session") def shared_zone_test_context(request): from shared_zone_test_context import SharedZoneTestContext ctx = SharedZoneTestContext() def fin(): ctx.tear_down() request.addfinalizer(fin) return ctx @pytest.fixture(scope="session") def zone_hist...
529
162
from enum import Enum import requests import argparse import nflgame def get_user_id_to_team_name(league_id): """ Gets a map of fantasy player user id to their team name """ user_id_to_team_name = {} r = requests.get("https://api.sleeper.app/v1/league/%s/users" % league_id) user_data = r.json()...
15,642
5,356
#!/usr/bin/env python from datetime import datetime, timedelta import numpy as np from opendrift.readers import reader_basemap_landmask from opendrift.readers import reader_ROMS_native from kelp.kelpClass import PelagicPlanktonDrift from opendrift.readers import reader_netCDF_CF_generic import logging import gdal imp...
10,489
3,792
import json import sqlite3 import typing from typing import Optional, Dict from copy import deepcopy from contextlib import suppress from bson.objectid import ObjectId from pymongo import MongoClient from pymongo.errors import ConfigurationError class MongoStorageException(Exception): pass class Mongo: def...
6,818
1,921
# pylint: skip-file # type: ignore # -*- coding: utf-8 -*- # # tests.models.opstress.opstress_integration_test.py is part of The RAMSTK Project # # All rights reserved. # Copyright since 2007 Doyle "weibullguy" Rowland doyle.rowland <AT> reliaqual <DOT> com """Class for testing operating stress integrations.""" ...
13,486
4,423
import os from validr import T from aiohttp.web import json_response from aiohttp.web_request import Request from rssant_common import timezone from rssant_common.image_token import ImageToken, ImageTokenDecodeError from rssant_config import CONFIG from .rest_validr import ValidrRouteTableDef from .image_proxy import...
1,159
380
from testing_config import BaseTestConfig from application.models import User from application.models import Chatroom import json from application.utils import auth class TestMatch(BaseTestConfig): test_group = { "name": "test_group", "tag": "Poker", } test_group2 = { "name": "test...
2,785
950
import sys sys.path.insert(0, '/home/hena/caffe-ocr/buildcmake/install/python') sys.path.insert(0, '/home/hena/tool/protobuf-3.1.0/python') import caffe import math import numpy as np def SoftMax(net_ans): tmp_net = [math.exp(i) for i in net_ans] sum_exp = sum(tmp_net) return [i/sum_exp for i in tmp_net] ...
1,633
530
""" Tools for creating and working with Line (Station) Grids """ from typing import Union import pyproj import numpy as np _atype = Union[type(None), np.ndarray] _ptype = Union[type(None), pyproj.Proj] class StaHGrid: """ Stations Grid EXAMPLES: -------- >>> x = arange(8) >>> y = arange(8...
2,530
898
import numpy as np from ..reco.disp import disp_vector import astropy.units as u import matplotlib.pyplot as plt from ctapipe.visualization import CameraDisplay __all__ = [ 'overlay_disp_vector', 'overlay_hillas_major_axis', 'overlay_source', 'display_dl1_event', ] def display_dl1_event(event, camera_...
3,364
1,172
import numpy as np import random from scipy.stats import skew as scipy_skew from skimage.transform import resize as skimage_resize from QFlow import config ## set of functions for loading and preparing a dataset for training. def get_num_min_class(labels): ''' Get the number of the minimum represented class i...
14,537
4,474
""" Test PEP 0448 -- Additional Unpacking Generalizations https://www.python.org/dev/peps/pep-0448/ """ # pylint: disable=superfluous-parens, unnecessary-comprehension UNPACK_TUPLE = (*range(4), 4) UNPACK_LIST = [*range(4), 4] UNPACK_SET = {*range(4), 4} UNPACK_DICT = {'a': 1, **{'b': '2'}} UNPACK_DICT2 = {**UNPACK_D...
472
233
# -*- coding: utf-8 -*- class IkazuchiError(Exception): """ ikazuchi root exception """ pass class TranslatorError(IkazuchiError): """ ikazuchi translator exception """ pass class NeedApiKeyError(TranslatorError): pass
238
80
import pyglet print('Loading resources') def center_image(image): """Sets an image's anchor point to its center""" image.anchor_x = image.width / 2 image.anchor_y = image.height / 2 # Tell pyglet where to find the resources pyglet.resource.path = ['./resources', './resources/backgrounds'] pyglet.resource...
4,331
1,609
#!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = 'ipetrash' # SOURCE: https://github.com/gil9red/VideoStreamingWithEncryption/blob/37cf7f501460a286ec44a20db7b2403e8cb05d97/server_GUI_Qt/inner_libs/gui/SelectDirBox.py import os from PyQt5.QtWidgets import QWidget, QLineEdit, QLabel, QPushButton, QHBoxLa...
2,517
860
import numpy as np import picoscript import cv2 import HeightTracker import atexit print "Setting Parameters..." zDacRange = 0.215 # Sensor specific number windowSize = 3e-6 # window size in meters windowBLHCX = 3.5e-6 # window bottom left hand corner X-axis in meters windowBLHCY = 3.5e-6 # window bottom left hand c...
3,503
1,259
import snscrape.modules.twitter as sntwitter import pandas as pd # Creating list to append tweet data to tweets_list2 = [] # Using TwitterSearchScraper to scrape data and append tweets to list for i,tweet in enumerate(sntwitter.TwitterSearchScraper('covid vaccine until:2021-05-24').get_items()): if i>100000: ...
1,947
674
from .repository import Repository from .manager import Manager __all__ = ["Manager", "Repository", "__version__"] __version__ = "0.2.0"
138
43
''' ==================================================================== Copyright (c) 2016-2017 Barry A Scott. All rights reserved. This software is licensed as described in the file LICENSE.txt, which you should have received as part of this distribution. ======================================================...
44,876
13,464
XPAHS_CONSULT = { 'jobs_urls': '//div[contains(@class, "listResults")]//div[contains(@data-jobid, "")]//h2//a/@href', 'results': '//span[@class="description fc-light fs-body1"]//text()', 'pagination_indicator': '//a[contains(@class, "s-pagination--item")][last()]//span[contains(text(), "next")]', 'pagi...
443
167
import logging import os import random import time import datetime import sys import math from screen import Screen from scorer import Scorer from trigger import Trigger from psychopy import core, event, sound from psychopy.hardware import keyboard from pupil_labs import PupilCore from datalog import Datalog from conf...
3,676
1,161
# DO NOT EDIT! This file is automatically generated import typing from commercetools.helpers import RemoveEmptyValuesMixin from commercetools.platform.models.inventory import ( InventoryEntry, InventoryEntryDraft, InventoryEntryUpdate, InventoryEntryUpdateAction, InventoryPagedQueryResponse, ) from...
3,696
994
from __future__ import print_function # so print doesn't show brackets import copy import numpy as np import time as time import matplotlib.pyplot as plt import pickle import redis import qmla.model_for_learning import qmla.redis_settings import qmla.logging pickle.HIGHEST_PROTOCOL = 4 plt.switch_ba...
8,008
2,409
""" File: pylinex/quantity/CompiledQuantity.py Author: Keith Tauscher Date: 3 Sep 2017 Description: File containing a class representing a list of Quantities to be evaluated with the same (or overlapping) arguments. When it is called, each underlying Quantity is called. """ from ..util import...
9,390
2,259
s = 0 cont = 0 for c in range(1, 501, 2): if c % 3 == 0: s = s + c cont = cont + 1 print('A soma de todos os {} valores solicitados é {}'.format(cont, s))
184
86
#!/usr/bin/env python # -*- coding: utf-8 -*- # # This file is subject to the terms and conditions defined in # file 'LICENSE.md', which is part of this source code package. # import time import uuid from kubernetes.K8sCronJob import K8sCronJob from kubernetes.K8sPod import K8sPod from kubernetes.models.v2alpha1.Cro...
8,588
2,850
''' This file implements various optimization methods, including -- SGD with gradient norm clipping -- AdaGrad -- AdaDelta -- Adam Transparent to switch between CPU / GPU. @author: Tao Lei (taolei@csail.mit.edu) ''' import random from collections import OrderedDict import...
9,054
3,361
import sys from PyQt5.QtWidgets import QMainWindow from PyQt5.QtGui import QPixmap, QIcon from PyQt5 import uic from internationalization import LANGUAGE class Loose(QMainWindow): def __init__(self, lang): QMainWindow.__init__(self) uic.loadUi("windows/Looser.ui", self) self.lang = lang ...
883
281
import requests class Post: def __init__(self, page_access_token, **kwargs): self.page_access_token = page_access_token return super().__init__(**kwargs) def send(self, url, json): try: request_session = requests.Session() params = {'access_token': se...
617
161
import argparse import Functions_Features.functionsToDetermineMotifStrength as fdm import pandas as pd parser = argparse.ArgumentParser() parser.add_argument("-w","--tmpfolder",type=str,help="Input the upperlevel folder containing folder to Write to") parser.add_argument("-t","--foldertitle",type=str,help="Input the t...
2,424
926
import os import subprocess import time class Asciicast(object): def __init__(self, env=os.environ): self.command = None self.title = None self.shell = env.get('SHELL', '/bin/sh') self.term = env.get('TERM') self.username = env.get('USER') @property def meta_data(...
964
290
from django.contrib import admin from .models import Movie admin.site.register(Movie)
88
25
#!/usr/bin/env python # -*- coding: utf-8 -*- """Asian Language Treebank (ALT) Project""" from __future__ import absolute_import, division, print_function import os import datasets _CITATION = """\ @inproceedings{riza2016introduction, title={Introduction of the asian language treebank}, author={Riza, Hammam an...
17,808
5,297
from setuptools import setup, find_packages setup( name='awis-py', version='0.0.2', url='https://github.com/whistlebee/awis-py', packages=find_packages(), install_requires=['requests', 'lxml'], python_requires='>=3.6' )
246
95
import sys from pathlib import Path import numpy as np import pandas as pd from bokeh.models import ColumnDataSource from bokeh.io import export_png from bokeh.plotting import figure def plot_lifetime(df, type, path): df = df.copy() palette = ["#c9d9d3", "#718dbf", "#e84d60", "#648450"] ylist = [] ...
17,918
6,370
from multiprocessing import Process server = Process(target=app.run)# ... server.terminate()
98
32
from OpenGL.arrays import vbo from OpenGL.GLES2.VERSION import GLES2_2_0 from OpenGL.GLES2.OES import mapbuffer class Implementation( vbo.Implementation ): """OpenGL-based implementation of VBO interfaces""" def __init__( self ): for name in self.EXPORTED_NAMES: for source in [ GLES2_2_0, m...
755
203
import unittest import numpy as np import openjij as oj import cxxjij as cj def calculate_ising_energy(h, J, spins): energy = 0.0 for (i, j), Jij in J.items(): energy += Jij*spins[i]*spins[j] for i, hi in h.items(): energy += hi * spins[i] return energy def calculate_qubo_energy(Q, ...
8,457
3,530
#!/usr/bin/env python # coding=utf-8 import grpc from datetime import datetime import sys import logging import socket import os from ipaddress import ip_network, ip_address, IPv4Address import json import signal import traceback import re from concurrent.futures import ThreadPoolExecutor import sdk_service_pb2 impor...
18,273
5,398
from __future__ import absolute_import, division, print_function, unicode_literals import os.path import pytest xr = pytest.importorskip('xarray') # noqa from cfgrib import cfgrib_ SAMPLE_DATA_FOLDER = os.path.join(os.path.dirname(__file__), 'sample-data') TEST_DATA = os.path.join(SAMPLE_DATA_FOLDER, 'era5-level...
1,003
390
#! /usr/bin/env python3 # Copyright(c) 2017 Intel Corporation. # License: MIT See LICENSE file in root directory. # NPS # pulls images from camera device and places them in a Queue # if the queue is full will start to skip camera frames. #import numpy as np import cv2 import queue import threading import time class...
4,578
1,268
import ipfinder con = ipfinder.config('f67f788f8a02a188ec84502e0dff066ed4413a85') # YOUR_TOKEN_GOES_HERE # domain name by = 'DZ'; dby = con.getDomainBy(by) print(dby.all)
175
100
""" Author: bkc@data_analysis Project: autoencoder_ng Created: 7/29/20 10:51 Purpose: START SCRIPT FOR AUTOENCODER_NG PROJECT """
139
64
from .list import SalesPaymentListSchema # noqa
49
15
import numpy as np from matplotlib import pyplot as plt from sympy import symbols, solve a, b, c, d, x, α, β = symbols("a b c d x α β") # polynomial function f(x) = ax³ + bx² + cx + d f = a * x ** 3 + b * x ** 2 + c * x + d fp = f.diff(x) # derivative f'(x) # evaluate both at x=0 and x=1 f0, f1 = [f.subs(x, i) for...
858
422
#!/usr/bin/python2.5 # # Copyright 2009 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 ...
13,614
4,757
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. import logging from dataclasses import dataclass from typing import Dict, List import torch import torch.nn as nn from ml.rl import types as rlt from ml.rl.models.base import ModelBase logger = logging.getLogger(__name__)...
3,198
1,018
import pygame import math #Dibuja triangulo y lo escala con el teclado ANCHO=600 ALTO=480 def dibujarPlano(o, pantalla): pygame.draw.line(pantalla, [0, 255, 0], [o[0], 0], [o[0], 480] ) pygame.draw.line(pantalla, [0, 255, 0], [0, o[1]], [640, o[1]] ) def dibujarTriangulo(a, b, c, plano): ''' pygame.dr...
4,227
1,552
from __future__ import print_function import os, sys import pickle import time import glob import numpy as np import torch from model import PVSE from loss import cosine_sim, order_sim from vocab import Vocabulary from data import get_test_loader from logger import AverageMeter from option import parser, verify_input...
10,692
4,478
# Copyright (c) 2021 PaddlePaddle 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...
13,286
4,243
#!/usr/bin/env python3 import json import time import sys #import numpy as np import cv2 from cscore import CameraServer, VideoSource, CvSource, VideoMode, CvSink, UsbCamera from networktables import NetworkTablesInstance def Track(frame, sd): Lower = (0,0,0) Upper = (0,0,0) if sd.getNumber("Track", 0): ...
3,911
1,385
import sys from collections import deque import soccer_toolbox import csv_tools def fileToStats(csvfile, stat, nbrAgg): header, listRawData = csv_tools.loadData(csvfile) dictCol = csv_tools.getColumns(header) setTeams = csv_tools.getTeams(listRawData, dictCol['nColHomeTeam'], dictCol['nColAwayTeam']) ...
1,667
545
from __future__ import unicode_literals from django.shortcuts import render, redirect from django.template import loader from django.http import HttpResponse from django.views import generic from .models import Movie from . import searchapi from django.urls import reverse # Create your views here. class Search(gener...
895
236
#!/usr/bin/env python # # Copyright 2010 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 o...
27,693
8,331
""" This module is used to represent a CTSeries object from the DICOMSeries table in the database. Inherits SeriesWithImageSlices module. """ from logic.entities.series_with_image_slices import SeriesWithImageSlices class CtSeries(SeriesWithImageSlices): """ This class stores all information about a CT-series...
382
106
import os import sys import tensorflow as tf import tf_utils.tf_util as tf_util from tf_utils.pointSIFT_util import pointSIFT_module, pointSIFT_res_module, pointnet_fp_module, pointnet_sa_module def placeholder_inputs(batch_size,num_point,num_class): #num_class=numofclasses*2 pointclouds_pl = tf.placeholder(...
8,108
3,579
from .cwljobdispatcher import CWLJobDispatcher from .cwljobgatherer import CWLJobGatherer
89
33