text
string
size
int64
token_count
int64
import pandas as pd import numpy as np import re import plotly.graph_objects as go from plotly.graph_objs import * from plotly.offline import plot from sklearn.ensemble import RandomForestRegressor, RandomForestClassifier import IPython, graphviz from sklearn.tree import export_graphviz def missing_value_plot(df): ...
5,271
1,906
import googleapiclient.discovery import googleapiclient from datetime import datetime import os import sqlite3 import csv PROJECTNAME = "shijian-18" os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = '/Users/ozymandias/Desktop/cloudComputing/shijian-18-key.json' COMPUTE = googleapiclient.discovery.build('compute', 'v1') ...
8,464
2,784
from breidablik.interpolate.rew import Rew import numpy as np import pytest import warnings try: Rew() flag = False except: flag = True # skip these tests if the trained models are not present pytestmark = pytest.mark.skipif(flag, reason = 'No trained Rew model') class Test_find_abund: @classmethod ...
1,238
483
from pathlib import Path from fhir.resources.valueset import ValueSet as _ValueSet from oops_fhir.utils import ValueSet from oops_fhir.r4.code_system.example_service_modifier_codes import ( ExampleServiceModifierCodes as ExampleServiceModifierCodes_, ) __all__ = ["ExampleServiceModifierCodes"] _resource = _V...
688
219
from typing import Union, Callable from datetime import datetime, timedelta from rx.core import ObservableBase, AnonymousObservable from rx.disposables import CompositeDisposable, SerialDisposable, MultipleAssignmentDisposable from rx.concurrency import timeout_scheduler class Timestamp(object): def __init__(sel...
4,299
993
# -*- coding: utf-8 -*- from collections import OrderedDict from json import dump, dumps import csv class StateNeighbors(object): """ Object that handles the finding of nieghbors :param file_name: CSV that contains pairings of states :param ordered: Whether or not to use an `OrderedDict` so that the ...
4,804
1,335
import requests print("Collecting JSON...") url_text = requests.get("https://bing.com/HPImageArchive.aspx?format=js&idx=0&n=1").json() response = url_text["images"][0]["url"] img_url = f"https://bing.com{response}" print(f"Collecting Image from {img_url}") img = requests.get(img_url) print("Writing...") w...
397
159
from django.contrib.auth import get_user_model from django.test import TestCase from django.test.client import Client from molo.core.models import SiteLanguageRelation, Main, Languages, ArticlePage from molo.core.tests.base import MoloTestCaseMixin from molo.surveys.models import ( MoloSurveyPage, MoloSurveyFo...
5,466
1,569
from cms.extensions import PageExtension, TitleExtension from cms.extensions.extension_pool import extension_pool from cms.models import Page, Title from django.core.cache import cache from django.db.models.signals import post_save, pre_delete from django.dispatch import receiver from django.utils.translation import ug...
2,078
633
import numpy as np from numpy.random import choice from numpy import array from numpy import random import csv import random #from itertools import izip #pseudo code list_molecular_profile = ['BRAF','CTNNB1','HRAS','SUB_OPTIMAL_SAMPLE','PIK3CA','TP53','NRAS','EGFR','KRAS','STK11','RET','ERBB2'] ls_mut_PICK3CA...
5,248
2,208
#!/usr/bin/python from analib import api_common as api_common import utils class APIInbound: debug_level = 3 env = "staging" header_entitled_org = None def __init__(self, debug_level, org_id, env, header_entitled_org): self.env = env self.org_id = org_id self.debug_level = deb...
2,048
676
""" Copyright (c) 2015 Ad Schellevis <ad@opnsense.org> All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, ...
10,902
3,071
from armulator.armv6.opcodes.abstract_opcodes.revsh import Revsh from armulator.armv6.opcodes.opcode import Opcode class RevshA1(Revsh, Opcode): def __init__(self, instruction, m, d): Opcode.__init__(self, instruction) Revsh.__init__(self, m, d) def is_pc_changing_opcode(self): return...
596
219
# Copyright 2008 the V8 project authors. All rights reserved. # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditi...
4,057
1,396
from discord.ext import commands from discord import Embed, Member from discord.ext.commands import BucketType import rethinkdb as r class UserInfo: # Inside this class we make our own command. def __init__(self, bot): self.bot = bot # Makes this class a command/extension self.connection = r.co...
2,533
765
from __future__ import division from lyse import * from pylab import * import os from analysislib.common.fit_gaussian_2d import fit_2d from analysislib.spinor.aliases import * from time import time # from matplotlib.patches import Ellipse, Path, PathPatch import pandas as pd # Parameters do_fit = True display_OD = Tru...
8,054
3,002
# -*- coding: utf-8 -*- """ Created on Thu Apr 16 09:21:30 2020 @author: ABHIJIT SHOW """ from flask_cors import CORS, cross_origin from flask import Flask, render_template, request, json, jsonify import twitter import get_news import world import time_series import os app = Flask(__name__) cors = CORS(app, resour...
4,042
1,443
__version__ = "0.1.0" __author__ = 'Phillip B Oldham' __licence__ = 'MIT'
74
35
print("Блок на числа:") a: int = int(input("От числа>")) b: int = int(input("До числа>")) print("На числа:") c: int = int(input("От числа>")) d: int = int(input("До числа>")) # Вводим переменные factor1: list = list(range(a, b+1)) factor2: list = list(range(c, d+1)) # Диапазон чисел в листы print(" ", end="\t") # ...
787
329
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Mar 6 12:05:27 2019 @author: olivierp """ import pandas as pd import numpy as np import pickle import warnings as wn import nibabel as nib import numpy.ma as ma pd.options.display.precision = 10 def regionf(data, value): string = "" andstring ...
35,677
15,677
import pymysql class DBHelp(): def __init__(self,host,port,user,password,database,charset): self.host = host self.port = port self.user = user self.password = password self.database = database self.charset = charset self.db = None self.cursor = None...
4,409
1,364
""" Author: Dian Chen Note that this script only applies to Box3dReachPixel environments """ from sandbox.rocky.tf.envs.base import TfEnv from rllab.envs.gym_env import GymEnv from rllab.envs.normalized_env import normalize from rllab.misc import logger from railrl.predictors.dynamics_model import NoEncoder, FullyCon...
8,975
3,751
# -*- coding: utf-8 -*- import datetime import re import os import json import codecs import urllib2 import urllib import threading from AvatarInputHandler import control_modes import BigWorld import BigWorld from constants import AUTH_REALM from gui.Scaleform.daapi.view.lobby.hangar import Hangar class Config(objec...
9,499
3,089
def parsenum(s,num): result=0 #num*=2 for i in range(0,num): result=result*16+s[i] return result def getint(s): return parsenum(s,4) def getshort(s): return parsenum(s,2) def getstring(s): return str(s) def getbool(s): return (s==1) or (s==b"\x01")
288
125
# -*- encoding: utf-8 -*- import numpy as np from sklearn.model_selection import train_test_split from deeptables.models import deeptable from deeptables.preprocessing.transformer import MultiVarLenFeatureEncoder from deeptables.utils import consts from deeptables.datasets import dsutils class TestVarLenCategoricalFe...
2,120
651
from flask import Blueprint, render_template, flash, current_app, request, redirect, session, abort from application.models.database import get_db import hashlib, os from secrets import token_urlsafe bp = Blueprint("users", __name__, url_prefix="/users") def get_team(key): db = get_db() with db.cursor() as cu...
5,242
1,607
from fastapi import APIRouter, Depends, HTTPException from sqlalchemy.orm import Session from sql_app.database import orm_connection from sql_app import schemas, models, crud SessionLocal, engine = orm_connection() models.Base.metadata.create_all(bind=engine) # Dependency def get_db(): db = SessionLocal() try...
1,170
373
# 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...
1,823
566
from flask import Blueprint, request, url_for, render_template_string from api.utils.responses import response_with from api.utils import responses as resp from api.models.users import User, UserSchema from api.utils.database import db from api.utils.token import generate_verification_token, confirm_verification_token...
2,968
1,052
import torch import torch.nn as nn import numpy as np class ConditionalSimNet(nn.Module): def __init__(self, embeddingnet, n_conditions, embedding_size, learnedmask=True, prein=False): """ embeddingnet: The network that projects the inputs into an embedding of embedding_size n_conditions: Integ...
2,700
798
import os.path from os import remove, path import pickle from typing import List, Any, Dict, Callable, Union, Hashable, Tuple import datetime import yaml from core.chat_functions import send_text_to_room, send_reaction, send_replace from asyncio import sleep import logging from nio import AsyncClient, JoinedMembersResp...
33,901
9,112
from collections import deque chocolate = [int(num) for num in input().split(",")] milk = deque([int(num) for num in input().split(",")]) milkshakes = 0 milkshakes_success = False while chocolate and milk: current_chocolate = chocolate[-1] current_milk = milk[0] if current_chocolate <= 0 and current_mi...
1,158
402
import torch import torch.nn as nn import math class DumbFeat(nn.Module): def __init__(self,opt): super(DumbFeat,self).__init__() dropout = opt['dropout'] if ('dropout' in opt) else 0.0 self.dropout = ( torch.nn.Dropout(p=dropout, inplace=False) if (dropout>0.0) else...
579
215
# -*- coding:utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import base64 import zipfile import io import logging import re from datetime import date, datetime from lxml import etree from odoo import api, fields, models, _ from odoo.tools import float_repr from odoo.exceptions i...
14,362
4,734
#!/usr/bin/env python # every node in roots will have a key. meta_info and synced is not part of the bookmarks # every node after that , the node are stored like a tree, with their key being "childrens". # each node will have # .1 date_added # .2 date_modified # .3 id ?? probably the id that is registed. # .4 meta_info...
5,628
1,631
from authtools.models import User from django import forms from .services import normalize_phone from .models import * from datetime import date from datetime import timedelta class ContactForm(forms.ModelForm): class Meta: model = Contact exclude = ['agent', 'in_sales', 'is_client', 'created_a...
3,389
1,039
from django.forms.models import model_to_dict from rest_framework.views import APIView class NotificationsView(APIView): notified_users_field = None notification_diff_ignored_fields = [] def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self._http_action = None ...
2,465
708
from .build import HEAD_REGISTRY, build_head from .simple_head import build_simple_pred_head
93
30
from abc import ABC, abstractmethod import pygame ''' This is the module that will do whatever it takes to create your screens, it is required that you have pygame installed to work correctly. All your screens must be a class that inherits Screen(). The ScreenManager class must be called o...
10,262
2,823
#!/usr/bin/env python3 import numpy as np import isce3.ext.isce3 as isce3 def test_presum_weights(): n = 31 rng = np.random.default_rng(12345) t = np.linspace(0, 9, n) + rng.normal(0.1, size=n) t.sort() tout = 4.5 L = 1.0 acor = isce3.core.AzimuthKernel(L) offset, w = isce3.focus.get_p...
809
357
from collections import OrderedDict from pathlib import Path import pytest from ewatercycle.parametersetdb import build_from_urls @pytest.fixture def yaml_config_url(): return "data:text/plain,data: data/PEQ_Hupsel.dat\nparameters:\n cW: 200\n cV: 4\n cG: 5.0e+6\n cQ: 10\n cS: 4\n dG0: 1250\n cD: 1500\n ...
1,849
730
from django.conf.urls import include from django.conf.urls import url from django.contrib import admin from django.contrib.staticfiles.urls import staticfiles_urlpatterns from machina import urls as machina_urls admin.autodiscover() urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'', include(machina_...
371
117
from controller_class import * class ProductController(ShopController): """creates a controller to add/delete/amend product records in the myshop database""" def __init__(self): super(ProductController,self).__init__() def add_product(self,name,price,product_type): sql = """insert ...
2,701
794
import sys, glob, os, scipy import numpy as np import pandas as pd from scipy.optimize import least_squares from scipy.io import loadmat import costFunctions import choiceModels import penalizedModelFit base_dir = 'yourprojectfolderhere' # Arguments sub = int(sys.argv[1]) # This takes the subject number niter = int(...
8,232
3,228
from model.data_utils import CoNLLDataset from model.config import Config from model.ner_model import NERModel from model.ner_learner import NERLearner # from model.ent_model import EntModel # from model.ent_learner import EntLearner def main(): # create instance of config config = Config() if config.use_...
834
260
#!/usr/bin/env python import sys #to get argument import unittest import unitstyle #collect all of our test scripts as a test suite my_tests = unittest.TestLoader().discover("tests/") # get command-line output format if provided try: output_format = sys.argv[1] except IndexError: #nothing provided output_format ...
419
128
import io import boto3 from dagster_aws.s3 import S3FileCache, S3FileHandle from moto import mock_s3 @mock_s3 def test_s3_file_cache_file_not_present(): s3 = boto3.client('s3') s3.create_bucket(Bucket='some-bucket') file_store = S3FileCache( s3_bucket='some-bucket', s3_key='some-key', s3_session=...
1,441
562
import cv2 import torch def save(path, model): torch.save(model.state_dict(), path) def load(path, model): model.load_state_dict(torch.load(path)) def getDevice(cuda=True): cuda = cuda and torch.cuda.is_available() device = torch.device("cuda" if cuda else "cpu") # if cuda: # print("De...
514
193
# -*- coding: utf-8 -*- from django.db import models from django.core.validators import RegexValidator from django.forms import ModelForm from django.contrib.auth.models import User ALPHANUMERIC = RegexValidator(r'^[0-9a-zA-Z. _-]*$', 'Use only alphanumeric characters or `. _-`.') clas...
5,180
1,406
# -*- coding: utf-8 -*- from flask import Blueprint client = Blueprint('client', __name__, template_folder='templates', static_folder='static', url_prefix='/client') import signin import user import book
207
64
from __future__ import print_function from flask import Flask, request from flask_restful import reqparse, abort, Api, Resource import argparse import json import os import random CHARS = "BCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz123456789" # 60 unique characters. UNIQUE_LEN = 6 # 46B unique app = Flask...
7,115
2,256
#!/usr/bin/env python # -*- coding: utf-8 -*- # # nnutil2 - Tensorflow utilities for training neural networks # Copyright (c) 2019, Abdó Roig-Maranges <abdo.roig@gmail.com> # # This file is part of 'nnutil2'. # # This file may be modified and distributed under the terms of the 3-clause BSD # license. See the LICENSE fi...
1,350
456
#!/usr/bin/python3 from PDFSinusText import PDFSinusText as FPDF pdf=FPDF() pdf.add_page() pdf.set_font('helvetica', 'B', 10) pdf.set_text_color(250, 0, 0) txt1 = 'The Quick Brown Fox Jumps Over The Lazy Dogs.' txt2 = '+++++++++++++++++++++++++++++++++++++++' pdf.sinus_text(20, 30, txt1, 10, 3) pdf.sinus_text(20, ...
561
314
from numpy import linspace, sin from chaco.api import ArrayPlotData, Plot from chaco.tools.api import PanTool, ZoomTool from enable.component_editor import ComponentEditor from traits.api import Enum, HasTraits, Instance from traitsui.api import Item, Group, View class PlotEditor(HasTraits): plot = Instance(Plo...
2,381
717
from mysocket import * from LinkLayer import util ip = util.get_local_ipv4_address() port = 5000 local_address = (ip, port) remote_address = ('10.20.117.131', 5000) ClientSocket = socket(AF_INET, SOCK_STREAM) ClientSocket.bind(local_address) ClientSocket.connect(remote_address) for i in range(10): ClientSocket.send...
466
172
# GENERATED BY KOMAND SDK - DO NOT EDIT from .get_agent.action import GetAgent from .get_agents.action import GetAgents from .get_alert.action import GetAlert from .get_alerts.action import GetAlerts from .get_events.action import GetEvents from .get_rule.action import GetRule
278
88
#!/usr/bin/python3 # coding=utf-8 # pylint: disable=I0011,R0903,W0702,W0703,R0914,R0912,R0915 # Copyright 2019 getcarrier.io # # 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 # # ...
11,731
3,208
# Given a binary tree, find its maximum depth. # The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node. # Note: A leaf is a node with no children. # Example: # Given binary tree [3,9,20,null,null,15,7], # 3 # / \ # 9 20 # / \ # 15 7 #...
1,058
334
import xml.etree.ElementTree as ET import pickle import os from utils.params import * import utils.stringutils as stringutils def hiraganify_single_on_yomi(on_yomi: str): utf8_bytes = list(on_yomi.encode("utf-8")) kun_yomi = "" for char in on_yomi: if char == 'ー': # new_char = kun_...
3,584
1,298
#!/usr/bin/python3 """ Download files for an SoC FPGA project from AWS. This script downloads the bitstream, device tree overlay, and device drivers located in a user-supplied directory in a user-supplied S3 bucket. Parameters ---------- s3bucket : str Name of the S3 bucket s3directory : str Name of the S3 d...
15,445
4,401
# 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...
945
283
# Generated by Django 2.2 on 2019-12-31 11:29 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('books', '0001_initial'), ] operations = [ migrations.RenameField( model_name='review', ...
759
236
#!/usr/bin/env python3 # -*- coding: utf8 -*- import _csv import csv import sys import traceback from .constants import * from .this_sensor import this_sensor class DataSet: def __init__(self, time, hardware_timestamp, extract_id, trigger, accelerometer_x, accelerometer_y, accelerometer_z, gyroscope...
8,433
2,931
#!/usr/bin/env python # -*- coding: utf-8 -*- def sayHello(): print 'Hello world' sayHello()
98
39
VAL.filename = '//mx340hs/data/anfinrud_1810/Archive//14IDA.DAC1_4.VAL.txt'
75
43
import os import pandas as pd from .base import BaseIsolatedDataset from ..data_readers import load_frames_from_video class AUTSLDataset(BaseIsolatedDataset): """ Turkish Isolated Sign language dataset from the paper: `AUTSL: A Large Scale Multi-modal Turkish Sign Language Dataset and Baseline Methods...
1,292
443
# -*- coding:utf-8 -*- from django.db import models from django.contrib.auth.models import User class Link(models.Model): STATUS_ITEM = ( (1, '上线'), (2, '删除'), ) title = models.CharField(max_length=255, verbose_name='名字') href = models.URLField(verbose_name='链接') user = models.Fo...
1,551
586
#!/usr/bin/env python # -*-coding:utf-8-*- from fool import trie class Dictionary(): def __init__(self): self.trie = trie.Trie() self.weights = {} self.sizes = 0 def delete_dict(self): self.trie = trie.Trie() self.weights = {} self.sizes = 0 def add_dict(...
1,117
344
from .archive import archive from .analysis import ArchivedURL from .analysis import ArchivedURLSet from .analysis import Hyperlink from .analysis import Image from .exceptions import ArchiveFileNameError from .files import create_archive_filename from .files import open_archive_directory from .files import open_archiv...
903
264
#!/usr/bin/env python3 __author__ = 'Petr Ankudinov' from jinja2 import meta, FileSystemLoader import jinja2.nodes import os import sys import yaml from modules.tools import merge_dict, build_dict def build_dict_recursive(lst_or_tpl): # Recursive function that builds a hierarchical dictionary from lists and sub...
10,170
3,071
# uncompyle6 version 3.7.4 # Python bytecode 3.7 (3394) # Decompiled from: Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)] # Embedded file name: T:\InGame\Gameplay\Scripts\Server\routing\route_events\route_event_type_balloon.py # Compiled at: 2019-05-04 03:39:00 # Size of source...
3,225
1,051
# -*- coding: utf-8 -*- """Como asignar o cambiar el contenido de una variable string""" r='hola' m= 'l' + r[1:] print("El contenido de M es {} y cambio de R que es {}".format(m, r)) """Como recorrer un string y conocer su longitud.""" my_string = 'platzi' my_string [len(my_string)-1] # Se debe restar un valor, para...
899
334
#!/usr/bin/env python3 from typing import Iterator from turing_complete_interface.scripts import * import argparse def read_file(file_name: str, word_size: int, dont_cares: list[int]) -> list[int]: with open(file_name, "rb") as f: data = f.read() data = [data[i:i + word_size] for i in range(0, len(dat...
8,280
2,716
# Generated by Django 2.0 on 2018-08-28 18:43 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('publications', '0015_auto_20180828_1842'), ] operations = [ migrations.RenameField( model_name='experimentpopulation', old_nam...
392
140
import os from itertools import chain from typing import Dict, List import github import yaml from fire import Fire GITHUB_TOKEN: str = os.getenv('GITHUB_TOKEN') gh: github.Github = github.Github(GITHUB_TOKEN) class Label(object): def __init__(self, data: Dict) -> None: self.name = data.get('name') ...
3,784
1,189
#CB 17/03/2019 #GMIT Data Analytics Programming & Scripting Module 2019 #Problem Sets #Problem Set 6 #Reference https://teamtreehouse.com/community/trying-to-take-out-every-other-item-in-a-list #Creating a variable 'sentence' which asks the user to input a sentence, and then stores the input as a string. sentence = s...
1,210
333
""" wrapper for imagej and python integration using ImgLyb """ # TODO: Unify version declaration to one place. # https://www.python.org/dev/peps/pep-0396/#deriving __version__ = '0.6.0.dev0' __author__ = 'Curtis Rueden, Yang Liu, Michael Pinkert' import logging, os, re, sys import scyjava_config import jnius_config ...
32,301
8,988
#!/usr/bin/env python3 # HTTP+XML client as Oracle Tuxedo server # Caches rates in memory until client.py calls RELOAD_* services import os import sys import urllib.request from xml.etree import ElementTree as et import tuxedo as t class Server: def tpsvrinit(self, args): self._rates = None t.use...
1,270
452
""" Unit tests for bblab/image/processing.py Please keep them up-to-date when developing new code. Run the tests with >>> python -m unittest For detailed information please refer to https://readthedocsmissinglink.temp or docs/source/tests.rst """ import os import unittest import platform import numpy import cv2 imp...
4,462
1,528
import pytest import ray from ray import serve from ray.experimental.dag import InputNode from ray.serve.pipeline.generate import ( transform_ray_dag_to_serve_dag, extract_deployments_from_serve_dag, ) from ray.serve.pipeline.tests.test_modules import Model, Combine def _validate_consistent_output( deplo...
5,164
1,651
from models import OID_KEY, PendingRepairDataModel from extutils.mongo import get_codec_options from ._base import BaseCollection from ._dbctrl import SINGLE_DB_NAME from .factory import MONGO_CLIENT from ..utils import BulkWriteDataHolder __all__ = ("PendingRepairDataManager",) DB_NAME = "pdrp" class _PendingRepa...
1,032
358
# coding: utf-8 """ BillForward REST API OpenAPI spec version: 1.0.0 Generated by: https://github.com/swagger-api/swagger-codegen.git 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...
24,192
7,150
import json multinode_data = { 'known_nodes':[ { 'name':'Node1', 'address':'tcp://192.168.10.77:9000', 'server_key':'server1.key', 'server_secret_key':'server1.key_secret', #only needed for this_node 'client_secret_key':'client1.key_secret' #o...
1,398
482
# vim:fileencoding=utf-8:ft=python # file: dxfreader.py # # Copyright © 2015 R.F. Smith <rsmith@xs4all.nl>. All rights reserved. # Created: 2015-04-16 11:57:29 +0200 # Last modified: 2017-06-04 16:05:49 +0200 # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided t...
4,511
1,571
import logging import sys from oslo.config import cfg import pxssh import pexpect from nova.i18n import _ from nova.image import exception LOG = logging.getLogger(__name__) CONF = cfg.CONF sync_opt = [ cfg.IntOpt('scp_copy_timeout', default=3600, help=_('when snapshot, max wait (second)time for ...
3,918
1,158
"""Start a tcp gateway.""" import click from mysensors.cli.helper import ( common_gateway_options, handle_msg, run_async_gateway, run_gateway, ) from mysensors.gateway_tcp import AsyncTCPGateway, TCPGateway def common_tcp_options(func): """Supply common tcp gateway options.""" func = click.op...
1,102
372
""" python3 to_nps <piece> Output: (0,42) (0,46) (1,42) ... (842,58) """ import sys import os sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), os.pardir)) import music21 from indexers import NotePointSet from piece import Note def main(): with open(sys.argv[1], "rb") as f: sd = f...
507
216
#!/usr/bin/env python # -*- coding: utf-8 -*- # vim:fenc=utf-8:et """Date and Time util """ __author__ = ["Jianlong Chen <jianlong99@gmail.com>"] __date__ = "2013-07-17" import datetime def year(): return datetime.datetime.strftime(datetime.datetime.now(), '%Y') def date_time(): return datetime.datetime.str...
542
204
collection = "sys"
18
6
from django import forms from project.models import Project from project.models import ProjectUserMembership class ProjectAdminForm(forms.ModelForm): class Meta: model = Project fields = '__all__' def clean_code(self): """ Ensure the project code is unique. """ ...
2,309
582
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import gzip import sys import glob import logging import collections from optparse import OptionParser # brew install protobuf # protoc --python_out=. ./appsinstalled.proto # pip install protobuf import appsinstalled_pb2 # pip install python-memcached import memc...
8,234
2,744
import _thread as thread from time import sleep from os import system
69
16
__all__ = ['psUtils', 'textureColorAnalysis', 'steerablePyramid', 'reconstructFromPyramid', 'featurecache']
107
36
import sys import os PY3 = sys.version_info[0] == 3 script_dir = os.path.dirname(os.path.realpath(__file__)) + os.sep err_dir = script_dir + "errors" + os.sep lib = os.path.abspath(script_dir + os.sep + ".." + os.sep + "lib") sys.path.append(lib) import binder run_eval = binder.run_eval if __name__ == "__main__": b...
333
138
import os from .input import VaspInput __author__ = "Guillermo Avendano-Franco" __copyright__ = "Copyright 2016" __version__ = "0.1" __maintainer__ = "Guillermo Avendano-Franco" __email__ = "gtux.gaf@gmail.com" __status__ = "Development" __date__ = "May 13, 2016" def read_incar(filename='INCAR'): """ Load t...
1,272
445
def test(): # Here we can either check objects created in the solution code, or the # string value of the solution, available as __solution__. A helper for # printing formatted messages is available as __msg__. See the testTemplate # in the meta.json for details. import pandas as pd # If an asse...
2,084
581
from __future__ import annotations import weakref from typing import AnyStr, Generic from coredis.exceptions import FunctionError from coredis.typing import ( TYPE_CHECKING, Any, Dict, Iterable, KeyT, Optional, StringT, ValueT, ) from coredis.utils import EncodingInsensitiveDict, nativ...
3,677
1,049
""" Lower level of visualization framework which does three main things: - associate visualizations with objects - create urls to visualizations based on some target object(s) - unpack a query string into the desired objects needed for rendering """ import os import shutil import glob from galaxy import ut...
38,177
10,072
from .base import X11BaseRecipe class LibXxf86dgaRecipe(X11BaseRecipe): def __init__(self, *args, **kwargs): super(LibXxf86dgaRecipe, self).__init__(*args, **kwargs) self.sha256 = '8eecd4b6c1df9a3704c04733c2f4fa93' \ 'ef469b55028af5510b25818e2456c77e' self.name = 'li...
407
195
# Generated by Django 3.0.4 on 2020-04-14 11:15 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('Users', '0005_profile_money'), ] operations = [ migrations.RemoveField( model_name='profile', name='unlocked_geopins...
667
205