text
string
size
int64
token_count
int64
#!/usr/bin/python import requests import boto3 import time import geopy.distance import xml.etree.ElementTree as ET import itertools import sys import pickle S3_BUCKET = "panku-gdzie-jestes-latest-storage" class LatestPositionStorage(object): def __init__(self, service): self.objectName = "%s.latest" % service...
6,544
2,216
# -*- coding: utf-8 -*- # Generated by Django 1.10.1 on 2017-12-08 18:42 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion def update_questionnaires(apps, schema_editor): """ Forward migration function to normalize settings into VMSettings and C...
1,412
437
from datetime import datetime from . import db from config import COMMENTS_INITIAL_ENABLED from flask.ext.security import UserMixin, RoleMixin from markdown import markdown import bleach # Define models roles_users = db.Table( 'roles_users', db.Column('user_id', db.Integer(), db.ForeignKey('user.id')), db....
4,872
1,690
''' If the child is currently on the nth step, then there are three possibilites as to how it reached there: 1. Reached (n-3)th step and hopped 3 steps in one time 2. Reached (n-2)th step and hopped 2 steps in one time 3. Reached (n-1)th step and hopped 2 steps in one time The total number of possibilities is the sum...
751
279
# -*- coding: utf-8 -*- """ /*************************************************************************** PeakExtractor A QGIS plugin This plugin procedurally extracts morphological peaks from a given DEM. Generated by Plugin Builder: http://g-sherman.github.io/Qgis-Plugin-Builder/ ...
9,604
2,694
# Copyright (c) 2017 Mirantis, 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 requir...
3,657
1,202
class Solution: def runningSum(self, nums: List[int]) -> List[int]: for index in range(1, len(nums)): nums[index] = nums[index - 1] + nums[index] return nums
212
70
import os import unittest import json import filecmp from genofunk.sequence_utils import * this_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) class TestSequenceUtils(unittest.TestCase): def test_get_coordinates_from_json_simple_pairs(self): json_value = { "start": 30, ...
2,429
846
# -*- coding: utf-8 -*- """ Created on Thu Aug 13 09:52:47 2015 @author: wirkert """ import unittest import os import numpy as np import msi.msimanipulations as msimani from msi.io.nrrdreader import NrrdReader from msi.io.nrrdwriter import NrrdWriter from msi.test import helpers class TestNrrdWriter(unittest.TestC...
1,630
527
# -*- coding: utf-8 -*- """ ============================ crossplatformshell ============================ """ from __future__ import (print_function, division, absolute_import, unicode_literals) import pathlib import io import os import shutil import distutils.dir_util import platform # Use subp...
3,369
1,042
# Copyright (c) 2019 NVIDIA Corporation # If you want to add your own data layer, you should put its name in # __all__ so that it can be imported with 'from text_data_layers import *' __all__ = ['TextDataLayer', 'BertSentenceClassificationDataLayer', 'BertJointIntentSlotDataLayer', '...
28,857
7,741
import h2o from h2o.base import Keyed from h2o.exceptions import H2OValueError from h2o.job import H2OJob from h2o.model import ModelBase from h2o.utils.typechecks import assert_is_type, is_type class H2OAutoMLBaseMixin: def predict(self, test_data): """ Predict on a dataset. :param ...
12,208
3,590
import math,sys,pygame class Pistol(pygame.sprite.Sprite): def __init__(self,player): self.facing = player.facing if self.facing == "up": self.image = pygame.image.load("rsc/Projectiles/gustu.png") self.speed = [0, -5] elif self.facing == "down": s...
2,687
865
import hassapi as hass import csv from collections import namedtuple Profile = namedtuple( "Profile", ["profile", "x_color", "y_color", "brightness"]) with open("/config/light_profiles.csv") as profiles_file: profiles_reader = csv.reader(profiles_file) next(profiles_reader) LIGHT_PROFILES = [Profile(r...
3,388
965
# coding: utf-8 from pymongo import MongoClient import conf class MongoQuery(object): def __init__(self): self._conn = MongoClient(conf.mongodb_conn_str) self._db = self._conn.geokb def query(self, grounded, limit=15, sort_keys=None): col = self._db[grounded['from']] docs = co...
3,133
951
# # Copyright (C) 2014 Dell, 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...
8,809
2,489
# -*- coding: utf-8 -*- """Common layouts.""" #------------------------------------------------------------------------------ # Imports #------------------------------------------------------------------------------ import logging import numpy as np from phylib.utils import emit from phylib.utils.geometry import g...
17,184
5,362
import tornado.httpserver import tornado.ioloop import tornado.options import tornado.web import simplejson from QueryHandler import QueryHandler class AutocompleteHandler(tornado.web.RequestHandler): @tornado.web.asynchronous def get(self): if not self.request.arguments or self.request.arguments=={}: self.re...
623
220
# Generated by Django 2.0.5 on 2019-04-28 20:22 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('SV', '0051_ticketproducts_offerprice'), ] operations = [ migrations.AddField( model_name='produ...
1,869
586
from toolz import get PLOT_VALIDATORS = [ ( {"line", "scatter", "bar"}, lambda x: ("x" not in x) or ("y" not in x), "XY plot does not have X and Y.", ), ( {"histogram"}, lambda x: ("step" in x) and ("bins" in x), "Histogram cannot have STEP and BINS.", ),...
3,339
1,113
''' Building a Decision Tree using CART (from scratch) Note: Code was tested only on dataset with numerical features. Categorical features are not yet fully supported. ''' import numpy as np import pandas as pd import matplotlib.pyplot as plt from sklearn.model_selection import train_test_split from sklearn.metrics im...
7,421
2,323
""" FBlas Routine class: it used to represent a routine definition, specified by the user using JSON file. It is used by the Host and Module Codegen (specified by the _codegen variable). Accordingly, some class members could be invalid. """ from codegen import fblas_types from codegen import generator_def...
8,816
2,969
class PrefabError(Exception): pass class HashAlgorithmNotFound(PrefabError): pass class ImageAccessError(PrefabError): pass class ImageBuildError(PrefabError): pass class ImageNotFoundError(PrefabError): pass class ImagePushError(PrefabError): pass class ImageValidationError(PrefabEr...
485
159
from hoyolab import main from os import environ from os.path import exists import atoma def init_environ(d): environ['HOYOLAB_JSON_PATH'] = '{}/hoyolab.json'.format(d) environ['HOYOLAB_ATOM_PATH'] = '{}/hoyolab.xml'.format(d) environ['HOYOLAB_JSON_URL'] = 'hoyolab.json' environ['HOYOLAB_ATOM_URL'] = '...
840
329
"""Generated wrapper for NFTCollection Solidity contract.""" # pylint: disable=too-many-arguments import json from typing import ( # pylint: disable=unused-import Any, List, Optional, Tuple, Union, ) from eth_utils import to_checksum_address from mypy_extensions import TypedDict # pylint: disab...
194,112
57,470
from django.urls import path from . import views as sg urlpatterns = [ path('artist', sg.artist), path('genre', sg.genre), path('release', sg.release), path('track', sg.track), path('', sg.sausage_grinder_index), ]
237
91
from PyQt5.QtCore import pyqtSlot from PyQt5.QtWidgets import QComboBox from PyQt5.QtWidgets import QLineEdit from sf.mmck.parameters import String from .manager import widget_class_for from .widget import ParameterWidget @widget_class_for(String) class StringParameterWidget(ParameterWidget): def setUp(self, ui)...
1,194
363
from FitnessPlot import FitnessPlot ''' for n in range(1,6): plot = FitnessPlot(folder_prefix='data_top{}'.format(n)) plot.plot_all_workers() plot.plot_workers_as_average() ''' plot = FitnessPlot(folder_prefix='data_top1', num_workers=16) worker_dict = plot.create_worker_dict() #plot.plot_all_workers() #...
550
218
from space_tracer.main import replace_input, TraceRunner def test_source_width_positive(): code = """\ i = 1 + 1 """ expected_report = """\ i = 1 + | i = 2""" with replace_input(code): report = TraceRunner().trace_command(['space_tracer', '--source_w...
3,696
1,146
import logging def setup_logger(): formatter = logging.Formatter('%(asctime)s.%(msecs)03d %(levelname)s %(message)s', '%Y-%m-%d %H:%M:%S') logging.basicConfig(level=logging.INFO, format='%(asctime)s.%(msecs)03d %(levelname)-8s %(message)s', ...
458
173
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ThreeScale Proxies Rule interface for APIs.""" from .base import ThreeScale import logging import requests import xmltodict import json logger = logging.getLogger(__name__) class Proxies(ThreeScale): """ThreeScale Proxies create, update.""" response = None...
6,921
1,925
import sys from __init__ import Bot MESSAGE_USAGE = "Usage is python %s [name] [token]" if __name__ == "__main__": if len(sys.argv) == 3: Bot(sys.argv[1], sys.argv[2]) else: print(MESSAGE_USAGE.format(sys.argv[0]))
241
96
# Created with tutorials: # https://www.digitalocean.com/community/tutorials/how-to-structure-large-flask-applications # http://flask.pocoo.org/docs/0.12/tutorial from flask import Flask, g, render_template from flask_sqlalchemy import SQLAlchemy import sqlite3 # Define WSGI application object. app = Flask(__name__...
985
323
import os os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' import subprocess import numpy as np import datetime import random import warnings import ROOT as rt import math from keras.preprocessing.sequence import pad_sequences from keras.callbacks import Callback from array import array from sklearn.metrics import roc_auc_sco...
19,075
8,262
class Opt: def __init__(self): self.dataset = "fashion200k" self.dataset_path = "./dataset/Fashion200k" self.batch_size = 32 self.embed_dim = 512 self.hashing = False self.retrieve_by_random = True
210
95
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import fields, models class Lead(models.Model): _inherit = 'crm.lead' reveal_id = fields.Char(string='Reveal ID', help="Technical ID of reveal request done by IAP.")
287
106
# Copyright 2018 - Nokia # # 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, sof...
6,600
1,953
# Two children, Lily and Ron, want to share a chocolate bar. Each of the squares has an integer on it. # Lily decides to share a contiguous segment of the bar selected such that: # The length of the segment matches Ron's birth month, and, # The sum of the integers on the squares is equal to his birth day. # Determine...
1,058
375
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from . import ...
3,517
1,089
from abc import abstractmethod from typing import List from rl.action import Action from rl.state import State class StateActionFeatureExtractor: @abstractmethod def num_features(self) -> int: pass @abstractmethod def extract(self, state: State, action: Action) -> List[float]: pass ...
504
142
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ 通用json处理接口 """ import json # 输入单引号为边界的类json字符串(内部可能还有双引号),返回单引号为边界的python字典or列表对象。 def singleQuoteJsonStr_to_PythonObj(strr): jsonObj = eval(strr) # 不能用内置函数解析。只能模拟执行。 return jsonObj # dict or list # 输入完全正规的json字符串(键-值边界为双引号),返回单引号为边界的python字典or列表对象。 def...
563
326
from ast import literal_eval from typing import Dict, List import click from pygitguardian.models import Detail from ggshield.text_utils import STYLE, display_error, format_text, pluralize def handle_scan_error(detail: Detail, chunk: List[Dict[str, str]]) -> None: if detail.status_code == 401: raise cli...
1,044
294
# pylint: disable=no-member from CommonServerUserPython import * from CommonServerPython import * from sklearn.feature_extraction.text import TfidfVectorizer import pickle import uuid import spacy import string from html.parser import HTMLParser from html import unescape from re import compile as _Re import pandas as p...
18,049
5,606
import logging import os import tensorflow as tf from punc_recover.models.punc_transformer import PuncTransformer from punc_recover.tester.base_tester import BaseTester from utils.text_featurizers import TextFeaturizer class PuncTester(BaseTester): """ Trainer for CTC Models """ def __init__(self, ...
2,799
912
# 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 field 'ProductVersion.cc_version' db.add_column('core_productversion', 'cc_version', self.gf('django.db....
13,293
4,393
#! /usr/bin/env python # # downloader_test.py # # Copyright (c) 2015-2016 Junpei Kawamoto # # This software is released under the MIT License. # # http://opensource.org/licenses/mit-license.php # """ Test for downloader module. """ import logging import shutil import sys import unittest import os from os import path im...
3,965
1,315
import matplotlib.pyplot as pl import os import numpy as np from ticle.data.dataHandler import normalizeData,load_file from ticle.analysis.analysis import get_phases,normalize_phase pl.rc('xtick', labelsize='x-small') pl.rc('ytick', labelsize='x-small') pl.rc('font', family='serif') pl.rcParams.update({'font.size': 2...
1,800
693
#!/usr/bin/python import shlex import simplejson from putil.rabbitmq.rabbitmqadmin import Management, make_parser, LISTABLE, DELETABLE class RabbitManagementUtil(object): def __init__(self, config, options=None, sysname=None): """ Given a config object (system CFG or rabbit mgmt config), extra...
7,267
2,299
# coding=utf-8 # Copyright 2022 The Google Research Authors. # # 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 applicab...
5,362
1,822
#!/usr/bin/env python3 # Hydrus is released under WTFPL # You just DO WHAT THE FUCK YOU WANT TO. # https://github.com/sirkris/WTFPL/blob/master/WTFPL.md from hydrus import hydrus_client if __name__ == '__main__': hydrus_client.boot()
251
99
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ ExchangeConnector fixEngine Copyright (c) 2020 Hugo Nistal Gonzalez 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, includi...
5,776
1,581
from jadi import component from aj.api.http import url, HttpPlugin from aj.auth import authorize from aj.api.endpoint import endpoint, EndpointError import aj import gevent @component(HttpPlugin) class Handler(HttpPlugin): def __init__(self, context): self.context = context @url(r'/api/session_list/l...
570
168
# Copyright (c) 2016 Universidade Federal Fluminense (UFF) # Copyright (c) 2016 Polytechnic Institute of New York University. # Copyright (c) 2018, 2019, 2020 President and Fellows of Harvard College. # This file is part of ProvBuild. """Capture arguments from calls""" from __future__ import (absolute_import, print_f...
10,606
2,787
N = int(input()) entry = [input().split() for _ in range(N)] phoneBook = {name: number for name, number in entry} while True: try: name = input() if name in phoneBook: print(f"{name}={phoneBook[name]}") else: print("Not found") except: break
307
95
#Sequence model. != Recursive Neural Network #memory cell or RNN cell #hidden state #one-to-many_image captioning, many-to-one_sentiment classfication || spam detection, many-to-many_chat bot #2) create RNN in python import numpy as np timesteps=10#시점의 수 _문장의 길이 input_size=4#입력의 차원_단어벡터의 차원 hidden_size=8#메모리 셀의 용량(은닉...
1,850
1,087
pet = { "name":"Doggo", "animal":"dog", "species":"labrador", "age":"5" } class Pet(object): def __init__(self, name, age, animal): self.name = name self.age = age self.animal = animal self.hungry = False self.mood= "happy" def eat(self): print("> %s is eating....
720
282
from dagster import job, repository from ops.sklearn_ops import ( fetch_freehand_text_to_generic_data, separate_features_from_target_label, label_encode_target, count_tfid_transform_train, count_tfid_transform_test, create_sgd_classifier_model, predict ) @ job( description...
1,260
437
resposta = 'S' soma = quant = media = maior = menor = 0 while resposta in 'Ss': n = int(input('Digite um número: ')) soma += n quant += 1 if quant == 1: maior = menor = n else: if n > maior: maior = n elif n < menor: menor = n resposta = str(input(...
551
190
from shapely.geometry import Polygon from ..point import Point class Opening(Polygon): """ Openings are rectangular only. """ def __init__(self, width, height): self.width = width self.height = height points = [ Point(0, 0), Point(0, height), Point(width, height...
554
173
import numpy as np import pandas as pd from sklearn.preprocessing import LabelEncoder, MinMaxScaler from numpy.random import uniform import matplotlib.pyplot as plt def relu(x): return x * (x > 0) def relu_deriv(x): return 1 * (x > 0) class NeuralNetwork: """ Our NN will predict a housing price gi...
4,252
1,531
import pytest from osxphotos._constants import _UNKNOWN_PERSON PHOTOS_DB = "./tests/Test-10.15.4.photoslibrary/database/photos.db" TOP_LEVEL_FOLDERS = ["Folder1"] TOP_LEVEL_CHILDREN = ["SubFolder1", "SubFolder2"] FOLDER_ALBUM_DICT = {"Folder1": [], "SubFolder1": [], "SubFolder2": ["AlbumInFolder"]} ALBUM_NAMES = ...
7,829
3,172
# Copyright 2018 Deep Topology 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 o...
32,808
9,586
#!/usr/bin/env python # coding: utf8 # # Copyright (c) 2021 Centre National d'Etudes Spatiales (CNES). # # This file is part of PANDORA2D # # https://github.com/CNES/Pandora2D # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You...
4,537
1,767
from unittest.mock import Mock from goblet import Goblet from goblet.resources.scheduler import Scheduler from goblet.test_utils import ( get_responses, get_response, mock_dummy_function, dummy_function, ) class TestScheduler: def test_add_schedule(self, monkeypatch): app = Goblet(function...
9,353
3,069
import logging from functools import partial from arachnado.storages.mongotail import MongoTailStorage class Sites(object): """ 'Known sites' object exposed via JSON-RPC """ logger = logging.getLogger(__name__) def __init__(self, handler, site_storage, **kwargs): self.handler = handler s...
1,027
302
"""players module. Used for players data processes """ import numpy as np import pandas as pd import src.config as config import src.utilities as utilities from src.utilities import logging pd.set_option("display.max_columns", 500) pd.set_option("display.expand_frame_repr", False) # master_file = config.MASTER_FILE...
16,628
5,506
import pandas as pd import os #opt = itertools.islice(ls, len(ls)) #st = map(lambda x : ) def parsecode(txt): df = pd.read_csv(os.getcwd() + '\\OMDB.csv') ls = df['Code'].to_list() code = [] q = 0 for i in range(len(ls)): text = txt if ls[i] in text: n = text.find(ls[...
2,035
714
import socket import unittest from eats.webdriver import PytractorWebDriver from eats.tests.common import SimpleWebServerProcess as SimpleServer def _get_local_ip_addr(): s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) s.connect(("gmail.com",80)) local_ip_addr = s.getsockname()[0] s.close() re...
1,463
474
from autoprep.service.project_service import ProjectService class SQLiteProjectService(ProjectService): def get_projects(self): pass def get_project(self): pass def save_project(self): pass
231
65
import torch import torch.nn as nn class QNetwork(nn.Module): """Actor (Policy) Model using a Single DQN.""" def __init__(self, state_size, action_size, seed): """Initialize parameters and build model. Params ====== state_size (int): Dimension of each state acti...
2,262
706
ADDON_NAME = "pmx_bone_importer" LOG_FILE_NAME = "pmx_bone_importer.log"
74
35
# Copyright 2017 James McCauley # # 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 writi...
17,789
7,240
# 2020 Tommaso Ciussani and Giacomo Giuliari import os import json import numpy as np from typing import Set, List from geopy.distance import great_circle from scipy.spatial.ckdtree import cKDTree from shapely.geometry import Polygon, shape, Point from icarus_simulator.sat_core.coordinate_util import geo2cart from i...
5,754
1,911
# coding: utf-8 """ Grafeas API An API to insert and retrieve annotations on cloud artifacts. # noqa: E501 OpenAPI spec version: v1alpha1 Generated by: https://github.com/swagger-api/swagger-codegen.git """ import pprint import re # noqa: F401 import six from grafeas.models.deployment_deta...
8,861
2,619
#!/usr/bin/env python # -*- coding: utf-8 -*- # Author: stdrickforce (Tengyuan Fan) # Email: <stdrickforce@gmail.com> <fantengyuan@baixing.com> import cat import time def ignore_exception(func): def wraps(*args, **kwargs): try: return func(*args, **kwargs) except Exception: ...
1,575
543
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file ui_hw_recovery_wdg.ui # # Created by: PyQt5 UI code generator # # WARNING: Any manual changes made to this file will be lost when pyuic5 is # run again. Do not edit this file unless you know what you are doing. from PyQt5 import QtCore, Qt...
19,781
6,660
# -*- coding: utf-8 -*- import csv from matplotlib import pyplot as plt from matplotlib.backends.backend_pdf import PdfPages def isValid(p, ep): return p in ep.patterns # CLASS ANALYSER class Analyser: """ Représentation d'un résultat d'analyse """ def __init__(self): """ :para...
1,108
333
# Definition for binary tree with next pointer. class TreeLinkNode: def __init__(self, x): self.val = x self.left = None self.right = None self.next = None class Solution: # @param root, a tree link node # @return nothing def connect(self, root): node = root ...
1,948
436
#!/usr/bin/env python3 import sys, os, glob from glbase3 import * all_species = glload('species_annotations/species.glb') newl = [] for file in glob.glob('pep_counts/*.txt'): oh = open(file, 'rt') count = int(oh.readline().split()[0]) oh.close() species_name = os.path.split(file)[1].split('.')[0].l...
982
362
import boto3 from prettytable import PrettyTable class LexIntentManager: def __init__(self): self.client = boto3.client('lex-models') def create_new_intent(self, intent_name, description="n/a", sample_utterances=[], slot_types=[]): intent_info = {'name': intent_name, ...
3,845
963
import sys sys.path.append("..") # Adds higher directory to python modules path.
80
22
from __future__ import absolute_import, division, print_function ''' Author : Lyubimov, A.Y. Created : 04/14/2014 Last Changed: 11/05/2018 Description : wxPython 3-4 compatibility tools The context managers, classes, and other tools below can be used to make the GUI code compatible with wxPython 3 and 4. Mos...
7,025
2,665
import torch import torch.nn as nn import csv #image quantization def quantization(x): x_quan=torch.round(x*255)/255 return x_quan #picecwise-linear color filter def CF(img, param,pieces): param=param[:,:,None,None] color_curve_sum = torch.sum(param, 4) + 1e-30 total_image = img * 0 f...
1,548
587
# AUTOGENERATED BY NBDEV! DO NOT EDIT! __all__ = ["index", "modules", "custom_doc_links", "git_url"] index = {"get_device": "00_basics.ipynb", "settings_template": "00_basics.ipynb", "read_settings": "00_basics.ipynb", "DEVICE": "00_basics.ipynb", "settings": "00_basics.ipynb", ...
4,849
1,960
# Convert the caffe2 model into tensorboard GraphDef # # The details of caffe2 model is on the compat/proto/caffe2/caffe2.proto # And the details of GraphDef model is on the compat/proto/graph.proto # ################################################################################ from tensorboard.compat.proto import ...
8,277
2,493
#!/usr/bin/env python # The MIT License (MIT) # Copyright (c) 2014 Alex Aquino dos Santos # Technische Universität München (TUM) # Autonomous Navigation for Flying Robots # Homework 2.1 from plot import plot class UserCode: def __init__(self): # initialize data you want to store in this object between c...
1,251
413
from configs import args import tensorflow as tf def forward(x, mode): is_training = (mode == tf.estimator.ModeKeys.TRAIN) x = tf.contrib.layers.embed_sequence(x, args.vocab_size, args.embed_dim) x = tf.layers.dropout(x, 0.2, training=is_training) feat_map = [] for k_size in [3, 4, 5]: _...
1,651
652
from datetime import datetime, timedelta from typing import Any, Union from jose import jwt from passlib.context import CryptContext from .config import settings pwd_context = CryptContext( default="django_pbkdf2_sha256", schemes=["django_argon2", "django_bcrypt", "django_bcrypt_sha256", ...
1,300
455
#!/usr/bin/env python from flask import Flask from flask import jsonify, render_template, redirect from flask import request, Response from saml_auth import BaseAuth, SamlAuth import os, sys try: import json except ImportError: # couldn't find json, try simplejson library import simplejson as json import getopt fro...
10,241
3,719
# -*- python -*- """@file @brief pyserial transport for pato Copyright (c) 2014-2015 Dimitry Kloper <kloper@users.sf.net>. All rights reserved. @page License Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistribut...
3,344
1,010
import sys from PyQt5.QtWidgets import * from PyQt5.QtGui import QFont, QPixmap from PyQt5.QtCore import QTimer from random import randint font = QFont("Times", 14) buttonFont = QFont("Arial", 12) computerScore = 0 playerScore = 0 class Windows(QWidget): def __init__(self): super().__init__() sel...
4,072
1,355
from os import walk import h5py import numpy as np from config.Database import Base from config.Database import engine from config.Database import Session from models.Music import Music from kmeans.kmeans import Kmeans mypath = './dataset/datatr/' def main(): files = [] # 2 - generate database schema Base.meta...
539
178
import torch.nn as nn import pretrainedmodels class classifier(nn.Module): def __init__(self, model_name='resnet32'): super(classifier, self).__init__() # Load pretrained ImageNet model self.model = pretrainedmodels.__dict__[model_name](num_classes=1000, pretrained='imagenet') ...
1,128
380
""" Given a Boolean function/network, get its algebraic state-space representation. A logical vector `\delta_n^i` is represented by an integer `i` for space efficiency. Consequently, a logical matrix is represented by a list, each element for one column, (also known as the "condensed form"). [1] Conversion from an in...
13,050
3,764
# -------------------------------------------------------- # Fast R-CNN # Copyright (c) 2015 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by Ross Girshick # Extended by Linjie Deng # -------------------------------------------------------- import os import cv2 import numpy as np import...
4,953
1,579
import discord import random import asyncio import logging import urllib.request from discord.ext import commands bot = commands.Bot(command_prefix='nep ', description= "Nep Nep") counter = 0 countTask = None @bot.event async def on_ready(): print('Logged in as') print(bot.user.name) # print(bot.user.id) ...
1,907
649
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. { 'name': 'Turkey - Accounting', 'version': '1.0', 'category': 'Localization', 'description': """ Türkiye için Tek düzen hesap planı şablonu Odoo Modülü. ==================================================...
1,025
402
import os import time import argparse import pandas as pd from smf import SessionMF parser = argparse.ArgumentParser() parser.add_argument('--K', type=int, default=20, help="K items to be used in Recall@K and MRR@K") parser.add_argument('--factors', type=int, default=100, help="Number of latent factors.") parser.add_a...
4,364
1,448
# coding: utf-8 """ App Center Client Microsoft Visual Studio App Center API # noqa: E501 OpenAPI spec version: preview Contact: benedetto.abbenanti@gmail.com Project Repository: https://github.com/b3nab/appcenter-sdks """ import pprint import re # noqa: F401 import six class Device(object)...
25,163
7,970
#!/usr/bin/env python # -*- coding: utf-8 -*- # author : Thomas Cuthbert import os, sys from providers.provider import Provider from config.config import Config sys.path.append('../') def _reverse_dict(d): ret = {} for key, val in d.items(): if ret.has_key(val): ret[val].append(key) ...
5,591
1,778