text
string
size
int64
token_count
int64
_base_ = ['./tracktor_faster-rcnn_r50_fpn_4e_mot17-public-half.py'] model = dict( pretrains=dict( detector= # noqa: E251 'https://download.openmmlab.com/mmtracking/mot/faster_rcnn/faster-rcnn_r50_fpn_4e_mot17-ffa52ae7.pth' # noqa: E501 )) data_root = 'data/MOT17/' test_set = 'test' data = dict...
754
307
from threading import Thread from time import sleep from selenium import webdriver from selenium.webdriver.common.keys import Keys from selenium.webdriver.common.desired_capabilities import DesiredCapabilities from selenium.common.exceptions import TimeoutException from selenium.webdriver.support.ui import WebDriverWai...
2,277
691
# -*- coding: utf-8 -*- from __future__ import unicode_literals import random from random import choice from string import digits from faker import Faker fake = Faker("fi_FI") def sanitize_address(value): return fake.address() def sanitize_address_if_exist(value): if value: return sanitize_addres...
2,396
849
#!/usr/bin/env python3 # # -*- mode:python; coding:utf-8 -*- # Copyright (c) 2020 IBM Corp. 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 # # https://www.apache.org...
11,024
3,163
from rest_framework import permissions def is_owner(user): return user.groups.filter(name='OWNER').exists() def is_driver(user): return user.groups.filter(name='DRIVER').exists() class IsOwnerPermission(permissions.BasePermission): def has_permission(self, request, view): return is_owner(reque...
642
186
import os import shutil import sys import multiprocessing import glob def copy(source, dest): shutil.copyfile(source, dest) def main(): input_folder = sys.argv[1] output_folder = sys.argv[2] print 'input reduce fps : ' , sys.argv fps = int(sys.argv[3]); final_length=float(sys.argv[4]) ; ...
1,488
564
# This file is part of Ansible # # Ansible 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. # # Ansible is distributed in the hope that ...
3,598
943
#!/usr/bin/env python from setuptools import setup with open("README.md") as readme_file: readme = readme_file.read() setup( author="Ron Klinkien", author_email="ron@cyberjunky.nl", classifiers=[ "Programming Language :: Python :: 3", "License :: OSI Approved :: MIT License", ...
806
270
# Copyright 2012 Grid Dynamics # 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...
9,513
2,616
"""Tests of the email subscription mechanism.""" import binascii import flask_webtest import mock import pytest import webtest.app import dnstwister import dnstwister.tools import patches @mock.patch('dnstwister.views.www.email.emailer', patches.NoEmailer()) @mock.patch('dnstwister.repository.db', patch...
8,504
3,153
""" 第二版:多进程二手房信息爬虫 1. 将爬虫分解为下载任务和解析任务(可以继续分解,但在本案中意义不大)两部分,两部分各使用一个子进程,相互通过数据管道通信 2. 下载任务内部不使用队列,使用任务管道实现(在多进程:主进程、子进程、子进程内部进程池等场景下,队列并不好用)任务管理和通信 3. 解析任务从与下载任务间的管道中获取数据,解析并保存 问题:当目标被爬完后,怎样让爬虫停止? """ import csv import datetime import logging import multiprocessing as mp import re import time from collections import O...
6,671
2,984
# Copyright 2016 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 ag...
8,415
2,608
import itertools import os from django.conf import settings from django.core.management import call_command from django.core.management.base import BaseCommand class Command(BaseCommand): help = 'Generates class diagrams.' def handle(self, *args, **options): if 'django_extensions' not in settings.IN...
1,681
466
#!/usr/bin/env python3 import argparse import os import glob import csv import sys import re from shutil import which import datetime def is_tool(name): return which(name) is not None def check_path(path): paths = glob.glob(path) if len(paths) == 0: exit("file not found: %s" % path) if len(pa...
8,543
2,876
# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class PyCupy(PythonPackage): """CuPy is an open-source array library accelerated with NVIDIA...
992
407
import logging from functools import wraps import status from httpx import exceptions from .exceptions import AuthError, ClientConnectionError, ClientError, NotFoundError, ServerError logger = logging.getLogger(__name__) def validate_response(response): error_suffix = " response={!r}".format(response) if r...
1,742
488
from HPOBenchExperimentUtils.resource_manager.file_resource_manager import FileBasedResourceManager
100
26
DEFAULT_MIRRORS = { "bitbucket": [ "https://bitbucket.org/{repository}/get/{commit}.tar.gz", ], "buildifier": [ "https://github.com/bazelbuild/buildtools/releases/download/{version}/{filename}", ], "github": [ "https://github.com/{repository}/archive/{commit}.tar.gz", ], ...
442
149
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Tue Jun 6 21:15:23 2017 @author: yolandatiao """ import csv import glob import os from astropy.io import ascii # For using ascii table to open csv from astropy.table import Table, Column # For using astropy table functions os.chdir("/Volumes/Huitian/...
2,059
830
import unittest from vendcrawler.scripts.vendcrawler import VendCrawler class TestVendCrawlerMethods(unittest.TestCase): def test_get_links(self): links = VendCrawler('a', 'b', 'c').get_links(2) self.assertEqual(links, ['https://sarahserver.net/?module=vendor&p=1', ...
674
240
#!/usr/bin/python3 # -*- coding: utf-8 -*- import time import json import os import sys import time import urllib import socket import argparse import requests import lib.common as common base_url = 'http://localhost:24879/player/' #------------------------------------------------------------------------------# # ...
7,104
1,676
# from tensorflow.keras import Model, Input # from tensorflow.keras.applications import vgg16, resnet50 # from tensorflow.keras.layers import (Conv2D, Conv2DTranspose, Cropping2D, add, Dropout, Reshape, Activation) # from tensorflow.keras import layers # import tensorflow as tf # # """ # FCN-8特点: # 1、不含全连接层...
9,913
4,592
def binom(n, k): """Quickly adapted from https://stackoverflow.com/questions/26560726/python-binomial-coefficient""" if k < 0 or k > n: return 0 if k == 0 or k == n: return 1 total_ways = 1 for i in range(min(k, n - k)): total_ways = total_ways * (n - i) // (i + 1) return...
1,331
504
# Copyright 2017 Division of Medical Image Computing, German Cancer Research Center (DKFZ) # # 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 #...
5,090
2,160
import argparse import time from kubernetes.client.rest import ApiException from polyaxon_client.client import PolyaxonClient from polyaxon_k8s.manager import K8SManager from sidecar import settings from sidecar.monitor import is_pod_running if __name__ == '__main__': parser = argparse.ArgumentParser() pars...
1,619
477
#! /usr/bin/env python import rospy from nav_msgs.msg import Odometry class OdomTopicReader(object): def __init__(self, topic_name = '/odom'): self._topic_name = topic_name self._sub = rospy.Subscriber(self._topic_name, Odometry, self.topic_callback) self._odomdata = Odometry() def to...
615
226
"""Tests for quantization""" import numpy as np import unittest import os import shutil import yaml import tensorflow as tf def build_fake_yaml(): fake_yaml = ''' model: name: fake_yaml framework: tensorflow inputs: x outputs: op_to_store dev...
4,432
1,472
# Copyright 2020 The Cirq Developers # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
43,229
13,348
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! import grpc from google.ads.google_ads.v0.proto.resources import media_file_pb2 as google_dot_ads_dot_googleads__v0_dot_proto_dot_resources_dot_media__file__pb2 from google.ads.google_ads.v0.proto.services import media_file_service_pb2 as google_dot...
3,163
1,039
import importlib import math import os from pathlib import Path from typing import Optional, Tuple import cv2 import numpy as np import requests import torch import kornia as K def read_img_from_url(url: str, resize_to: Optional[Tuple[int, int]] = None) -> torch.Tensor: # perform request response = requests...
15,044
6,129
# Copyright 2020 The Forte 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 applicable ...
3,318
980
from __future__ import print_function, absolute_import from sentry import analytics from sentry.signals import join_request_created, join_request_link_viewed @join_request_created.connect(weak=False) def record_join_request_created(member, **kwargs): analytics.record( "join_request.created", member_id=me...
565
176
from django.conf.urls import url, include from django.contrib import admin from django.views.generic import RedirectView from django.views.generic import TemplateView from django.contrib.sitemaps.views import sitemap from django.conf import settings from blog.sitemaps import ArticleSitemap urlpatterns = [ url(r'^...
715
237
#!/usr/bin/env python """ @package ion_functions.qc_functions @file ion_functions/qc_functions.py @author Christopher Mueller @brief Module containing QC functions ported from matlab samples in DPS documents """ from ion_functions.qc.qc_extensions import stuckvalues, spikevalues, gradientvalues, ntp_to_month import ...
34,840
11,860
"""Backward compatibility for version 0.8 API.""" from __future__ import absolute_import import inspect import datatest from datatest._compatibility import itertools from datatest._compatibility.collections.abc import Sequence from datatest._load.get_reader import get_reader from datatest._load.load_csv import load_cs...
10,702
3,077
# Copyright 2008 Owen Taylor # # This file is part of Reinteract and distributed under the terms # of the BSD license. See the file COPYING in the Reinteract # distribution for full details. # ######################################################################## import os import gobject import gtk import pango fr...
7,288
2,042
""" This script compares events from two ETLs to highlight differences in elapsed times or row counts. * Pre-requisites You need to have a list of events for each ETL. Arthur can provide this using the "query_events" command. For example: ``` arthur.py query_events -p development 37ACEC7440AB4620 -q > 37ACEC7440AB46...
5,975
1,877
# Augur: A Step Towards Realistic Drift Detection in Production MLSystems - Code # Copyright 2022 Carnegie Mellon University. # # NO WARRANTY. THIS CARNEGIE MELLON UNIVERSITY AND SOFTWARE ENGINEERING INSTITUTE MATERIAL IS FURNISHED ON AN "AS-IS" BASIS. CARNEGIE MELLON UNIVERSITY MAKES NO WARRANTIES OF ANY KIND, EITH...
4,163
1,414
SURVEY_POST = { 'tags': ['설문조사 관리'], 'description': '설문조사 등록', 'parameters': [ { 'name': 'Authorization', 'description': 'JWT Token', 'in': 'header', 'type': 'str', 'required': True }, { 'name': 'title', ...
2,316
820
import torch import torch.nn as nn import torch.nn.functional as F from torch.autograd import Variable import math from functools import partial import logging import os try: from . import initializer from .utils import load_state except: import initializer from utils import load_state __all__ = ['Re...
8,528
2,834
import pytest from inference_logic import Rule, Variable, search from inference_logic.data_structures import Assert, Assign @pytest.mark.xfail def test_90(): r""" P90 (**) Eight queens problem This is a classical problem in computer science. The objective is to place eight queens on a chessboard so ...
4,167
1,688
#!/usr/bin/env python # # Copyright 2015 Airbus # Copyright 2017 Fraunhofer Institute for Manufacturing Engineering and Automation (IPA) # # 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 # # ...
4,856
1,542
from flask_wtf import FlaskForm from wtforms import SubmitField, TextAreaField from wtforms.validators import DataRequired class CommentForm(FlaskForm): text = TextAreaField("Text", validators=[DataRequired()]) submit = SubmitField('Publish')
253
74
import numpy as np from ..transform import DenseTransform from ..decorators import multiple from ..transform import Transform __all__ = ['onehot', 'Onehot'] @Transform.register() class Onehot(DenseTransform): def __init__(self, depth=None): super().__init__() self.collect(locals()...
758
265
"""Handles data storage for Users, rides and requests """ # pylint: disable=E1101 import datetime from flask import make_response, jsonify, current_app from werkzeug.security import generate_password_hash import psycopg2 import config from databasesetup import db class User(): """Contains user columns and method...
12,893
3,744
import configparser ''' config = configparser.ConfigParser() config.read('db.ini') print(config.sections()) print(dict(config['mysqld'])['symbolic-links']) ''' def ReadConfig(filename, section, key=None): print(filename) config = configparser.ConfigParser() config.read(filename) print(config.section...
752
224
# -*- coding: utf-8 -*- # --------------------------------------------------------------------- # Forms wrapper # --------------------------------------------------------------------- # Copyright (C) 2007-2019 The NOC Project # See LICENSE for details # ------------------------------------------------------------------...
1,947
552
import json from django.shortcuts import get_object_or_404 from django.core import serializers from django.http import HttpResponse from .models import Unit from .utils import UNIT_LIST_FIELD BAD_REQUEST = HttpResponse(json.dumps({'error': 'Bad Request'}), status=400, content_type='application/json') def unit_json_li...
1,990
604
''' ex029: Escreva um programa que leia a velocidade de uma carro. Se ele ultrapassar 80 km/h, mostre uma mensagem dizendo que ele foi multado. A multa vai custar R$ 7,00 por cada Km acima do limite. ''' from colorise import set_color, reset_color cor = { 'limpa':'\033[m', 'white':'\033[1;97m' } set_color(fg='...
731
312
#!/usr/bin/env python3.4 # coding: utf-8 class Drawable: """ Base class for drawable objects. """ def draw(self): """ Returns a Surface object. """ raise NotImplementedError( "Method `draw` is not implemented for {}".format(type(self)))
256
103
# -*- coding: utf-8 -*- from __future__ import unicode_literals, print_function import os from django.conf import settings from django.shortcuts import reverse from django.core.management import call_command import test from dataops import pandas_db from workflow.models import Workflow class EmailActionTracking(te...
2,394
1,006
from attrdict import AttrDefault import asyncio class StepperMotor: def __init__(self): self.keys = ['a', 'b', 'aa', 'bb', 'common'] self.required_keys = ['a', 'b', 'aa', 'bb'] self._step_instructions = AttrDefault(bool, { '1': [[0, 1, 1, 1], [1, 0, 1, 1], [1, 1...
5,371
1,832
input_num = raw_input() print(str(eval(input_num)))
52
21
from django.contrib import admin from django.db.models import Count from reversion.admin import VersionAdmin from website.apps.lexicon.models import Lexicon from website.apps.entry.models import Task, TaskLog, Wordlist, WordlistMember from website.apps.core.admin import TrackedModelAdmin class CheckpointListFilter(adm...
2,808
809
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os import re import sys sys.dont_write_bytecode = True from pprint import pprint from base import BaseFest2Bash class Fest2Bash(BaseFest2Bash): def __init__(self, manifest): super(Fest2Bash, self).__init__(manifest) def generate(self, *args, **kw...
356
125
#!/usr/bin/env python """ Srapyd control methods """ import logging from typing import Any, Dict, List from urllib.parse import urljoin from opennem.settings import settings from opennem.utils.http import http from opennem.utils.scrapy import get_spiders logger = logging.getLogger("scrapyd.client") def get_jobs() ...
2,241
759
from abaqusConstants import * from .FailStrain import FailStrain from .FailStress import FailStress class Elastic: """The Elastic object specifies elastic material properties. Notes ----- This object can be accessed by: .. code-block:: python import material ...
6,316
1,869
# setup.py for pyscrabble from distutils.core import setup try: import py2exe HAS_PY2EXE = True except ImportError: HAS_PY2EXE = False import glob import os import pkg_resources import sys from pyscrabble.constants import VERSION from pyscrabble import util from pyscrabble import dist def fi...
3,255
1,214
def integrate_exponential(a, x0, dt, T): """Compute solution of the differential equation xdot=a*x with initial condition x0 for a duration T. Use time step dt for numerical solution. Args: a (scalar): parameter of xdot (xdot=a*x) x0 (scalar): initial condition (x at time 0) dt (scalar): timeste...
1,164
442
import json import geojson import geopandas as gpd class SaveToGeoJSON: __name_counter = 0 def file_name(self): if self.__name_counter == 0: self.__name_counter = 1 return "./out"+str(self.__name_counter)+".json" elif self.__name_counter == 1: self.__name_co...
1,199
393
import requests import ssbio.utils import os.path as op # #### PDB stats # Request flexibility data about one particular PDB. # # http://pdbflex.org/php/api/PDBStats.php?pdbID=1a50&chainID=A # # pdbID of structure you are interested in # chainID of chain you are interested in # # [{"pdbID":"1a50", # ...
3,504
1,364
""" Modify Notes """ # pylint: disable=too-few-public-methods from ...mysql.mysql_connection import MySqlConnection from ...mysql.orm.autogen_entities import Task class ModifyNotes(object): """ ModifyNotes responsible to update the record in db """ def __init__(self, db_name, notes_id, title=None, co...
1,065
318
# # This file is part of pyasn1 software. # # Copyright (c) 2005-2019, Ilya Etingof <etingof@gmail.com> # License: http://snmplabs.com/pyasn1/license.html # import sys try: import unittest2 as unittest except ImportError: import unittest from tests.base import BaseTestCase from pyasn1.type import namedval ...
1,834
700
#!/usr/bin/env python from setuptools import setup, find_packages from pymemcache import __version__ setup( name = 'pymemcache', version = __version__, author = 'Charles Gordon', author_email = 'charles@pinterest.com', packages = find_packages(), tests_require = ['nose>=1.0'], install_req...
858
265
import torch from plyfile import PlyData from torch_geometric.data import Data def read_ply(path): with open(path, 'rb') as f: data = PlyData.read(f) pos = ([torch.tensor(data['vertex'][axis]) for axis in ['x', 'y', 'z']]) pos = torch.stack(pos, dim=-1) face = None if 'face' in data: ...
543
198
from mlagents.trainers.brain import BrainInfo, BrainParameters, CameraResolution from mlagents.envs.base_env import BatchedStepResult, AgentGroupSpec from mlagents.envs.exception import UnityEnvironmentException import numpy as np from typing import List def step_result_to_brain_info( step_result: BatchedStepResu...
2,679
915
from setuptools import find_packages, setup from glob import glob import os package_name = 'mrdc_serial' setup( name=package_name, version='1.0.0', packages=find_packages(), data_files=[ ('share/ament_index/resource_index/packages', ['resource/' + package_name]), ('share/' + p...
853
267
from django.core.urlresolvers import reverse_lazy from django.views import generic from django.shortcuts import redirect, render from django.http import HttpResponseRedirect from django.core.urlresolvers import reverse from . import forms from . import models from custommixins import mixins class OrderView(generic.V...
2,577
732
""" This file defines some simple experiments to illustrate how Pytorch-Routing functions. """ import numpy as np import tqdm import torch from PytorchRouting.DecisionLayers import REINFORCE, QLearning, SARSA, ActorCritic, GumbelSoftmax, PerTaskAssignment, \ WPL, AAC, AdvantageLearning, RELAX, EGreedyREINFORCE, EGr...
5,219
1,777
from output.models.ms_data.regex.re_g22_xsd.re_g22 import ( Regex, Doc, ) __all__ = [ "Regex", "Doc", ]
121
58
#!/usr/bin/env python from skimage.color import rgb2gray from skimage.io import imread, imsave from scipy.misc import toimage import numpy as np import wrapper as wr ########################################################### # IMAGE IO ########################################################### def imload_rgb(pa...
6,670
2,061
from django.db.models import fields from main.models import RoomReservation, UserRoom from django import forms from django.core.exceptions import ValidationError from django.contrib.auth import authenticate, login from django.contrib.auth import get_user_model class ReservateRoomForm(forms.Form): begin_date = for...
659
190
""" Module to define various calculation types as Enums for VASP """ import datetime from itertools import groupby, product from pathlib import Path from typing import Dict, Iterator, List import bson import numpy as np from monty.json import MSONable from monty.serialization import loadfn from pydantic import BaseMod...
4,855
1,675
from mono_left import MonoLeft from mono_right import MonoRight from mono_rear import MonoRear from stereo_left import StereoLeft from stereo_right import StereoRight from stereo_centre import StereoCentre
207
73
import sys import pandas as pd from sqlalchemy import create_engine import nltk nltk.download(['punkt', 'wordnet', 'averaged_perceptron_tagger']) import re from nltk.tokenize import word_tokenize from nltk.stem import WordNetLemmatizer from sklearn.metrics import classification_report from sklearn.metrics import confus...
4,165
1,353
import os from datetime import date from django.conf import settings from django.core.mail import send_mail from django.template.loader import render_to_string from django.utils import translation from django.utils.translation import ugettext as _ from mailchimp3 import MailChimp class Email: from_email = settin...
6,213
1,904
# coding=utf-8 # Copyright 2019 The Edward2 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 applicable law o...
7,456
2,412
from flask import Blueprint, render_template from flask_babel import format_number import critiquebrainz.db.users as db_users import critiquebrainz.db.review as db_review from bs4 import BeautifulSoup from markdown import markdown DEFAULT_CACHE_EXPIRATION = 10 * 60 # seconds frontend_bp = Blueprint('frontend', __nam...
1,287
413
import strawberryfields as sf from strawberryfields import ops from strawberryfields.utils import random_interferometer from strawberryfields.apps import data, sample, subgraph, plot import plotly import networkx as nx import numpy as np class GBS: def __init__(self, samples =[], min_pho = 16, max_pho = 30, subgra...
2,406
951
#!/usr/bin/env python # # Copyright (c) 2015-2017 Nest Labs, 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/licen...
10,781
3,418
# -*- coding: utf-8 -*- """ Modules to support data reduction in Python. The main purpose of the base module ``Data_Reduction`` is to provide a suplerclass with a good set of attributes and methods to cover all common needs. The base module is also able to read data from a text file as a ``numpy`` structured array. ...
46,866
15,008
""" PyGRB. A GRB light-curve analysis package. """ __version__ = "0.0.5" __author__ = 'James Paynter' from . import backend from . import fetch from . import main from . import postprocess from . import preprocess
219
78
import os from dotenv import load_dotenv load_dotenv() class Config: SECRET_KEY = os.environ.get('SECRET_KEY') SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URI') MAIL_SERVER = 'smtp.gmail.com' MAIL_PORT = 587 MAIL_USE_TLS = True MAIL_USERNAME = os.environ.get('EMAIL_USERNAME') MAIL_P...
363
146
import numpy as np from wordreps import WordReps from algebra import cosine, normalize import tensorflow as tf import random from dataset import DataSet import CGRE_Model from Eval import eval_SemEval import sklearn.preprocessing # ============ End Imports ============ class Training(): def __init__(self): # Compo...
8,483
3,727
from radtrans_integrate import radtrans_integrate from polsynchemis import polsynchemis import numpy as np import scipy.integrate # calculate synchrotron emissivity for given coefficients def synch_jarho(nu,n,B,T,theta): if ((np.isscalar(nu)==False) & (np.isscalar(n)==True)): n = n + np.zeros(len(nu)) ...
1,071
466
""" Copyright 2016 Brocade Communications Systems, 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 i...
1,683
447
import os __all__ = ['DATA_FOLDER', 'load_data'] DATA_FOLDER = os.path.dirname(os.path.abspath(__file__)) def load_data(name): """ Loads an Excel form from the data folder with the specified name. Parameters ---------- name : str The name of the form without file extension. """ ...
461
155
var = "Docker" print(f"Hello {var} world!")
45
21
""" Model mixin classes for auth, category and recipe modules """ from app import db # pylint: disable=C0103 # pylint: disable=E1101 class BaseMixin(object): """ Define the 'BaseModel' mapped to all database tables. """ id = db.Column(db.Integer, primary_key=True, autoincrement=True) def save(self): ...
841
258
import dash_core_components as dcc import dash_html_components as html from config import strings def make_tab_port_map_controls( port_arr: list, port_val: str, vessel_types_arr: list, vessel_type_val: str, year_arr: list, year_val: int, month_arr: list, month_val: int, ) -> html.Div: ...
4,239
975
from typing import List from subs2srs.core.preview_item import PreviewItem class StatePreview: items: List[PreviewItem] = [] inactive_items = set() def __init__(self): super().__init__() self.items = [] self.inactive_items = set() self.audio = None class State: deck_...
628
218
import sys sys.path.append("..") from src.sync_ends_service import SyncEnd from src.parser import Parser def main(): # get the arguments from commadn line parser = Parser() collection_name, api_key, trigger_interval, slack_channel, slack_token = parser.get_argumenets() sync_end = SyncEnd(api_key, co...
499
166
# Copyright 2018-present Kensho Technologies, LLC. """Workarounds for OrientDB scheduler issue that causes poor query planning for certain queries. For purposes of query planning, the OrientDB query planner ignores "where:" clauses that hit indexes but do not use the "=" operator. For example, "CONTAINS" can be used t...
22,429
5,606
from enum import IntEnum import functools import usb.core import usb.util from traffic_light.error import TrafficLightError, MultipleTrafficLightsError BM_REQUEST_TYPE = 0x21 B_REQUEST = 0x09 W_VALUE = 0x200 W_INDEX = 0x00 ID_VENDOR = 0x0d50 ID_PRODUCT = 0x0008 INTERFACE = 0 class Color(IntEnum): RED = 0x10 ...
3,763
1,146
# coding=utf-8 # ------------------------------------ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # ------------------------------------ """ FILE: sample_analyze_orchestration_app_luis_response_async.py DESCRIPTION: This sample demonstrates how to analyze user query using an orchestra...
3,646
1,076
# flake8: noqa from schemas.client_credentials import * from schemas.message import * from schemas.token import * from schemas.user import *
141
44
import json from web3 import Web3 from solcx import compile_standard, install_solc with open("./SimpleStorage.sol", "r") as file: simple_storage_src = file.read() # install solcx install_solc("0.8.0") # compile the source compiled_sol = compile_standard( { "language": "Solidity", "sources": ...
2,499
891
from noise.dh.dh import DH from noise.cipher.cipher import Cipher from noise.hash.hash import Hash from noise.processing.handshakepatterns.handshakepattern import HandshakePattern from noise.processing.impl.handshakestate import HandshakeState from noise.processing.impl.symmetricstate import SymmetricState from noise....
2,154
646
import urllib.parse import webbrowser import json from xml.etree import ElementTree import sublime import SublimeHaskell.sublime_haskell_common as Common import SublimeHaskell.internals.utils as Utils import SublimeHaskell.internals.unicode_opers as UnicodeOpers import SublimeHaskell.symbols as symbols import Sublim...
9,550
2,825
#!/usr/bin/env python # Copyright (C) 2017 Seeed Technology Limited # # 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 ...
4,126
1,442