content
stringlengths
1
1.05M
input_ids
listlengths
1
883k
ratio_char_token
float64
1
22.9
token_count
int64
1
883k
import os import glob from astropy.io import fits #/home/student/Desktop/Images/iTelescope/20180716-California-T24-GOOD # Yo Neal. When you use this program, you have to change a few things between iTelescope and LFOP # FIRST, remember to change the file path or you'll be a dummy. Also for LFOP -13 and -12 while # for iTelescope it should be -9 and -8. Hopefully you know what to do with those numbers... #/home/student/Desktop/Images/LFOP dir = '20180726-LFOP-GOOD' path = '/home/student/Desktop/Images/LFOP/' + dir + '/' dict = {} date = "" for filename in os.listdir(path): if filename.endswith(".fit"): file = path + str(filename) image = fits.open(file) s = image[0].header.get("DATE-OBS") date = s[:len(s) - 13] dict.update({s[len(s) - 12:]: filename}) for key, value in sorted(dict.items()): print value + "\t\t" + str(key) print date print len(dict)
[ 11748, 28686, 198, 11748, 15095, 198, 6738, 6468, 28338, 13, 952, 1330, 11414, 198, 198, 2, 14, 11195, 14, 50139, 14, 36881, 14, 29398, 14, 72, 33317, 3798, 3008, 14, 1264, 36928, 1433, 12, 25284, 12, 51, 1731, 12, 11230, 3727, 198, ...
2.59322
354
from fastai.vision.all import * from PIL import Image import streamlit as st import numpy as np from io import BytesIO from .config import imgWidth, imgHeight st.title("CleanvsMessy") st.markdown(''' ## Upload the image''',True) st.set_option('deprecation.showfileUploaderEncoding', False) file = st.file_uploader(" ") model = load_learner('model/model_v0.pkl') st.markdown(''' ## Preview of the Image''',True) if file != None: st.image(file, width = imgWidth, height = imgHeight) if file != None: result = upload(file) st.write("Is Image Clean? "+result["is_image_clean"]) st.write("Confidence "+str(result["predictedVal"]))
[ 6738, 3049, 1872, 13, 10178, 13, 439, 1330, 1635, 198, 6738, 350, 4146, 1330, 7412, 198, 11748, 4269, 18250, 355, 336, 198, 11748, 299, 32152, 355, 45941, 198, 6738, 33245, 1330, 2750, 4879, 9399, 198, 6738, 764, 11250, 1330, 33705, 309...
2.853982
226
import pickle import matplotlib.pyplot as plt import pandas as pd trials = pickle.load(open("trials.p", "rb")) print("Set breakpoint here") #for item in trials.trials: # args = item["vals"] # res = item["result"]["loss"] #itemtuples = [(item["misc"]["vals"]["dilation_group"], item["misc"]["vals"]["use_ref_points"], item["result"]["loss"]) for item in trials.trials] #(dil, ref, loss) = zip(*itemtuples) #plt.figure() #plt.plot(dil, 'ro') #plt.title('Use_dilation (1 is true, 0 is false)') #plt.plot(loss) #plt.plot(pd.DataFrame(loss).ewm(span=1).mean()) #plt.title('MAE') #plt.plot(ref, 'g^') #plt.legend() #plt.show() print("Set breakpoint here") print("PRINT BEST TRIALS") myitems = [(trial["result"]["loss"], str(trial["misc"]["vals"])) for trial in trials.trials if trial["result"]["status"] == "ok"] myitems.sort(key=lambda tup: tup[0]) for item in myitems[:10]: print("--------------------------\n") print(item) print("\n\n") # If you want to print training times use attemptid["book_time"]
[ 11748, 2298, 293, 198, 11748, 2603, 29487, 8019, 13, 9078, 29487, 355, 458, 83, 198, 11748, 19798, 292, 355, 279, 67, 628, 198, 28461, 874, 796, 2298, 293, 13, 2220, 7, 9654, 7203, 28461, 874, 13, 79, 1600, 366, 26145, 48774, 198, 4...
2.5
412
import logging import logging.config import os import subprocess from datetime import datetime, timedelta from botocore.credentials import CredentialProvider, RefreshableCredentials from dateutil.tz import tzlocal from common.E3 import e3
[ 11748, 18931, 198, 11748, 18931, 13, 11250, 198, 11748, 28686, 198, 11748, 850, 14681, 198, 6738, 4818, 8079, 1330, 4818, 8079, 11, 28805, 12514, 198, 198, 6738, 10214, 420, 382, 13, 66, 445, 14817, 1330, 327, 445, 1843, 29495, 11, 2253...
3.626866
67
''' Stuff you need to update for this to work ''' 'Enter your username here' user = '' 'Enter your password here' passwd = '' image1 = '2d83af05944d49c69fa9565fb238a91b.jpg' image2 = '49b2788b672e4088a25eb0a9eff35c17.jpg' image3 = '355c2c7e87f0489bb5f0308cdec108f6.jpg' " ^ You need to change EACH of these to whatever you want the 3 pics to be (Currently set to a waving red zigzag)" ''' Stuff that will change how the program works ''' speed = 0.2 "^ As you can probably guess, this changes how long the PFP stays on each image" import time try: import requests except: print('''You do not have the requests library installed, you need to install it via the following command: pip install requests Thank you!''') try: import recnetlogin as rnl except: print('''You do not have the RecNetLogin package installed, you need to install it via the following command: python -m pip install git+https://github.com/Jegarde/RecNet-Login.git#egg=recnetlogin Thank you!''') ''' Just Initializing some values ''' login = rnl.login_to_recnet(username=user,password=passwd) x = 0 BToken = '' ''' Making the strings into the format read by the rec.net image api ''' imageName1 = 'imageName=' + image1 imageName2 = 'imageName=' + image2 imageName3 = 'imageName=' + image3 ''' Initial token request ''' BToken = login.access_token print(BToken) ''' The loop program that actually makes the picure move ''' while 1 == 1: ''' The HTTP header for changing your In-Game pfp ''' Headers = {'sec-ch-ua':'";Not A Brand";v="99", "Chromium";v="88"', 'Accept' : '*/*', 'sec-ch-ua-mobile' : '?0', 'Authorization' : BToken, 'Content-Type' : 'application/x-www-form-urlencoded; charset=UTF-8', 'Origin' : 'https://rec.net', 'Sec-Fetch-Site' : 'same-site', 'Sec-Fetch-Mode' : 'cors', 'Sec-Fetch-Dest' : 'empty', 'Referer' : 'https://rec.net/', 'Accept-Encoding' : 'gzip, deflate', 'Accept-Language' : 'en-US,en;q=0.9', } ''' The easy way to edit what pfp plays after what ''' ''' In this default format, it will show image 1 first, then image 2, then image 3, then image 2 again and will LOOP this. The x value in the function calls is to make the counter function, if you don't add it to your function calls or you delete them, THE COUNTER WILL NOT WORK. ''' x = x + 1 i1() x = x + 1 i2() x = x + 1 i3() x = x + 1 i2() ''' Requests a new auth token when that one is no longer valid ''' r = requests.put('https://accounts.rec.net/account/me/profileImage', headers = Headers) if r.status_code == 401: print('Invalid Token') login = rnl.login_to_recnet(username=user,password=passwd) BToken = login.access_token print(BToken)
[ 7061, 6, 27864, 345, 761, 284, 4296, 329, 428, 284, 670, 705, 7061, 198, 6, 17469, 534, 20579, 994, 6, 198, 7220, 796, 10148, 198, 6, 17469, 534, 9206, 994, 6, 198, 6603, 16993, 796, 10148, 628, 198, 198, 9060, 16, 796, 705, 17, ...
2.543286
1,132
#import roslib; roslib.load_manifest('rcommander_core') import graph.style as gs import graph import graph.layout as gl import tool_utils as tu import graph_model as gm import numpy as np import time import copy
[ 2, 11748, 686, 6649, 571, 26, 686, 6649, 571, 13, 2220, 62, 805, 8409, 10786, 81, 9503, 4066, 62, 7295, 11537, 198, 198, 11748, 4823, 13, 7635, 355, 308, 82, 198, 11748, 4823, 198, 11748, 4823, 13, 39786, 355, 1278, 198, 198, 11748,...
3.071429
70
# -*- coding: utf-8 -*- from django.urls import reverse from rest_framework.response import Response from rest_framework import status from ...collection import BaseAPICollector, BaseAPISpecification from ... import models from . import serializers
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 6738, 42625, 14208, 13, 6371, 82, 1330, 9575, 198, 198, 6738, 1334, 62, 30604, 13, 26209, 1330, 18261, 198, 6738, 1334, 62, 30604, 1330, 3722, 198, 198, 6738, 2644, 4368...
3.614286
70
#!/usr/bin/env python3 """ This module defines functions for depth-first-search in a graph with a given adjacency list """ def dfs_visit(node_list, adj_list, root_node, parent): """ Takes the graph node list, its adj list, and a node s, and visits all the nodes reachable from s recursively. """ for node in adj_list[root_node]: if node not in parent: parent[node] = root_node dfs_visit(node_list, adj_list, node, parent) def dfs(node_list, adj_list): """ Iterate over possible root_nodes to explore the whole graph """ parent = {} for root_node in node_list: if root_node not in parent: parent[root_node] = None dfs_visit(node_list, adj_list, root_node, parent)
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 198, 37811, 198, 1212, 8265, 15738, 5499, 329, 6795, 12, 11085, 12, 12947, 287, 257, 4823, 351, 257, 1813, 9224, 330, 1387, 1351, 198, 37811, 198, 198, 4299, 288, 9501, 62, 4703, ...
2.460064
313
# uncompyle6 version 3.2.0 # Python bytecode 2.4 (62061) # Decompiled from: Python 2.7.14 (v2.7.14:84471935ed, Sep 16 2017, 20:19:30) [MSC v.1500 32 bit (Intel)] # Embedded file name: pirates.quest.QuestHolderBase
[ 2, 34318, 2349, 21, 2196, 513, 13, 17, 13, 15, 198, 2, 11361, 18022, 8189, 362, 13, 19, 357, 38850, 5333, 8, 198, 2, 4280, 3361, 3902, 422, 25, 11361, 362, 13, 22, 13, 1415, 357, 85, 17, 13, 22, 13, 1415, 25, 23, 34825, 1129, ...
2.488372
86
from setuptools import setup, find_packages VERSION = "0.1.1" setup( name="hhsh", version=VERSION, description=" cli", long_description=" cli", keywords="python hhsh cli terminal", author="itorr,yihong0618", author_email="zouzou0208@gmail.com", url="https://github.com/yihong0618/hhsh", packages=find_packages(), include_package_data=True, zip_safe=True, install_requires=["requests", "rich"], classifiers=[ "Development Status :: 4 - Beta", "Environment :: Console", "Intended Audience :: Developers", "Operating System :: OS Independent", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Topic :: Software Development :: Libraries", ], entry_points={ "console_scripts": ["hhsh = hhsh.hhsh:main"], }, )
[ 6738, 900, 37623, 10141, 1330, 9058, 11, 1064, 62, 43789, 198, 198, 43717, 796, 366, 15, 13, 16, 13, 16, 1, 198, 198, 40406, 7, 198, 220, 220, 220, 1438, 2625, 12337, 1477, 1600, 198, 220, 220, 220, 2196, 28, 43717, 11, 198, 220, ...
2.505464
366
import datetime import hashlib import os import pathlib from typing import Optional import yaml
[ 11748, 4818, 8079, 198, 11748, 12234, 8019, 198, 11748, 28686, 198, 11748, 3108, 8019, 198, 198, 6738, 19720, 1330, 32233, 198, 198, 11748, 331, 43695, 628, 628, 198 ]
3.642857
28
from collections import Counter import pytest from datasets import load_dataset from lassl.blender import DatasetBlender
[ 6738, 17268, 1330, 15034, 198, 198, 11748, 12972, 9288, 198, 6738, 40522, 1330, 3440, 62, 19608, 292, 316, 198, 198, 6738, 300, 562, 75, 13, 2436, 2194, 1330, 16092, 292, 316, 3629, 2194, 628 ]
3.647059
34
# -*- coding: utf-8 -*- """ After the introduction of version 6.2, all wisp data and hst-3d are now on MAST 3D-HST has not added any new data nor changed their directory structure, but that's not the case for WISP Aim: parse new directories to make them compatible with v5.0 """ import os import glob from ..utils import memoize_func REMOTE_FOLDER=os.environ['WISP_SURVEY_DATA']
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 198, 37811, 198, 198, 3260, 262, 9793, 286, 2196, 718, 13, 17, 11, 477, 266, 8802, 1366, 290, 289, 301, 12, 18, 67, 389, 783, 319, 337, 11262, 198, 198, 18, 35, 12...
2.881481
135
import storage import pytest
[ 11748, 6143, 198, 11748, 12972, 9288, 628 ]
4.285714
7
# -*- coding: utf-8 -*- # Generated by Django 1.11.8 on 2017-12-06 13:50 from __future__ import unicode_literals import aldryn_redirects.validators from django.db import migrations, models import django.db.models.deletion
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 2, 2980, 515, 416, 37770, 352, 13, 1157, 13, 23, 319, 2177, 12, 1065, 12, 3312, 1511, 25, 1120, 198, 6738, 11593, 37443, 834, 1330, 28000, 1098, 62, 17201, 874, 198, ...
2.765432
81
""" .. Copyright (c) 2015 Marshall Farrier license http://opensource.org/licenses/MIT Constants ========= """ UPVEL_COL = 'Up Vel' DOWNVEL_COL = 'Down Vel'
[ 37811, 198, 492, 15069, 357, 66, 8, 1853, 13606, 6755, 5277, 198, 220, 220, 5964, 2638, 1378, 44813, 1668, 13, 2398, 14, 677, 4541, 14, 36393, 198, 198, 34184, 1187, 198, 2559, 28, 198, 37811, 198, 198, 8577, 18697, 62, 25154, 796, ...
2.824561
57
#! /usr/bin/env python3 import rospy from geometry_msgs.msg import Twist from sensor_msgs.msg import LaserScan import numpy as np import math from std_msgs.msg import String if __name__ =='__main__': rospy.init_node('parking') pub = rospy.Publisher('/cmd_vel',Twist, queue_size=10) rospy.Subscriber('/scan',LaserScan, queue_size = 1, callback = callback) rospy.Subscriber('helloworld03', String, callback=stop) rospy.spin() pass
[ 2, 0, 1220, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 198, 11748, 686, 2777, 88, 198, 6738, 22939, 62, 907, 14542, 13, 19662, 1330, 44088, 198, 6738, 12694, 62, 907, 14542, 13, 19662, 1330, 23222, 33351, 198, 11748, 299, 32152, 355,...
2.508108
185
""" Registry for tracking providers dynamically in OpenNSA. Keeping track of providers in a dynamical way in an NSI implementation is a huge pain in the ass. This is a combination of things, such as seperate identities and endpoints, callbacks, and the combination of local providers. The class ProviderRegistry tries to keep it a bit sane. """ from twisted.python import log from opennsa import error LOG_SYSTEM = 'providerregistry'
[ 37811, 198, 8081, 4592, 329, 9646, 9549, 32366, 287, 4946, 47549, 13, 198, 198, 44815, 2610, 286, 9549, 287, 257, 6382, 605, 835, 287, 281, 10896, 40, 7822, 318, 257, 198, 40878, 2356, 287, 262, 840, 13, 770, 318, 257, 6087, 286, 12...
3.902655
113
from test_utils import TempDirectoryContext from shedclient import task_tracker
[ 6738, 1332, 62, 26791, 1330, 24189, 43055, 21947, 198, 198, 6738, 14999, 16366, 1330, 4876, 62, 2213, 10735, 628 ]
4.315789
19
# -*- coding: utf-8 -*- # Resource object code # # Created by: The Resource Compiler for PyQt5 (Qt v5.13.0) # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore qt_resource_data = b"\ \x00\x00\x04\x1a\ \x00\ \x01\x08\x3e\x78\x9c\xed\x9c\x4d\x6e\xd3\x50\x14\x85\x1d\x65\x10\ \x66\x61\xc4\x2c\x75\x87\xdd\x85\x59\x4a\x77\x92\xcc\xd2\x59\x97\ \xc2\x12\x40\x62\x01\x2c\xa1\x48\xb4\x62\x58\x86\x0c\x10\xc1\x76\ \x52\xc7\x3e\x21\x8e\xe3\xdf\x77\xdf\xfb\xbe\xea\x22\x1d\x17\x61\ \xc7\xe7\xbe\x73\x18\x54\x8d\xa2\x59\xfa\xb5\xd9\x44\xe9\x9f\xb7\ \xd1\xdd\xbb\x59\xf4\x21\x8a\xa2\xbb\x74\xd2\x4b\xd9\xc5\xfc\x7a\ \x4e\xfa\x3d\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x08\x97\x97\xed\x6a\xf3\xfc\xb0\x7a\x7a\xde\xae\xee\x9f\ \x1e\xe3\xf7\x53\x3f\x0f\x8c\x4b\xe6\xff\xcb\xc3\xcd\x2e\x9f\xed\ \xea\xf5\x79\x7b\xf3\xf8\x73\x1b\xdf\x4e\xfd\x5c\x30\x0e\x15\xff\ \x4b\x93\xee\xc1\xa7\x1f\xdb\xf8\xe3\xd4\xcf\x07\xc3\x72\xce\xff\ \x62\x0f\xe8\x06\xaf\xb9\xe4\x3f\xdd\xe0\x37\x8d\xfd\xa7\x1b\xbc\ \xa4\x8d\xff\x74\x83\x3f\x74\xf1\x9f\x6e\xb0\x4f\x2f\xfe\xd3\x0d\ \x66\xe9\xdb\x7f\xba\xc1\x16\x43\xf9\x4f\x37\xd8\x60\x70\xff\xe9\ \x06\xa7\x19\xd3\x7f\xba\xc1\x3d\xa6\xf0\x9f\x6e\x70\x87\x49\xfd\ \xa7\x1b\x26\xc7\x15\xff\xe9\x86\x69\x70\xcd\x7f\xba\x61\x5c\x9c\ \xf5\x9f\x6e\x18\x05\x0b\xfe\xd3\x0d\xc3\x61\xc9\x7f\xba\xa1\x7f\ \x4c\xfa\x5f\xce\x04\xba\xa1\x13\xd6\xfd\x2f\xf6\x80\x6e\x68\x85\ \x2f\xfe\x17\x43\x37\x5c\x85\x77\xfe\x97\x33\x81\x6e\xb8\x88\xcf\ \xfe\x17\x7b\x40\x37\x9c\x25\x04\xff\x8b\xa1\x1b\x4e\x08\xca\xff\ \x72\x26\xd0\x0d\x39\xa1\xfa\x5f\xec\x41\xe0\xdd\x10\xba\xff\xc5\ \x04\xda\x0d\xf8\x7f\x3a\x21\x75\x03\xfe\xd7\xec\x41\x00\xdd\x80\ \xff\x0d\xc6\xe3\x6e\xc0\xff\xeb\xc6\xb7\x6e\xc0\xff\x96\x7b\xe0\ \x49\x37\xe0\x7f\xc7\x31\xde\x0d\xf8\xdf\xdf\x58\xec\x06\xfc\x1f\ \x60\x0f\x0c\x75\x43\xb6\xaf\x59\x7e\xbd\x3c\xac\x3e\xa7\xbb\xf0\ \x6d\xea\x77\xe7\xd5\x18\xed\x86\xec\x79\xf7\x7b\xb1\xba\xcf\x7f\ \x3f\x58\x9a\x6b\x87\xfd\x78\x9d\xfc\x9d\x1a\x1d\x8b\xdd\x70\x8e\ \xec\x73\x64\x73\xd8\x0d\xb2\xe3\x9a\x3d\x30\xd4\x0d\x6d\x20\x3b\ \x1a\x8e\xd1\x6e\xe8\x0a\xd9\x71\x3a\x3e\x75\x43\x17\x42\xcf\x0e\ \xdf\xbb\xa1\x2b\xc1\x64\x47\xa0\xdd\xd0\x05\x5f\xb3\x83\x6e\xe8\ \x07\xeb\xd9\x41\x37\x0c\x87\xa9\xec\xa0\x1b\x46\xc7\xd5\xec\xa0\ \x1b\xc6\x01\xff\xfd\x86\xfc\xf7\x1f\x57\xcf\x70\xe3\xb3\xce\xff\ \xff\x6a\x31\x75\x86\xc9\xf8\x56\x58\x3f\xc3\x8d\x27\xd0\x8c\xf7\ \xf5\x0c\x37\x3e\xeb\x01\x64\x7c\x30\x67\xf8\x1a\xdf\x3d\xca\xf8\ \xd0\xcf\x70\xe3\x31\x9c\xf1\x9c\xe1\xf6\x63\x21\xe3\x39\xc3\x03\ \xf8\xee\x68\xc6\xf3\xf3\x9f\x03\x8e\x81\x8c\xe7\xe7\xbf\xfb\x1f\ \x0b\x19\xff\x06\xfe\xf7\xe8\xbb\xa3\x19\x5f\x07\xfe\x77\x1c\x03\ \x19\x5f\x07\xfe\xb7\x1b\x4b\x19\x5f\x07\xfe\x5f\xe9\xbb\xc1\x8c\ \xaf\x03\xff\x1b\x8c\xf1\x8c\xaf\x03\xff\xcf\x8f\x2f\x19\x5f\x07\ \xfe\xff\xc7\x77\xcf\x32\xbe\x0e\xfc\x3f\x8c\xc7\x19\x5f\x47\xe8\ \xfe\x87\x90\xf1\x75\x84\xea\x7f\x48\x19\x5f\x47\x50\xfe\x07\x9a\ \xf1\x75\x84\xe0\x7f\xe8\x19\x5f\x87\xcf\xfe\x93\xf1\x97\xf1\xce\ \x7f\x32\xfe\x2a\x7c\xf1\x9f\x8c\x6f\x87\x75\xff\xc9\xf8\x6e\x98\ \xf4\x9f\x8c\xef\x0d\x4b\xfe\x93\xf1\xfd\x63\xc1\x7f\x32\x7e\x38\ \x9c\xf5\x9f\x8c\x1f\x05\xd7\xfc\x27\xe3\xc7\xc5\x15\xff\xc9\xf8\ \x69\x98\xd4\x7f\x32\x7e\x72\xa6\xf0\x9f\x8c\x77\x87\x31\xfd\x27\ \xe3\xdd\x63\x70\xff\xc9\x78\xa7\x19\xca\x7f\x32\xde\x06\x7d\xfb\ \x4f\xc6\xdb\xa2\x17\xff\xc9\x78\xb3\x74\xf1\x9f\x8c\xb7\x4f\x1b\ \xff\xc9\x78\x7f\x68\xec\x3f\x19\xef\x25\x97\xfc\x27\xe3\xfd\xe6\ \x9c\xff\x64\x7c\x18\x54\xfc\x27\xe3\x83\x23\xff\xfd\x5e\x64\x3c\ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\ \x73\xec\x42\xe7\xab\xe8\x2f\xaa\x13\xd1\x0b\xd1\x33\xd1\xd1\x5a\ \xf4\x52\xf4\x5c\x74\xa4\x3a\x16\xbd\x10\x3d\x13\x1d\x25\xa2\x97\ \xa2\xe7\xa2\xcb\x8f\x98\xeb\x58\xf4\x42\x74\xa4\x3a\x11\xbd\x14\ \x3d\x13\x7d\xbc\xe3\x41\xc7\xa2\xe7\xa2\x23\xd5\x89\xe8\x85\xe8\ \x99\xe8\xb7\x3b\x16\x7a\x29\x7a\x2e\x3a\x52\x1d\x8b\x5e\x88\x9e\ \x89\xde\x3f\x62\x49\xe7\x77\xfc\x7b\xd4\xfb\x3b\x96\x2e\xec\x1f\ \xf1\x8f\xdc\xf1\x78\xe1\xed\x33\xfe\xae\x3e\xe2\xf1\x42\x61\xc3\ \xaf\xca\x67\x2c\x2e\x94\x36\xe5\x7b\xf9\xa5\x14\x17\xe2\xb3\x5a\ \xfe\xbe\xfc\x7b\x72\x3f\x79\x1e\x79\x5e\xf9\x3c\xf2\x79\xe5\x7d\ \xe8\xfb\xd2\xf7\x59\xd2\xf2\xbe\xd5\x0f\xf5\x2b\x16\xbd\xab\x6a\ \xdd\x07\xdd\x97\x75\x55\xeb\xbe\xe9\x3e\x26\xa2\x77\x55\xad\xfb\ \x1e\x8b\x5e\x57\xb5\x9e\x27\x3d\x6f\x89\xe8\x5d\x55\xeb\x79\x8e\ \x45\xaf\xab\x5a\xf3\x42\xf3\x24\xa9\x6a\xcd\x23\xcd\xab\x58\xf4\ \xae\xaa\x35\x0f\x35\x2f\xd7\x55\xad\x79\xab\x79\x9c\x88\xae\xca\ \x93\xbc\x0f\x9c\x7f\x31\x73\xbc\x32\ " qt_resource_name = b"\ \x00\x09\ \x0c\x78\x54\x88\ \x00\x6e\ \x00\x65\x00\x77\x00\x50\x00\x72\x00\x65\x00\x66\x00\x69\x00\x78\ \x00\x0a\ \x0a\xc8\x83\x1f\ \x00\x67\ \x00\x6f\x00\x6e\x00\x64\x00\x65\x00\x72\x00\x2e\x00\x69\x00\x63\x00\x6f\ " qt_resource_struct_v1 = b"\ \x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x01\ \x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x02\ \x00\x00\x00\x18\x00\x01\x00\x00\x00\x01\x00\x00\x00\x00\ " qt_resource_struct_v2 = b"\ \x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x01\ \x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x02\ \x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00\x18\x00\x01\x00\x00\x00\x01\x00\x00\x00\x00\ \x00\x00\x01\x6e\xda\x88\xff\x59\ " qt_version = [int(v) for v in QtCore.qVersion().split('.')] if qt_version < [5, 8, 0]: rcc_version = 1 qt_resource_struct = qt_resource_struct_v1 else: rcc_version = 2 qt_resource_struct = qt_resource_struct_v2 qInitResources()
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 198, 2, 20857, 2134, 2438, 198, 2, 198, 2, 15622, 416, 25, 383, 20857, 3082, 5329, 329, 9485, 48, 83, 20, 357, 48, 83, 410, 20, 13, 1485, 13, 15, 8, 198, 2, 198,...
1.30049
4,283
n = int(input()) # names = {input() for _ in range(n)} names = [] for _ in range(n): names.append(input()) unique_names = list(set(names)) [print(name) for name in sorted(unique_names, key=names.index)]
[ 77, 796, 493, 7, 15414, 28955, 198, 198, 2, 3891, 796, 1391, 15414, 3419, 329, 4808, 287, 2837, 7, 77, 38165, 198, 14933, 796, 17635, 198, 1640, 4808, 287, 2837, 7, 77, 2599, 198, 220, 220, 220, 3891, 13, 33295, 7, 15414, 28955, 1...
2.6625
80
from optparse import OptionParser
[ 6738, 2172, 29572, 1330, 16018, 46677, 628 ]
5
7
# Generated by Django 3.0.6 on 2020-05-22 04:46 from django.db import migrations, models
[ 2, 2980, 515, 416, 37770, 513, 13, 15, 13, 21, 319, 12131, 12, 2713, 12, 1828, 8702, 25, 3510, 198, 198, 6738, 42625, 14208, 13, 9945, 1330, 15720, 602, 11, 4981, 628 ]
2.84375
32
from django.db import models
[ 6738, 42625, 14208, 13, 9945, 1330, 4981, 198 ]
3.625
8
import logging import pytest from loguru import logger
[ 11748, 18931, 198, 198, 11748, 12972, 9288, 198, 6738, 2604, 14717, 1330, 49706, 628 ]
4.071429
14
# Create a plotter without any lights and then enable the # default light kit. # import pyvista pl = pyvista.Plotter(lighting=None) pl.enable_lightkit() actor = pl.add_mesh(pyvista.Cube(), show_edges=True) pl.show()
[ 2, 13610, 257, 7110, 353, 1231, 597, 7588, 290, 788, 7139, 262, 198, 2, 4277, 1657, 6220, 13, 198, 2, 198, 11748, 12972, 85, 12523, 198, 489, 796, 12972, 85, 12523, 13, 43328, 353, 7, 43351, 28, 14202, 8, 198, 489, 13, 21633, 62, ...
2.842105
76
# -*- coding: utf-8 -*- """ sphinx.environment.managers ~~~~~~~~~~~~~~~~~~~~~~~~~~~ Manager components for sphinx.environment. :copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ if False: # For type annotation from typing import Any # NOQA from docutils import nodes # NOQA from sphinx.environment import BuildEnvironment # NOQA
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 37811, 198, 220, 220, 220, 599, 20079, 87, 13, 38986, 13, 805, 10321, 198, 220, 220, 220, 220, 27156, 15116, 4907, 93, 628, 220, 220, 220, 9142, 6805, 329, 599, 20079,...
2.905405
148
import getopt import sys import os import re import string import xml.etree.ElementTree as ET input_filename = "" expansion_filename = "" output_type = "combine" exclude = set(string.punctuation) options, remainder = getopt.getopt(sys.argv[1:], 'i:e:t:', ['inputfile=', 'expansionfile=', 'type=']) for opt, arg in options: if opt in ('-i', '--inputfile'): input_filename = arg if (not os.path.exists(input_filename)): sys.exit("Error: Inputfile does not exists") if opt in ('-e', '--expansionfile'): expansion_filename = arg if (not os.path.exists(expansion_filename)): sys.exit("Error: Expansion file does not exists") if opt in ('-t', '--type'): output_type = arg expansion_terms = [] if (expansion_filename != ""): with open(expansion_filename) as expandfile: expansion_terms = expandfile.readlines() xml_root = ET.parse(input_filename) print("<parameters>") order = 0 for topic in xml_root.findall('.//topic'): num = topic.find('num').text query = topic.find('query').text description = topic.find('description').text query = query.replace('-', ' ') query = query.replace('\n', ' ') description = description.replace('-', ' ') description = description.replace('\n', ' ') query = query.translate(str.maketrans('', '', string.punctuation)) description = description.translate(str.maketrans('', '', string.punctuation)) print("<query>") print("<number>" + str(num) + "</number>") expansion = "" if ( expansion_filename != ""): line_expansion_term = expansion_terms[order] line_expansion_term = line_expansion_term.replace("[", "") line_expansion_term = line_expansion_term.replace("]", "") line_expansion_term = line_expansion_term.replace('"', "") line_expansion_term = line_expansion_term.replace('\n',"") line_expansion_terms = line_expansion_term.split(',') expansion = " " max_expansion_terms = 10 for i in range (min(max_expansion_terms, len(line_expansion_terms))): if (':' in line_expansion_terms[i]): term,score = line_expansion_terms[i].split(':') score = score.replace("\n", "") if (output_type == "weights"): expansion = expansion + str(score) + " #combine(" + term + ") " else: expansion = expansion + term expansion = expansion + " " if (output_type == "combine"): print("<text>#combine(" + query + " " + expansion + description + ")</text>") if (output_type == "weights"): print("<text>#weight( 1.0 #combine(" + query + ") " + expansion + " 0.5 #combine(" + description + "))</text>") if (output_type == "terms"): print("<text>" + query + " " + expansion + description + "</text>") if (output_type == "sdm"): query_sdm = get_sdm_query(query) description_sdm = get_sdm_query(description) print("<text>#weight(" + query_sdm + " " + description_sdm + ")</text>") print("</query>") order += 1 print("</parameters>")
[ 11748, 651, 8738, 198, 11748, 25064, 198, 11748, 28686, 198, 11748, 302, 198, 11748, 4731, 198, 11748, 35555, 13, 316, 631, 13, 20180, 27660, 355, 12152, 198, 198, 15414, 62, 34345, 796, 13538, 198, 11201, 5487, 62, 34345, 796, 13538, 1...
2.416794
1,310
import cartopy.crs as ccrs import cartopy.feature as cf from matplotlib import pyplot as plt from matplotlib import image as img
[ 11748, 6383, 11081, 13, 66, 3808, 355, 36624, 3808, 198, 11748, 6383, 11081, 13, 30053, 355, 30218, 198, 6738, 2603, 29487, 8019, 1330, 12972, 29487, 355, 458, 83, 198, 6738, 2603, 29487, 8019, 1330, 2939, 355, 33705 ]
3.459459
37
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os import subprocess import unittest import filecmp import gdal import otbApplication as otb from abc import ABC from decloud.core.system import get_env_var, pathify, basename
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 11748, 28686, 198, 11748, 850, 14681, 198, 11748, 555, 715, 395, 198, 11748, 2393, 48991, 198, 11748, 308, 31748, 1...
2.961538
78
from sclblonnx import add_output, add_input, add_node, node, empty_graph, add_constant, display, merge, run import numpy as np
[ 6738, 264, 565, 2436, 261, 77, 87, 1330, 751, 62, 22915, 11, 751, 62, 15414, 11, 751, 62, 17440, 11, 10139, 11, 6565, 62, 34960, 11, 751, 62, 9979, 415, 11, 3359, 11, 20121, 11, 1057, 198, 11748, 299, 32152, 355, 45941, 628, 628, ...
2.911111
45
import glob import cv2 import numpy as np
[ 11748, 15095, 198, 198, 11748, 269, 85, 17, 198, 11748, 299, 32152, 355, 45941, 628 ]
2.933333
15
description = 'Instrument shutter' prefix = "IOC" devices = dict( beam_monitor_1=device( 'nicos_ess.devices.epics.motor.EpicsMotor', description="Beam monitor continuous position feedback", motorpv=f'{prefix}:m8', abslimits=(-10, 10), unit='mm', speed=5., ), beam_monitor_switch=device( 'nicos.devices.generic.Switcher', description="Toggles between in and out of the beam", moveable="beam_monitor_1", mapping={ 'IN': 0, 'OUT': 5, }, precision=0.01, ) )
[ 11213, 796, 705, 818, 43872, 31168, 6, 198, 40290, 796, 366, 40, 4503, 1, 198, 198, 42034, 796, 8633, 7, 198, 220, 220, 220, 15584, 62, 41143, 62, 16, 28, 25202, 7, 198, 220, 220, 220, 220, 220, 220, 220, 705, 6988, 418, 62, 408...
2.088339
283
# -*- coding: utf-8 -*- # BioSTEAM: The Biorefinery Simulation and Techno-Economic Analysis Modules # Copyright (C) 2020, Yoel Cortes-Pena <yoelcortes@gmail.com> # # This module is under the UIUC open-source license. See # github.com/BioSTEAMDevelopmentGroup/biosteam/blob/master/LICENSE.txt # for license details. """ """ import flexsolve as flx from .digraph import (digraph_from_units_and_streams, minimal_digraph, surface_digraph, finalize_digraph) from thermosteam import Stream from thermosteam.utils import registered from .exceptions import try_method_with_object_stamp from ._network import Network from ._facility import Facility from ._unit import Unit from .report import save_report from .exceptions import InfeasibleRegion from .utils import colors, strtuple import biosteam as bst __all__ = ('System',) # %% Functions for taking care of numerical specifications within a system path # %% Debugging and exception handling def _evaluate(self, command=None): """ Evaluate a command and request user input for next command. If no command, return. This function is used for debugging a System object. """ # Done evaluating if no command, exit debugger if 'exit' if command is None: Next = colors.next('Next: ') + f'{repr(self)}\n' info = colors.info("Enter to continue or type to evaluate:\n") command = input(Next + info + ">>> ") if command == 'exit': raise KeyboardInterrupt() if command: # Build locals dictionary for evaluating command F = bst.main_flowsheet lcs = {self.ID: self, 'bst': bst, **F.system.__dict__, **F.stream.__dict__, **F.unit.__dict__, **F.flowsheet.__dict__ } try: out = eval(command, {}, lcs) except Exception as err: # Print exception and ask to raise error or continue evaluating err = colors.exception(f'{type(err).__name__}:') + f' {str(err)}\n\n' info = colors.info(f"Enter to raise error or type to evaluate:\n") command = input(err + info + ">>> ") if command == '': raise err _evaluate(self, command) else: # If successful, continue evaluating if out is None: pass elif (not hasattr(out, '_ipython_display_') or isinstance(out, type)): print(out) else: out._ipython_display_() command = input(">>> ") _evaluate(self, command) def _method_debug(self, func): """Method decorator for debugging system.""" wrapper.__name__ = func.__name__ wrapper.__doc__ = func.__doc__ wrapper._original = func return wrapper def _notify_run_wrapper(self, func): """Decorate a System run method to notify you after each loop""" wrapper.__name__ = func.__name__ wrapper.__doc__ = func.__doc__ wrapper._original = func return wrapper # %% Process flow from biosteam import _flowsheet as flowsheet_module
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 2, 16024, 30516, 2390, 25, 383, 8436, 382, 69, 15451, 41798, 290, 5429, 78, 12, 48307, 14691, 3401, 5028, 198, 2, 15069, 357, 34, 8, 12131, 11, 25455, 417, 18418, 274,...
2.422222
1,305
import cv2 import numpy as np image = cv2.imread('original.png') gray = cv2.cvtColor(image.copy(), cv2.COLOR_BGR2GRAY) gray = cv2.equalizeHist(gray) blur = cv2.GaussianBlur(gray, (19, 19), 0) # Application d'un seuil pour obtenir une image binaire thresh = cv2.adaptiveThreshold(blur, 255, cv2.ADAPTIVE_THRESH_GAUSSIAN_C, cv2.THRESH_BINARY_INV, 11, 1) kernel = np.ones((3, 3), np.uint8) # Application d'rosion et d'ouverture pour supprimer les contours de petites pices closing = cv2.morphologyEx(thresh, cv2.MORPH_CLOSE, kernel, iterations=1) contours, hierarchy = cv2.findContours(closing.copy(), cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE) for contour in contours: area = cv2.contourArea(contour) if area < 10000 or area > 50000: continue print(area) if len(contour) < 5: continue try: ellipse = cv2.fitEllipse(contour) cv2.ellipse(image, ellipse, (0,255,0), 2) except: pass # ecriture de l'image cv2.imwrite('result.png', image)
[ 11748, 269, 85, 17, 198, 11748, 299, 32152, 355, 45941, 198, 198, 9060, 796, 269, 85, 17, 13, 320, 961, 10786, 14986, 13, 11134, 11537, 198, 198, 44605, 796, 269, 85, 17, 13, 33967, 83, 10258, 7, 9060, 13, 30073, 22784, 269, 85, 1...
2.189956
458
################################################################################ # Copyright 2019 Noblis, Inc # # # # Licensed under the Apache License, Version 2.0 (the "License"); # # you may not use this file except in compliance with the License. # # You may obtain a copy of the License at # # # # http://www.apache.org/licenses/LICENSE-2.0 # # # # Unless required by applicable law or agreed to in writing, software # # distributed under the License is distributed on an "AS IS" BASIS, # # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # # See the License for the specific language governing permissions and # # limitations under the License. # ################################################################################ import json import os import unittest from stat import S_IRUSR from tempfile import mkstemp from unittest import TestCase from ties.cli.ties_convert import main from ties.util.testing import cli_test short_usage = """\ usage: ties-convert [-h] [--classification-level SECURITY_TAG] [--output-file OUTPUT_FILE | --in-place] [--version] EXPORT_PATH""" long_usage = """\ {} Converts TIES export.json files from older versions of the schema (0.1.8, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8) to the current version (0.9). positional arguments: EXPORT_PATH the path to the TIES JSON file or - to read from stdin optional arguments: -h, --help show this help message and exit --classification-level SECURITY_TAG, -c SECURITY_TAG the classification level of the TIES JSON, required for TIES JSON from pre-0.3 versions of the schema --output-file OUTPUT_FILE, -f OUTPUT_FILE the output file path for the converted TIES JSON --in-place, -i modifies the input file in-place, overwriting it with the converted JSON data --version prints version information """.format(short_usage) test_input = """\ { "version": "0.1.8", "objectItem": [ { "sha256Hash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "md5Hash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ] }""" test_output = """\ { "version": "0.9", "securityTag": "UNCLASSIFIED", "objectItems": [ { "objectId": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sha256Hash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "md5Hash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "authorityInformation": { "securityTag": "UNCLASSIFIED" } } ] }""" if __name__ == '__main__': unittest.main()
[ 29113, 29113, 14468, 198, 2, 15069, 13130, 8140, 27999, 11, 3457, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220,...
2.190934
1,456
from PIL import Image, ImageFilter import numpy as np import glob from numpy import array import matplotlib.pyplot as plt from skimage import morphology import scipy.ndimage """ datapath = "jpg_images/" img0 = Image.open("jpg_images/maskedimage" + str(0) + ".jpg") counter = 0 img1 = [] for f in glob.glob('/Users/paulmccabe/Desktop/jpg images/*.jpg'): path = "jpg_images/maskedimage" + str(counter) + ".jpg" img0 = Image.open(path).convert('L') img1.append(array(img0)) counter += 1 print("Counter: " + str(counter)) imgs_to_process_orig = np.stack([s for s in img1]) """ id = 2 imgs = np.load("/Users/paulmccabe/Desktop/Segmentation Project/" + "justmask_%d.npy" % (id)) counter = 0 print("Saving as jpg Images...") for img in imgs: scipy.misc.imsave('/Users/paulmccabe/Desktop/Segmentation Project' + '/jpg mask images/justmask{}.jpg'.format(counter), img) counter += 1 counter = 0 #print("Re-Importing jpg Images...") #for f in glob.glob('/Users/paulmccabe/Desktop/Segmentation Project/jpg mask images/*.jpg'): # path = "jpg_images/maskedimage" + str(counter) + ".jpg" # img0 = Image.open(path).convert('L') # img1.append(array(img0)) # counter += 1 imgs[imgs == 1] = 255 list = [] for img in imgs: PIL_img = Image.fromarray(img.astype('uint8')) PIL_edge = PIL_img.filter(ImageFilter.FIND_EDGES) np_img = array(PIL_edge) dilation = morphology.dilation(np_img, np.ones([4,4])) list.append(dilation) imgs_after_processing = np.stack([s for s in list]) np.save("/Users/paulmccabe/Desktop/Segmentation Project" + "/justedge_%d.npy" % (id), imgs_after_processing[:284]) #sample_stack(np_img)
[ 6738, 350, 4146, 1330, 7412, 11, 7412, 22417, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 15095, 198, 6738, 299, 32152, 1330, 7177, 198, 11748, 2603, 29487, 8019, 13, 9078, 29487, 355, 458, 83, 198, 6738, 1341, 9060, 1330, 46320, 19...
2.538462
650
import json import numpy as np import tensorflow as tf import time from predict import Predictor if __name__ == "__main__": checkpoint = "logs/semantic_backup_full_submit_dec_10/best_model_epoch_275.ckpt" hyper_params = json.loads(open("semantic.json").read()) predictor = Predictor( checkpoint_path=checkpoint, num_classes=9, hyper_params=hyper_params ) batch_size = 64 # Init data points_with_colors = np.random.randn(batch_size, hyper_params["num_point"], 6) # Warm up pd_labels = predictor.predict(points_with_colors) # Benchmark s = time.time() profiler = tf.profiler.Profiler(predictor.sess.graph) run_options = tf.RunOptions(trace_level=tf.RunOptions.FULL_TRACE) run_metadata = tf.RunMetadata() _ = predictor.predict( points_with_colors, run_options=run_options, run_metadata=run_metadata ) profiler.add_step(0, run_metadata) batch_time = time.time() - s sample_time = batch_time / batch_size print( "Batch size: {}, batch_time: {}, sample_time: {}".format( batch_size, batch_time, sample_time ) ) option_builder = tf.profiler.ProfileOptionBuilder opts = ( option_builder(option_builder.time_and_memory()) .with_step(-1) # with -1, should compute the average of all registered steps. .with_file_output("tf-profile.txt") .select(["micros", "bytes", "occurrence"]) .order_by("micros") .build() ) # Profiling info about ops are saved in 'test-%s.txt' % FLAGS.out profiler.profile_operations(options=opts) for batch_size in [2 ** n for n in range(8)]: # Init data points_with_colors = np.random.randn(batch_size, hyper_params["num_point"], 6) # Warm up pd_labels = predictor.predict(points_with_colors) # Benchmark s = time.time() _ = predictor.predict(points_with_colors) batch_time = time.time() - s sample_time = batch_time / batch_size print( "Batch size: {}, batch_time: {}, sample_time: {}".format( batch_size, batch_time, sample_time ) )
[ 11748, 33918, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 11192, 273, 11125, 355, 48700, 198, 11748, 640, 198, 198, 6738, 4331, 1330, 49461, 273, 628, 198, 361, 11593, 3672, 834, 6624, 366, 834, 12417, 834, 1298, 198, 220, 220, 220,...
2.335821
938
from pymyorm.database import Database from config import db from models.user import User if __name__ == '__main__': Database.connect(**db) # # case 1 # all = User.find().select('count(*) as count', 'money').group('money').order('count asc').all() # for one in all: # print(one) all = User.find().select('gender', 'count(*) as count', 'avg(money) as avg').group('gender').all() for one in all: print(one)
[ 6738, 12972, 1820, 579, 13, 48806, 1330, 24047, 198, 6738, 4566, 1330, 20613, 198, 6738, 4981, 13, 7220, 1330, 11787, 198, 198, 361, 11593, 3672, 834, 6624, 705, 834, 12417, 834, 10354, 198, 220, 220, 220, 24047, 13, 8443, 7, 1174, 99...
2.709091
165
import os import json import logging from framework._utils import FunctionHook
[ 11748, 28686, 198, 11748, 33918, 198, 11748, 18931, 198, 198, 6738, 9355, 13557, 26791, 1330, 15553, 39, 566, 628 ]
4.263158
19
print(int(2.0)) print(float(2)) print(abs(-2.0)) print(abs(-2))
[ 4798, 7, 600, 7, 17, 13, 15, 4008, 198, 4798, 7, 22468, 7, 17, 4008, 198, 4798, 7, 8937, 32590, 17, 13, 15, 4008, 198, 4798, 7, 8937, 32590, 17, 4008, 198 ]
2
32
# import materia as mtr # import numpy as np # def test_point_group_C1(): # ctable = mtr.symmetry.C1().cayley_table() # assert (ctable == np.array([[0]])).all() # def test_point_group_Ci(): # ctable = mtr.symmetry.Ci().cayley_table() # assert (ctable == np.array([[0, 1], [1, 0]])).all()
[ 2, 1330, 26910, 544, 355, 285, 2213, 198, 2, 1330, 299, 32152, 355, 45941, 628, 198, 2, 825, 1332, 62, 4122, 62, 8094, 62, 34, 16, 33529, 198, 2, 220, 220, 220, 220, 269, 11487, 796, 285, 2213, 13, 1837, 3020, 11973, 13, 34, 16,...
2.183099
142
from unittest.mock import patch, MagicMock from unittest import TestCase from ..crawler.pipeliner import pipeline from ..settings import URL_PROCESSO
[ 6738, 555, 715, 395, 13, 76, 735, 1330, 8529, 11, 6139, 44, 735, 198, 6738, 555, 715, 395, 1330, 6208, 20448, 198, 6738, 11485, 66, 39464, 13, 79, 40634, 7274, 1330, 11523, 198, 6738, 11485, 33692, 1330, 10289, 62, 4805, 4503, 7597, ...
3.431818
44
from pathlib import Path import pytest from copy import deepcopy import os from mc.base import BaseConfig from mc import step
[ 6738, 3108, 8019, 1330, 10644, 198, 11748, 12972, 9288, 198, 6738, 4866, 1330, 2769, 30073, 198, 11748, 28686, 198, 198, 6738, 36650, 13, 8692, 1330, 7308, 16934, 198, 6738, 36650, 1330, 2239, 628, 628, 628, 628, 198 ]
3.648649
37
#!/usr/bin/python import system import db import client import server import logging import json import base64 import os from aws_xray_sdk.core import patch_all if "AWS_REGION" in os.environ: patch_all() _singleton = None FORMAT = "%(asctime)-15s %(message)s" logging.basicConfig(format=FORMAT)
[ 2, 48443, 14629, 14, 8800, 14, 29412, 198, 198, 11748, 1080, 198, 11748, 20613, 198, 11748, 5456, 198, 11748, 4382, 198, 11748, 18931, 198, 11748, 33918, 198, 11748, 2779, 2414, 198, 11748, 28686, 198, 198, 6738, 3253, 82, 62, 87, 2433,...
2.629032
124
try: import cStringIO as StringIO except ImportError: import StringIO import datetime import os import sys import unittest _src = os.path.join(os.path.dirname(__file__),"..", "src") if not _src in sys.path: sys.path.append(_src) import utils if __name__ == "__main__": unittest.main()
[ 198, 28311, 25, 198, 220, 220, 220, 1330, 269, 10100, 9399, 355, 10903, 9399, 198, 16341, 17267, 12331, 25, 198, 220, 220, 220, 1330, 10903, 9399, 198, 198, 11748, 4818, 8079, 198, 11748, 28686, 198, 11748, 25064, 198, 11748, 555, 715, ...
2.480315
127
import os import argparse from midv500.utils import download, unzip midv500_links = [ "ftp://smartengines.com/midv-500/dataset/01_alb_id.zip", "ftp://smartengines.com/midv-500/dataset/02_aut_drvlic_new.zip", "ftp://smartengines.com/midv-500/dataset/03_aut_id_old.zip", "ftp://smartengines.com/midv-500/dataset/04_aut_id.zip", "ftp://smartengines.com/midv-500/dataset/05_aze_passport.zip", "ftp://smartengines.com/midv-500/dataset/06_bra_passport.zip", "ftp://smartengines.com/midv-500/dataset/07_chl_id.zip", "ftp://smartengines.com/midv-500/dataset/08_chn_homereturn.zip", "ftp://smartengines.com/midv-500/dataset/09_chn_id.zip", "ftp://smartengines.com/midv-500/dataset/10_cze_id.zip", "ftp://smartengines.com/midv-500/dataset/11_cze_passport.zip", "ftp://smartengines.com/midv-500/dataset/12_deu_drvlic_new.zip", "ftp://smartengines.com/midv-500/dataset/13_deu_drvlic_old.zip", "ftp://smartengines.com/midv-500/dataset/14_deu_id_new.zip", "ftp://smartengines.com/midv-500/dataset/15_deu_id_old.zip", "ftp://smartengines.com/midv-500/dataset/16_deu_passport_new.zip", "ftp://smartengines.com/midv-500/dataset/17_deu_passport_old.zip", "ftp://smartengines.com/midv-500/dataset/18_dza_passport.zip", "ftp://smartengines.com/midv-500/dataset/19_esp_drvlic.zip", "ftp://smartengines.com/midv-500/dataset/20_esp_id_new.zip", "ftp://smartengines.com/midv-500/dataset/21_esp_id_old.zip", "ftp://smartengines.com/midv-500/dataset/22_est_id.zip", "ftp://smartengines.com/midv-500/dataset/23_fin_drvlic.zip", "ftp://smartengines.com/midv-500/dataset/24_fin_id.zip", "ftp://smartengines.com/midv-500/dataset/25_grc_passport.zip", "ftp://smartengines.com/midv-500/dataset/26_hrv_drvlic.zip", "ftp://smartengines.com/midv-500/dataset/27_hrv_passport.zip", "ftp://smartengines.com/midv-500/dataset/28_hun_passport.zip", "ftp://smartengines.com/midv-500/dataset/29_irn_drvlic.zip", "ftp://smartengines.com/midv-500/dataset/30_ita_drvlic.zip", "ftp://smartengines.com/midv-500/dataset/31_jpn_drvlic.zip", "ftp://smartengines.com/midv-500/dataset/32_lva_passport.zip", "ftp://smartengines.com/midv-500/dataset/33_mac_id.zip", "ftp://smartengines.com/midv-500/dataset/34_mda_passport.zip", "ftp://smartengines.com/midv-500/dataset/35_nor_drvlic.zip", "ftp://smartengines.com/midv-500/dataset/36_pol_drvlic.zip", "ftp://smartengines.com/midv-500/dataset/37_prt_id.zip", "ftp://smartengines.com/midv-500/dataset/38_rou_drvlic.zip", "ftp://smartengines.com/midv-500/dataset/39_rus_internalpassport.zip", "ftp://smartengines.com/midv-500/dataset/40_srb_id.zip", "ftp://smartengines.com/midv-500/dataset/41_srb_passport.zip", "ftp://smartengines.com/midv-500/dataset/42_svk_id.zip", "ftp://smartengines.com/midv-500/dataset/43_tur_id.zip", "ftp://smartengines.com/midv-500/dataset/44_ukr_id.zip", "ftp://smartengines.com/midv-500/dataset/45_ukr_passport.zip", "ftp://smartengines.com/midv-500/dataset/46_ury_passport.zip", "ftp://smartengines.com/midv-500/dataset/47_usa_bordercrossing.zip", "ftp://smartengines.com/midv-500/dataset/48_usa_passportcard.zip", "ftp://smartengines.com/midv-500/dataset/49_usa_ssn82.zip", "ftp://smartengines.com/midv-500/dataset/50_xpo_id.zip", ] midv2019_links = [ "ftp://smartengines.com/midv-500/extra/midv-2019/dataset/01_alb_id.zip", "ftp://smartengines.com/midv-500/extra/midv-2019/dataset/02_aut_drvlic_new.zip", "ftp://smartengines.com/midv-500/extra/midv-2019/dataset/03_aut_id_old.zip", "ftp://smartengines.com/midv-500/extra/midv-2019/dataset/04_aut_id.zip", "ftp://smartengines.com/midv-500/extra/midv-2019/dataset/05_aze_passport.zip", "ftp://smartengines.com/midv-500/extra/midv-2019/dataset/06_bra_passport.zip", "ftp://smartengines.com/midv-500/extra/midv-2019/dataset/07_chl_id.zip", "ftp://smartengines.com/midv-500/extra/midv-2019/dataset/08_chn_homereturn.zip", "ftp://smartengines.com/midv-500/extra/midv-2019/dataset/09_chn_id.zip", "ftp://smartengines.com/midv-500/extra/midv-2019/dataset/10_cze_id.zip", "ftp://smartengines.com/midv-500/extra/midv-2019/dataset/11_cze_passport.zip", "ftp://smartengines.com/midv-500/extra/midv-2019/dataset/12_deu_drvlic_new.zip", "ftp://smartengines.com/midv-500/extra/midv-2019/dataset/13_deu_drvlic_old.zip", "ftp://smartengines.com/midv-500/extra/midv-2019/dataset/14_deu_id_new.zip", "ftp://smartengines.com/midv-500/extra/midv-2019/dataset/15_deu_id_old.zip", "ftp://smartengines.com/midv-500/extra/midv-2019/dataset/16_deu_passport_new.zip", "ftp://smartengines.com/midv-500/extra/midv-2019/dataset/17_deu_passport_old.zip", "ftp://smartengines.com/midv-500/extra/midv-2019/dataset/18_dza_passport.zip", "ftp://smartengines.com/midv-500/extra/midv-2019/dataset/19_esp_drvlic.zip", "ftp://smartengines.com/midv-500/extra/midv-2019/dataset/20_esp_id_new.zip", "ftp://smartengines.com/midv-500/extra/midv-2019/dataset/21_esp_id_old.zip", "ftp://smartengines.com/midv-500/extra/midv-2019/dataset/22_est_id.zip", "ftp://smartengines.com/midv-500/extra/midv-2019/dataset/23_fin_drvlic.zip", "ftp://smartengines.com/midv-500/extra/midv-2019/dataset/24_fin_id.zip", "ftp://smartengines.com/midv-500/extra/midv-2019/dataset/25_grc_passport.zip", "ftp://smartengines.com/midv-500/extra/midv-2019/dataset/26_hrv_drvlic.zip", "ftp://smartengines.com/midv-500/extra/midv-2019/dataset/27_hrv_passport.zip", "ftp://smartengines.com/midv-500/extra/midv-2019/dataset/28_hun_passport.zip", "ftp://smartengines.com/midv-500/extra/midv-2019/dataset/29_irn_drvlic.zip", "ftp://smartengines.com/midv-500/extra/midv-2019/dataset/30_ita_drvlic.zip", "ftp://smartengines.com/midv-500/extra/midv-2019/dataset/31_jpn_drvlic.zip", "ftp://smartengines.com/midv-500/extra/midv-2019/dataset/32_lva_passport.zip", "ftp://smartengines.com/midv-500/extra/midv-2019/dataset/33_mac_id.zip", "ftp://smartengines.com/midv-500/extra/midv-2019/dataset/34_mda_passport.zip", "ftp://smartengines.com/midv-500/extra/midv-2019/dataset/35_nor_drvlic.zip", "ftp://smartengines.com/midv-500/extra/midv-2019/dataset/36_pol_drvlic.zip", "ftp://smartengines.com/midv-500/extra/midv-2019/dataset/37_prt_id.zip", "ftp://smartengines.com/midv-500/extra/midv-2019/dataset/38_rou_drvlic.zip", "ftp://smartengines.com/midv-500/extra/midv-2019/dataset/39_rus_internalpassport.zip", "ftp://smartengines.com/midv-500/extra/midv-2019/dataset/40_srb_id.zip", "ftp://smartengines.com/midv-500/extra/midv-2019/dataset/41_srb_passport.zip", "ftp://smartengines.com/midv-500/extra/midv-2019/dataset/42_svk_id.zip", "ftp://smartengines.com/midv-500/extra/midv-2019/dataset/43_tur_id.zip", "ftp://smartengines.com/midv-500/extra/midv-2019/dataset/44_ukr_id.zip", "ftp://smartengines.com/midv-500/extra/midv-2019/dataset/45_ukr_passport.zip", "ftp://smartengines.com/midv-500/extra/midv-2019/dataset/46_ury_passport.zip", "ftp://smartengines.com/midv-500/extra/midv-2019/dataset/47_usa_bordercrossing.zip", "ftp://smartengines.com/midv-500/extra/midv-2019/dataset/48_usa_passportcard.zip", "ftp://smartengines.com/midv-500/extra/midv-2019/dataset/49_usa_ssn82.zip", "ftp://smartengines.com/midv-500/extra/midv-2019/dataset/50_xpo_id.zip", ] def download_dataset(download_dir: str, dataset_name: str = "midv500"): """ This script downloads the MIDV-500 dataset with extra files and unzips the folders. dataset_name: str "midv500": https://doi.org/10.18287/2412-6179-2019-43-5-818-824 "midv2019": https://doi.org/10.1117/12.2558438 "all": midv500 + midv2019 """ if dataset_name == "midv500": links_set = { "midv500": midv500_links, } elif dataset_name == "midv2019": links_set = { "midv2019": midv2019_links, } elif dataset_name == "all": links_set = { "midv500": midv500_links, "midv2019": midv2019_links, } else: Exception('Invalid dataset_name, try one of "midv500", "midv2019" or "all".') for k, v in links_set.items(): dst = os.path.join(download_dir, k) for link in v: print("--------------------------------------------------------------") # download zip file link = link.replace("\\", "/") # for windows filename = link.split("/")[-1] print("\nDownloading:", filename) download(link, dst) print("Downloaded:", filename) # unzip zip file print("Unzipping:", filename) zip_path = os.path.join(dst, filename) unzip(zip_path, dst) print("Unzipped:", filename.replace(".zip", "")) # remove zip file os.remove(zip_path) if __name__ == "__main__": # construct the argument parser ap = argparse.ArgumentParser() # add the arguments to the parser ap.add_argument( "download_dir", default="data/", help="Directory for MIDV-500 dataset to be downloaded.", ) args = vars(ap.parse_args()) # download dataset download_dataset(args["download_dir"])
[ 11748, 28686, 198, 11748, 1822, 29572, 198, 6738, 3095, 85, 4059, 13, 26791, 1330, 4321, 11, 555, 13344, 198, 198, 13602, 85, 4059, 62, 28751, 796, 685, 198, 220, 220, 220, 366, 701, 79, 1378, 27004, 1516, 1127, 13, 785, 14, 13602, ...
2.051709
4,564
import traceback import pycountry import taxjar import frappe from erpnext import get_default_company from frappe import _ from frappe.contacts.doctype.address.address import get_company_address TAX_ACCOUNT_HEAD = frappe.db.get_single_value("TaxJar Settings", "tax_account_head") SHIP_ACCOUNT_HEAD = frappe.db.get_single_value("TaxJar Settings", "shipping_account_head")
[ 11748, 12854, 1891, 198, 198, 11748, 12972, 19315, 198, 11748, 1687, 9491, 198, 198, 11748, 5306, 27768, 198, 6738, 1931, 79, 19545, 1330, 651, 62, 12286, 62, 39722, 198, 6738, 5306, 27768, 1330, 4808, 198, 6738, 5306, 27768, 13, 3642, ...
3.096774
124
import unittest import numpy as np import numpy.testing as nptest import centerpoints.lib as lib
[ 11748, 555, 715, 395, 198, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 299, 32152, 13, 33407, 355, 299, 457, 395, 198, 198, 11748, 3641, 13033, 13, 8019, 355, 9195, 628 ]
3.225806
31
# test comment import os filename = input("File to format: ") os.system("gunzip "+filename) n = int(input("What number genome is this? ")) os.system("mv "+filename[:-3]+" genome"+str(n)+".fna") original = "genome"+str(n)+".fna" copy = "genome"+str(n)+"_copy.fna" filtered = "genome"+str(n)+"_filtered.fna" rem = ['>'] with open(original) as old, open(copy,'w') as new: for line in old: if not any(bad in line for bad in rem): new.write(line) with open(copy) as f, open(filtered,'a') as f2: f2.write("".join(line.strip() for line in f)) with open(filtered, 'r+') as inp: y = inp.read().upper() inp.truncate(0) with open(filtered, 'a') as out: out.write(y) os.remove(copy)
[ 2, 1332, 2912, 198, 11748, 28686, 198, 34345, 796, 5128, 7203, 8979, 284, 5794, 25, 366, 8, 198, 418, 13, 10057, 7203, 7145, 13344, 43825, 34345, 8, 198, 77, 796, 493, 7, 15414, 7203, 2061, 1271, 19270, 318, 428, 30, 366, 4008, 198,...
2.315961
307
from villas.controller.components.manager import Manager from villas.controller.component import Component
[ 6738, 4489, 292, 13, 36500, 13, 5589, 3906, 13, 37153, 1330, 9142, 198, 6738, 4489, 292, 13, 36500, 13, 42895, 1330, 35100, 628 ]
4.695652
23
from protorpc.messages import Message, IntegerField, StringField import protopigeon def test(): ComposedMessage = protopigeon.compose(MessageOne, MessageTwo) assert hasattr(ComposedMessage, 'one') assert hasattr(ComposedMessage, 'two') assert hasattr(ComposedMessage, 'three') assert hasattr(ComposedMessage, 'four') # Make sure these fields weren't modified assert MessageOne.one.number == 1 assert MessageOne.two.number == 2 assert MessageTwo.three.number == 1 assert MessageTwo.four.number == 2 instance = ComposedMessage( one=1, two=2, three='three', four='four') assert instance
[ 6738, 1237, 273, 14751, 13, 37348, 1095, 1330, 16000, 11, 34142, 15878, 11, 10903, 15878, 198, 11748, 1237, 404, 10045, 261, 628, 628, 198, 4299, 1332, 33529, 198, 220, 220, 220, 3082, 1335, 12837, 796, 1237, 404, 10045, 261, 13, 785, ...
2.823529
238
""" # !/usr/bin/env python # -*- coding: utf-8 -*- @Time : 2022/2/23 19:35 @Author : shengdl999links@gmail.com @ProjectName : udacity-program_self_driving_car_engineer_v1.0_source.0 @File : visualization.py """ import glob import os.path import matplotlib.pyplot as plt from matplotlib.patches import Rectangle from PIL import Image from utils import get_data def viz(ground_truth): """ create a grid visualization of images with color coded bboxes args: - ground_truth [list[dict]]: ground truth data """ # IMPLEMENT THIS FUNCTION paths = glob.glob('../data/images/*') gt_dic = {} # mapping to access data faster for gt in ground_truth: gt_dic[gt['filename']] = gt # color mapping of classes color_map = {1: [1, 0, 0], 2: [0, 1, 0], 4: [0, 0, 1]} f, ax = plt.subplots(4, 5, figsize=(20, 10)) for i in range(20): x = i % 4 y = i % 5 filename = os.path.basename(paths[i]) img = Image.open(paths[i]) ax[x, y].imshow(img) bboxes = gt_dic[filename]['boxes'] classes = gt_dic[filename]['classes'] for cl, bb in zip(classes, bboxes): y1, x1, y2, x2 = bb rec = Rectangle((x1, y1), x2 - x1, y2 - y1, facecolor='none', edgecolor=color_map[cl]) ax[x, y].add_patch(rec) ax[x, y].axis('off') plt.tight_layout() plt.show() if __name__ == "__main__": ground_truth, _ = get_data() viz(ground_truth)
[ 37811, 198, 2, 5145, 14, 14629, 14, 8800, 14, 24330, 21015, 198, 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 31, 7575, 220, 220, 220, 220, 220, 220, 220, 1058, 33160, 14, 17, 14, 1954, 678, 25, 2327, 198, 31, ...
2.156385
697
from setuptools import setup long_description = 'TODO' # with open("README.md", "r") as rfd: # long_description = rfd.read() REQUIREMENTS = [r.strip() for r in open("requirements.txt").readlines()] setup( name='python-fakeports', version="0.1", packages=['python_fakeports'], url='', license='GPL', author='George Nicolaou', author_email='george@silensec.com', description='Python clone of portspoof', long_description=long_description, install_requires=REQUIREMENTS, data_files=[ ('/etc/fakeports/', ['fakeports.yml.sample']), ('/usr/local/bin/', ['bin/fakeports.tac']) ], scripts=['bin/fakeportsctl', 'bin/fakeportsd'], platforms='any', classifiers = [line.strip() for line in '''\ Development Status :: 4 - Beta Intended Audience :: System Administrators Operating System :: POSIX :: Linux '''] )
[ 6738, 900, 37623, 10141, 1330, 9058, 198, 198, 6511, 62, 11213, 796, 705, 51, 3727, 46, 6, 198, 2, 351, 1280, 7203, 15675, 11682, 13, 9132, 1600, 366, 81, 4943, 355, 374, 16344, 25, 198, 2, 220, 220, 220, 220, 890, 62, 11213, 796,...
2.587896
347
from .BiomeDisplay import BiomeDisplay from .Chats import Chats from .PlayEffect import PlayEffect from .Reconnect import Reconnect from .SwapAck import SwapAck from .UseItemAck import UseItemAck
[ 6738, 764, 23286, 462, 23114, 1330, 8436, 462, 23114, 198, 6738, 764, 1925, 1381, 1330, 609, 1381, 198, 6738, 764, 11002, 18610, 1330, 3811, 18610, 198, 6738, 764, 6690, 261, 1606, 1330, 23419, 1606, 198, 6738, 764, 10462, 499, 32, 694,...
3.421053
57
num_to_letters = { '2': ['a', 'b', 'c'], '3': ['d', 'e', 'f'], '4': ['g', 'h', 'i'], '5': ['j', 'k', 'l'], '6': ['m', 'n', 'o'], '7': ['p', 'q', 'r', 's'], '8': ['t', 'u', 'v'], '9': ['w', 'x', 'y', 'z'], }
[ 22510, 62, 1462, 62, 15653, 796, 1391, 198, 220, 220, 220, 705, 17, 10354, 37250, 64, 3256, 705, 65, 3256, 705, 66, 6, 4357, 220, 220, 220, 220, 198, 220, 220, 220, 705, 18, 10354, 37250, 67, 3256, 705, 68, 3256, 705, 69, 6, 435...
1.453125
192
# Copyright 2014-2015 ARM Limited # # Licensed under the Apache License, Version 2.0 # See LICENSE file for details. # standard library options from argparse import Action, SUPPRESS
[ 2, 15069, 1946, 12, 4626, 20359, 15302, 198, 2, 198, 2, 49962, 739, 262, 24843, 13789, 11, 10628, 362, 13, 15, 198, 2, 4091, 38559, 24290, 2393, 329, 3307, 13, 198, 198, 2, 3210, 5888, 3689, 198, 6738, 1822, 29572, 1330, 7561, 11, ...
4
46
# MIT License # # Copyright (c) 2019 Arkadiusz Netczuk <dev.arnet@gmail.com> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in all # copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. # from pybrain.rl.environments.environment import Environment from gym.spaces.discrete import Discrete def action(self, actionValue): """Transform action value received from PyBrain and pass result to OpenAi Gym.""" return actionValue def reward(self, rewardValue): """Transform reward value received from OpenAi Gym and pass result to PyBrain.""" return rewardValue
[ 2, 17168, 13789, 198, 2, 198, 2, 15069, 357, 66, 8, 13130, 9128, 324, 3754, 89, 3433, 26691, 2724, 1279, 7959, 13, 1501, 316, 31, 14816, 13, 785, 29, 198, 2, 198, 2, 2448, 3411, 318, 29376, 7520, 11, 1479, 286, 3877, 11, 284, 59...
3.608392
429
#!/usr/bin/env python #-*- coding: utf-8 -*- #--------------------------------------------------------------------------------------------------- # --> Logic to handle scenarios #--------------------------------------------------------------------------------------------------- import imports from imports import * import config import logic from logic import *
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 2, 12, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 2, 10097, 3880, 6329, 198, 2, 14610, 30146, 284, 5412, 13858, 198, 2, 10097, 3880, 6329, 198, 198, 11748, 17944, 198, ...
5.983607
61
import dash import dash_html_components as html import dash_bootstrap_components as dbc import numpy as np from server import app from dash.dependencies import Input, Output, State from dash.exceptions import PreventUpdate from components.cards import simple_info_card from components.dropdowns import dropdown_single from components.cards import project_info_card from components.tables import simple_table from components.gantts import simple_gantt_graph from logic.dropdowns import dropdown_single_logic from logic.tables import generate_project_tasks_data from logic.pie_charts import sunburst_chart_logic from logic.gantts import simple_gantt_logic layout = html.Div( children=[ html.Div(id="project-temp", style={"display": "none"}), dbc.Row( className="main-row", children=[ dbc.Col( dropdown_single( id_="project-select", placeholder="Select Project", text="Project:", ), width=3, ), ], ), dbc.Row( className="main-row", children=[ dbc.Col( simple_info_card( id_="project-card-planning", title="Planning", ) ), dbc.Col( simple_info_card( id_="project-card-design", title="Design", ) ), dbc.Col( simple_info_card( id_="project-card-development", title="Development", ) ), dbc.Col( simple_info_card( id_="project-card-testing", title="Testing", ) ), dbc.Col( simple_info_card( id_="project-card-cost", title="Cost", ) ), dbc.Col( simple_info_card( id_="project-card-duration", title="Duration", ) ), ], ), dbc.Row( className="main-row", children=[ dbc.Col( project_info_card( id_="budget-graph", title="Budget spending", subcomponents={ "project-budget": "Budget", "project-remaining": "Remaining", "project-currently": "Currently", }, ), width=6, ), dbc.Col( simple_table( id_="project-tasks-table", title="Overdue tasks", columns=[ "Overdue (days)", "Task", "Deadline", "Employee", ], ), width=6, ), ], ), html.Div( className="main-row", children=[html.H4("Milestones", className="title-bold")] ), dbc.Row( className="main-row", children=[dbc.Col(simple_gantt_graph(id_="project-gantt-graph"))], ), ] )
[ 11748, 14470, 198, 11748, 14470, 62, 6494, 62, 5589, 3906, 355, 27711, 198, 11748, 14470, 62, 18769, 26418, 62, 5589, 3906, 355, 288, 15630, 198, 11748, 299, 32152, 355, 45941, 198, 6738, 4382, 1330, 598, 198, 6738, 14470, 13, 45841, 39...
1.595105
2,329
print(appendA(toAppend = raw_input("Enter a word to add an A letter: ")))
[ 198, 4798, 7, 33295, 32, 7, 1462, 4677, 437, 796, 8246, 62, 15414, 7203, 17469, 257, 1573, 284, 751, 281, 317, 3850, 25, 366, 22305, 198 ]
2.884615
26
#!/usr/bin/python from __future__ import print_function import threading import boto3 import botocore import argparse from time import ctime ############### # Some Global Vars ############## lock = threading.Lock() awsaccts = [{'acct': 'acct1ID', 'name': 'master', 'cffile': 'location of cloudformation file in S3'}, {'acct': 'acct2ID', 'name': 'dev', 'cffile': 'location of cloudformation file in S3'}, {'acct': 'acct3ID', 'name': 'staging', 'cffile': 'location of cloudformation file in S3'}, {'acct': 'acct4ID', 'name': 'test', 'cffile': 'location of cloudformation file in S3'}, {'acct': 'acct5ID', 'name': 'QA', 'cffile': 'location of cloudformation file in S3'}] ################################### # This results dict is prepopulated with the info for the master vpc in a region. It will be overwritten # if the master cloudform is run ################################### results = { 'master': { 'CIDRblock': '172.0.1.0/22', 'RTBint': [ 'rtb-xxxxxxxx', 'rtb-xxxxxxxx'], 'VPCID': 'vpc-xxxxxxxx'}} threads = [] ####################### # The function that does CloudFormation and peering requests ####################### if __name__ == '__main__': main()
[ 2, 48443, 14629, 14, 8800, 14, 29412, 198, 6738, 11593, 37443, 834, 1330, 3601, 62, 8818, 198, 198, 11748, 4704, 278, 198, 11748, 275, 2069, 18, 198, 11748, 10214, 420, 382, 198, 11748, 1822, 29572, 198, 6738, 640, 1330, 269, 2435, 19...
2.279675
615
import os from Config import Config from NIM.algorithms import WhaleOptimizationAlgorithm from NIM.algorithms.algorithm import logger if __name__ == '__main__': with open(Config.default_saved_scene_path, 'r') as f: data = f.read() m2d = eval(data) seed = 5 woa = WhaleOptimizationAlgorithm(m2d, Config.rasterized_cell_size, func=Config.func, iterations=Config.iterations, debug=True, population=Config.number_of_robots, robot_size=Config.size, seed=seed, k=Config.leakage_sources) best_sol, best_val = woa.run() logger.info("best sol:{sol}, best val:{val}".format(sol=best_sol, val=best_val)) func_name = type(woa.func).__name__ woa.iter_swarm_pos.to_csv( os.path.join(Config.project_root, "data/csv_file/woa_MultiSourceFunction_" + str(seed) + ".csv"))
[ 11748, 28686, 198, 198, 6738, 17056, 1330, 17056, 198, 6738, 399, 3955, 13, 282, 7727, 907, 1330, 44772, 27871, 320, 1634, 2348, 42289, 198, 6738, 399, 3955, 13, 282, 7727, 907, 13, 282, 42289, 1330, 49706, 628, 198, 361, 11593, 3672, ...
2.267352
389
''' File: COVIDZejunDatagraphs.py Author: Zejun Li Purpose: This file contains 12 different functions to make 5 different graphs about the COVID 19 in Idaho ''' import pandas as pd, numpy as np, matplotlib.pyplot as plt import matplotlib.dates as mdates import datetime import datetime as dt def get_df(): ''' This function is to get the dataframe from the csv file : data_table_for_daily_death_trends__idaho.csv ''' fname = "data_table_for_daily_death_trends__idaho.csv" df = pd.read_csv(fname,sep=',', skiprows = 2, engine='python') del df["State"] df["Dates"] = np.nan df['Dates'] = df['Date'].apply(date_convert) del df["Date"] return df def get_date_lst(): '''This function is to get all of the dates from the Dates column ''' df = get_df() lst_dates = [] for i in df['Dates']: lst_dates.append(i) return lst_dates def fig1(): '''This function is to make a line graph with x axis of Dates and y axis of Current Hospitalized COVID-19 Patients. ''' df = get_df() lst_dates = get_date_lst() x = [dt.datetime.strptime(d,'%m/%d/%Y').date() for d in lst_dates] plt.gca().xaxis.set_major_formatter(mdates.DateFormatter('%m/%d/%Y')) plt.gca().xaxis.set_major_locator(mdates.DayLocator(interval=50)) plt.plot(x,df['Current Hospitalized COVID-19 Patients']) plt.gcf().autofmt_xdate() plt.xlabel("Dates") plt.ylabel("Current Hospitalized COVID-19 Patients") plt.suptitle('Figure 1', fontsize=16) def fig2(): '''This function is to make a bar chart with x axis of Dates and y axis of New Deaths ''' df = get_df() lst_dates = get_date_lst() plt.figure(figsize=(10,10)) plt.style.use('ggplot') lst_dates = [] for i in df['Dates']: lst_dates.append(i) x = [dt.datetime.strptime(d,'%m/%d/%Y').date() for d in lst_dates] lst = [] for i in df['New Deaths']: lst.append(i) x_pos = [i for i, _ in enumerate(x)] plt.bar(x,lst,width=0.8, color='darkviolet') plt.xlabel("Dates") plt.ylabel("New Deaths") plt.suptitle('Figure 2', fontsize=16) def fig3(): '''This function is to make a scatter plot with x axis of Dates and y axis of 7-Day Moving Avg ''' df = get_df() plt.figure(figsize=(16,10), dpi= 80) lst_dates = get_date_lst() lst = [] for i in df["7-Day Moving Avg"]: lst.append(i) int_lst = [] for i in range(len(lst_dates)): int_lst.append(i) x = np.array(lst_dates) y = np.array(lst) x1 = np.array(int_lst) m, b = np.polyfit(x1, y, 1) plt.plot(x, m*x1 + b) plt.scatter(x, y) plt.gca().xaxis.set_major_locator(mdates.DayLocator(interval=50)) plt.xlabel("Dates") plt.ylabel("7-Day Moving Avg") plt.gca().invert_xaxis() plt.suptitle('Figure 3', fontsize=16) main() def csv(file): ''' This function is to get two dataframes from the csv file; df: data_table_for_daily_case_trends__idaho1.csv; df2:data_table_for_daily_death_trends__idaho2.csv ''' df = pd.read_csv(file, sep = ",", skiprows = 2) df2 = pd.read_csv("data_table_for_daily_death_trends__idaho2.csv", sep = "," , skiprows = 2) df["New Deaths"] = df2["New Deaths"] df["Doses Per Day"] = 0 df["Dates"] = df["Date"].replace({"Jan":"01", "Feb":"02","Mar":"03","Apr":"04","May":"05","Jun":"06","Jul":"07","Aug":"08","Sep":"09","Oct":"10","Nov":"11","Dec":"12"}, regex = True) df["Total Doses Administered"] = df["Total Doses Administered"].fillna(0) for i in range(1, len(df["Total Doses Administered"])-1): a = pd.to_numeric(df["Total Doses Administered"]) df.loc[i-1,"Doses Per Day"] = abs((int(a.iloc[i-1]) - int(a.iloc[i]))) a.append(df["Doses Per Day"]) df.drop(labels = [0], axis = 0) df.drop([0, 1, 2], axis = 0,inplace = True) del df["7-Day Moving Avg"] del df["State"] return df def clean_dose(): '''This function is to delete the dates that don't have dose ''' df = csv("data_table_for_daily_case_trends__idaho1.csv") for i in range(626,670): df = df.drop(index=i) return df def fig4(): '''This function is to make a line graph with x axis of Dates and y axis of New cases ''' df = csv("data_table_for_daily_case_trends__idaho1.csv") x = [dt.datetime.strptime(d,'%m %d %Y').date() for d in df["Dates"]] plt.gca().xaxis.set_major_formatter(mdates.DateFormatter('%m %d %Y')) plt.gca().xaxis.set_major_locator(mdates.DayLocator(interval=50)) plt.plot(x,df['New Cases']) plt.gcf().autofmt_xdate() plt.xlabel("Dates") plt.ylabel("New Cases") plt.suptitle('Figure 4', fontsize=16) ''' def fig5(): df = csv("data_table_for_daily_case_trends__idaho1.csv") plt.figure(figsize=(10,10)) plt.style.use('ggplot') lst_dates = [] for i in df['Dates']: lst_dates.append(i) x = [dt.datetime.strptime(d,'%m %d %Y').date() for d in df["Dates"]] lst = [] for i in df['New Deaths']: lst.append(i) x_pos = [i for i, _ in enumerate(x)] plt.bar(x,lst,width=0.8, color='black') plt.xlabel("Dates") plt.ylabel("New Deaths") plt.suptitle('Figure 5', fontsize=16) ''' def fig5(): '''This function is to make a bar chart with x axis of Dates and y axis of Doses Per Day ''' df = clean_dose() plt.figure(figsize=(16,10), dpi= 80) lst = [] for i in df["Doses Per Day"]: lst.append(i) x = np.array(df["Dates"]) y = np.array(lst) plt.gca().xaxis.set_major_locator(mdates.DayLocator(interval=50)) plt.bar(x,lst,width=0.8, color='navy') plt.xlabel("Dates") plt.ylabel("Doses Per Day") plt.gca().invert_xaxis() plt.suptitle('Figure 5', fontsize=16) main2()
[ 7061, 6, 201, 198, 8979, 25, 7375, 11008, 36056, 29741, 27354, 6111, 82, 13, 9078, 201, 198, 13838, 25, 9033, 29741, 7455, 201, 198, 30026, 3455, 25, 770, 2393, 4909, 1105, 1180, 5499, 284, 787, 642, 1180, 28770, 546, 262, 7375, 11008...
2.111819
2,826
import pytest import json import datetime from scrapy.spiders import Spider import scrapy.exceptions from skyscraper.items import BasicItem from scrapy.exceptions import DropItem from skyscraper.pipelines.filesystem import DiskDeduplicationPipeline
[ 11748, 12972, 9288, 198, 11748, 33918, 198, 11748, 4818, 8079, 198, 198, 6738, 15881, 88, 13, 2777, 4157, 1330, 12648, 198, 11748, 15881, 88, 13, 1069, 11755, 198, 6738, 37885, 38545, 13, 23814, 1330, 14392, 7449, 198, 6738, 15881, 88, ...
3.666667
69
__all__ = [ 'account', 'connect', 'locations', 'login', 'logout', ] from .windscribe import ( account, connect, locations, login, logout, )
[ 834, 439, 834, 796, 685, 198, 220, 220, 220, 705, 23317, 3256, 198, 220, 220, 220, 705, 8443, 3256, 198, 220, 220, 220, 705, 17946, 602, 3256, 198, 220, 220, 220, 705, 38235, 3256, 198, 220, 220, 220, 705, 6404, 448, 3256, 198, 60...
2.117647
85
# Generated by Django 3.2 on 2021-04-20 19:34 from django.db import migrations
[ 2, 2980, 515, 416, 37770, 513, 13, 17, 319, 33448, 12, 3023, 12, 1238, 678, 25, 2682, 198, 198, 6738, 42625, 14208, 13, 9945, 1330, 15720, 602, 628 ]
2.892857
28
# -*- codingutf-8 -*- # &Author AnFany # Sklearn """ """ # PM2.5 import SVM_Regression_Data as rdata # from sklearn import svm import numpy as np import matplotlib.pyplot as plt from pylab import mpl mpl.rcParams['font.sans-serif'] = ['FangSong'] # mpl.rcParams['axes.unicode_minus'] = False # """ """ # # ''' linear, poly, rbf, sigmoid ''' # # '''''' if __name__ == "__main__": datasvr = rdata.model_data realtr, outtri, realpre, poupre = result(datasvr, he='rbf') huitu(realtr, outtri, c=['b', 'k'], sign='', cudu=1.5) huitu(realpre, poupre, c=['b', 'k'], sign='', cudu=1.5)
[ 2, 532, 9, 12, 19617, 40477, 12, 23, 532, 9, 12, 201, 198, 2, 1222, 13838, 1052, 37, 1092, 201, 198, 201, 198, 2, 3661, 35720, 201, 198, 201, 198, 37811, 201, 198, 201, 198, 37811, 201, 198, 201, 198, 2, 3122, 17, 13, 20, 201,...
1.898592
355
from os.path import dirname import unittest from .decorators import skip_if_no_mock from .helpers import mock from conda import history
[ 6738, 28686, 13, 6978, 1330, 26672, 3672, 198, 11748, 555, 715, 395, 198, 198, 6738, 764, 12501, 273, 2024, 1330, 14267, 62, 361, 62, 3919, 62, 76, 735, 198, 6738, 764, 16794, 364, 1330, 15290, 198, 198, 6738, 1779, 64, 1330, 2106, ...
3.181818
44
# This file is necessary to make this directory a package. from zojax.catalog.catalog import queryCatalog
[ 2, 770, 2393, 318, 3306, 284, 787, 428, 8619, 257, 5301, 13, 198, 198, 6738, 1976, 13210, 897, 13, 9246, 11794, 13, 9246, 11794, 1330, 12405, 49015, 198 ]
3.821429
28
# -*- encoding: utf-8 -*- import itertools try: from django.core.urlresolvers import reverse except ImportError: from django.urls import reverse from django.db.models.aggregates import Sum from django.template.defaultfilters import safe from django.utils.functional import cached_property from django_tables2 import Column from django_tables2.export.views import ExportMixin from django_tables2.tables import Table from django_tables2.views import SingleTableView from bpp.models import Autor, Sumy, OpcjaWyswietlaniaField, Uczelnia from bpp.models.struktura import Wydzial def get_dostepne_wydzialy(self): return Wydzial.objects.filter(zezwalaj_na_ranking_autorow=True) def get_wydzialy(self): base_query = self.get_dostepne_wydzialy() wydzialy = self.request.GET.getlist("wydzialy[]") if wydzialy: try: wydzialy = base_query.filter(pk__in=[int(x) for x in wydzialy]) return wydzialy except (TypeError, ValueError): pass return base_query def get_context_data(self, **kwargs): context = super(SingleTableView, self).get_context_data(**kwargs) context["od_roku"] = self.kwargs["od_roku"] context["do_roku"] = self.kwargs["do_roku"] jeden_rok = False if self.kwargs["od_roku"] == self.kwargs["do_roku"]: context["rok"] = self.kwargs["od_roku"] jeden_rok = True wydzialy = self.get_wydzialy() context["wydzialy"] = wydzialy if jeden_rok: context["table_title"] = "Ranking autorw za rok %s" % context["rok"] else: context["table_title"] = "Ranking autorw za lata %s - %s" % ( context["od_roku"], context["do_roku"], ) context["tab_subtitle"] = "" if len(wydzialy) != len(self.get_dostepne_wydzialy()): context["table_subtitle"] = ", ".join([x.nazwa for x in wydzialy]) return context def get_table_kwargs(self): uczelnia = Uczelnia.objects.all().first() pokazuj = uczelnia.pokazuj_liczbe_cytowan_w_rankingu if pokazuj == OpcjaWyswietlaniaField.POKAZUJ_NIGDY or ( pokazuj == OpcjaWyswietlaniaField.POKAZUJ_ZALOGOWANYM and self.request.user.is_anonymous ): return {"exclude": ("liczba_cytowan_sum",)} return {}
[ 2, 532, 9, 12, 21004, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 11748, 340, 861, 10141, 198, 198, 28311, 25, 198, 220, 220, 220, 422, 42625, 14208, 13, 7295, 13, 6371, 411, 349, 690, 1330, 9575, 198, 16341, 17267, 12331, 25, 198, 2...
2.059272
1,181
#!/usr/bin/python3 import requests from requests.structures import CaseInsensitiveDict import json import getpass from pathlib import Path import hashlib import pandas as pd import gzip from multiprocessing import Process # Global variables #API_SERVER='https://dev-cloud.sleepdata.org/api/v1' API_SERVER='https://cloud.sleepdata.org/api/v1' #API_SERVER='http://localhost:9002/api/v1' procs=[] all_decompress_edfz=[]
[ 2, 48443, 14629, 14, 8800, 14, 29412, 18, 198, 11748, 7007, 198, 6738, 7007, 13, 7249, 942, 1330, 8913, 20376, 18464, 35, 713, 198, 11748, 33918, 198, 11748, 651, 6603, 198, 6738, 3108, 8019, 1330, 10644, 220, 198, 11748, 12234, 8019, ...
2.864865
148
import numpy as np N = 100 R = 10000 R_range = range(R) size = (N, 3) C = np.zeros((N, 3)) k = 1 print ("100") print ("STEP: ", k) for i in range(N): print ("He ", C[i, 0], " ", C[i, 1], " ", C[i, 2]) k += 1 for j in range(R): A = np.random.uniform(-1, 1, size) B = np.sum(np.multiply(A, A), axis=1) B = np.sqrt(B) B = B.reshape(N, 1) Norm_A = A / B C += Norm_A if j % 10 == 0: print ("100") print ("STEP: ", k) for i in range(N): print ("He ", C[i, 0], " ", C[i, 1], " ", C[i, 2]) k += 1
[ 11748, 299, 32152, 355, 45941, 198, 198, 45, 796, 1802, 198, 49, 796, 33028, 198, 49, 62, 9521, 796, 2837, 7, 49, 8, 198, 7857, 796, 357, 45, 11, 513, 8, 198, 34, 796, 45941, 13, 9107, 418, 19510, 45, 11, 513, 4008, 198, 74, 7...
1.957692
260
import os import matplotlib.pyplot as plt from skimage.io import imread def plot_corners(img, corners, show=True): """Display the image and plot all contours found""" plt.imshow(img, cmap='gray') plt.plot(corners[:,1], corners[:,0], 'r+', markeredgewidth=1.5, markersize=8) # Plot corners plt.axis('image') plt.xticks([]) plt.yticks([]) if show: plt.show() def find_corners(path, min_distance=5): """Find corners in an image at path Returns the image and the corner lists. """ from skimage.feature import corner_harris, corner_peaks img = imread(path, flatten=True) corners = corner_peaks(corner_harris(img), min_distance=min_distance) return img, corners def get_corners_image(path): """Given a path, return a PNG of the image with contour lines Calls both find_contours and plot_contours """ from IPython.core.pylabtools import print_figure img, corners = find_corners(path) plot_corners(img, corners, show=False) fig = plt.gcf() pngdata = print_figure(fig) plt.close(fig) return pngdata def get_pictures(pictures_dir): """Return a list of picture files found in pictures_dir""" pictures = [] for directory, subdirs, files in os.walk(pictures_dir): for fname in files: if fname.lower().endswith(('.jpg', '.png')): pictures.append(os.path.join(directory, fname)) return pictures
[ 11748, 28686, 198, 11748, 2603, 29487, 8019, 13, 9078, 29487, 355, 458, 83, 198, 198, 6738, 1341, 9060, 13, 952, 1330, 545, 961, 198, 198, 4299, 7110, 62, 20772, 364, 7, 9600, 11, 14371, 11, 905, 28, 17821, 2599, 198, 220, 220, 220,...
2.494881
586
import os import sys import pytest import shutil from .test_utils import setup_env_vars, unset_env_vars, BACKUP_DEST_DIR, FAKE_HOME_DIR, DIRS sys.path.insert(0, "../shallow_backup") from shallow_backup.utils import copy_dir_if_valid TEST_TEXT_FILE = os.path.join(FAKE_HOME_DIR, 'test-file.txt')
[ 11748, 28686, 198, 11748, 25064, 198, 11748, 12972, 9288, 198, 11748, 4423, 346, 198, 6738, 764, 9288, 62, 26791, 1330, 9058, 62, 24330, 62, 85, 945, 11, 555, 2617, 62, 24330, 62, 85, 945, 11, 28767, 8577, 62, 35, 6465, 62, 34720, 1...
2.560345
116
from collections import namedtuple import networkx as nx from mesa import Agent, Model
[ 6738, 17268, 1330, 3706, 83, 29291, 198, 198, 11748, 3127, 87, 355, 299, 87, 198, 6738, 18842, 64, 1330, 15906, 11, 9104, 198 ]
3.826087
23
""" Given a base speed value and a list of percentages, calculates the speed value for each percentage """
[ 37811, 198, 15056, 257, 2779, 2866, 1988, 290, 257, 1351, 286, 28071, 11, 43707, 262, 2866, 1988, 198, 1640, 1123, 5873, 198, 37811, 198 ]
4.458333
24
"""Base classes, context managers, and exceptions for MAGI actions.""" from abc import ABCMeta, abstractmethod import logging from openravepy import KinBody, Robot LOGGER = logging.getLogger(__name__) LOGGER.setLevel(logging.INFO) class ExecutableSolution(object): """Abstract base class for executing post-processed solutions.""" __metaclass__ = ABCMeta def __init__(self, solution): """ @param solution: Solution that generated this ExecutableSolution """ self.solution = solution self.precondition = solution.precondition self.postcondition = solution.postcondition def to_key(obj): """ Return a tuple that uniquely identifies an object in an Environment. The output of this function can be passed to from_key to find the equivalent object in, potentially, a different OpenRAVE environment. @param obj: object in an OpenRAVE environment @return tuple that uniquely identifies the object """ if obj is None: return None elif isinstance(obj, (KinBody, Robot)): key = obj.GetName(), elif isinstance(obj, (KinBody.Joint, KinBody.Link)): key = obj.GetParent().GetName(), obj.GetName() elif isinstance(obj, Robot.Manipulator): key = obj.GetRobot().GetName(), obj.GetName() else: raise TypeError('Unknown type "{!s}".'.format(type(obj))) return (type(obj), ) + key def from_key(env, key): """ Return the object identified by the input key in an Environment. The input of this function is constructed by the to_key function. @param env: an OpenRAVE environment @param key: tuple that uniquely identifies the object @return object in the input OpenRAVE environment """ if key is None: return None obj_type = key[0] if issubclass(obj_type, (KinBody, Robot)): return env.GetKinBody(key[1]) elif issubclass(obj_type, KinBody.Joint): return env.GetKinBody(key[1]).GetJoint(key[2]) elif issubclass(obj_type, KinBody.Link): return env.GetKinBody(key[1]).GetLink(key[2]) elif issubclass(obj_type, Robot.Manipulator): return env.GetRobot(key[1]).GetManipulator(key[2]) else: raise TypeError('Unknown type "{!s}".'.format(obj_type))
[ 37811, 14881, 6097, 11, 4732, 11663, 11, 290, 13269, 329, 28263, 40, 4028, 526, 15931, 198, 198, 6738, 450, 66, 1330, 9738, 48526, 11, 12531, 24396, 198, 11748, 18931, 198, 198, 6738, 1280, 5758, 9078, 1330, 16645, 25842, 11, 16071, 198...
2.774427
829
from typing import List from core.exceptions.input_exceptions import (InputFormatException, InputTypeInconsistencyException) from core.model.graph import Graph from core.model.impl.fullOD import FullOD from core.model.impl.mapOD import MapOD from core.model.infrastructure import InfrastructureNode from core.model.od import OD, ODPair from core.io.csv import CsvReader, CsvWriter from core.model.ptn import Stop, Link from core.util.config import Config, default_config
[ 6738, 19720, 1330, 7343, 198, 198, 6738, 4755, 13, 1069, 11755, 13, 15414, 62, 1069, 11755, 1330, 357, 20560, 26227, 16922, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220,...
2.937853
177
# encoding: utf-8 """ Ordinary Kriging interpolation is a linear estimation of regionalized variables. It assumes that the data change into a normal distribution, and considers that the expected value of regionalized variable Z is unknown. The interpolation process is similar to the weighted sliding average, and the weight value is determined by spatial data analysis. """ import numpy as np from shapely.geometry import Polygon,Point,shape from shapely.geometry.multipolygon import MultiPolygon from shapely.prepared import prep def shape_shadow(xgrid,ygrid,mapdata): """ Mask processing. Parameters ---------- xgrid: grid coordinates of longitude. ygrid: grid coordinates of latitude. mapdata: array of map data. Return ------ np.ndarray: An array of Boolean types. """ newshp = Polygon() for shap in mapdata: newshp = newshp.union(shape({'type':'Polygon','coordinates':[shap]})) points = [] for xi,yi in zip(xgrid.ravel(),ygrid.ravel()): points.append(Point([xi,yi])) prep_newshp = prep(newshp) mask = [] for p in points: mask.append(bool(prep_newshp.contains(p)-1)) mask = np.array(mask).reshape(xgrid.shape) return mask def interpolate(xy,z,extension=1.2,point_counts=(100,100)): """ Interpolate through the Kriging class, and return the grid points of the longitude and latitude interpolation results Parameters ---------- xy: The latitude and longitude coordinates of a spatial data point. z: The latitude and longitude coordinates of a spatial data point. extension: The interpolating region is expanded to cover a wider area. point_counts: How many data points to interpolate, default is 100 * 100. """ kri = Kriging() kri.fit(xy,z) x_max,x_min,y_max,y_min = xy[:,0].max(),xy[:,0].min(),xy[:,1].max(),xy[:,1].min() p = (extension - 1.0)/2 x_s = x_min - (x_max-x_min)*p x_e = x_max + (x_max-x_min)*p y_s = y_min - (y_max-y_min)*p y_e = y_max + (y_max-y_min)*p xls = np.linspace(x_s,x_e,point_counts[0]) yls = np.linspace(y_s,y_e,point_counts[1]) xgrid,ygrid = np.meshgrid(xls,yls) xgridls,ygridls = xgrid.ravel(),ygrid.ravel() if len(xgridls) > 100000: # Consider memory limit loop handling. zgridls = np.array([]) for s,e in zip(np.arange(0,len(xgridls),100000)[:-1],np.arange(0,len(xgridls),100000)[1:]): zgridls = np.concatenate([zgridls,kri.predict(np.c_[xgridls[s:e],ygridls[s:e]])]) if e < len(xgridls): zgridls = np.concatenate([zgridls,kri.predict(np.c_[xgridls[e:],ygridls[e:]])]) else: zgridls = kri.predict(np.c_[xgridls,ygridls]) zgrid = zgridls.reshape(xgrid.shape) return xgrid,ygrid,zgrid
[ 2, 21004, 25, 3384, 69, 12, 23, 201, 198, 201, 198, 37811, 201, 198, 35422, 3219, 509, 4359, 278, 39555, 341, 318, 257, 14174, 31850, 286, 7915, 1143, 9633, 13, 201, 198, 1026, 18533, 326, 262, 1366, 1487, 656, 257, 3487, 6082, 11, ...
2.3096
1,250
from .util import clear_proto_mask, is_proto_msg, add_proto_mask __all__ = [clear_proto_mask, is_proto_msg, add_proto_mask]
[ 6738, 764, 22602, 1330, 1598, 62, 1676, 1462, 62, 27932, 11, 318, 62, 1676, 1462, 62, 19662, 11, 751, 62, 1676, 1462, 62, 27932, 628, 198, 834, 439, 834, 796, 685, 20063, 62, 1676, 1462, 62, 27932, 11, 318, 62, 1676, 1462, 62, 196...
2.403846
52
#!/usr/bin/python import rospy from arm.srv import IKService, IKServiceResponse rospy.init_node("asdf", anonymous=True) rospy.wait_for_service('IKService') srv = rospy.ServiceProxy('IKService', IKService) resp = srv([5, 16, 8, 0, 0, 0], None) print resp
[ 2, 48443, 14629, 14, 8800, 14, 29412, 198, 198, 11748, 686, 2777, 88, 198, 6738, 3211, 13, 27891, 85, 1330, 314, 42, 16177, 11, 314, 42, 16177, 31077, 198, 198, 305, 2777, 88, 13, 15003, 62, 17440, 7203, 292, 7568, 1600, 11614, 28, ...
2.47619
105
from datetime import datetime from locale import * import scrapy from injector import Injector from scrapers.items import CoinMarketCapItem from scrapers.utils import UrlListGenerator setlocale(LC_NUMERIC, '')
[ 6738, 4818, 8079, 1330, 4818, 8079, 198, 6738, 36693, 1330, 1635, 198, 198, 11748, 15881, 88, 198, 6738, 8677, 273, 1330, 554, 752, 273, 198, 198, 6738, 15881, 364, 13, 23814, 1330, 16312, 27470, 15610, 7449, 198, 6738, 15881, 364, 13, ...
3.396825
63
from collections import OrderedDict from urllib.parse import urlparse import click import rethinkdb as r import redis import crawler.conf as conf # cli does not need to be thread-safe conn = r.connect(host=conf.RethinkDBConf.HOST, db=conf.RethinkDBConf.DB) domains = r.table('domains') def top(kind, count, data): top = OrderedDict(sorted(data.items(), key=lambda t: -t[1])) i = 1 click.secho('Top {} {}'.format(count, kind), bold=True) for value, occurences in top.items(): if not value: continue click.echo('{:>15} {}'.format(value, occurences)) i += 1 if i > count: break
[ 6738, 17268, 1330, 14230, 1068, 35, 713, 198, 6738, 2956, 297, 571, 13, 29572, 1330, 19016, 29572, 198, 198, 11748, 3904, 198, 11748, 36437, 9945, 355, 374, 198, 11748, 2266, 271, 198, 198, 11748, 27784, 1754, 13, 10414, 355, 1013, 198,...
2.279461
297
# -8*- coding: utf-8 -*- import torch import torch.nn as nn import torch.optim as optim import torch.multiprocessing as mp import torch.backends.cudnn as cudnn from torch.utils.data import DataLoader, Dataset from torch.nn.parallel import DistributedDataParallel from torch.utils.data.distributed import DistributedSampler import argparse, random, time, os import numpy as np def parameter_parser(): parser = argparse.ArgumentParser(description="Run Model") parser.add_argument("--seq_len", type=int, default=512, help="max sequence length") parser.add_argument("--ip", type=str, default="localhost", help="ip address") parser.add_argument("--port", type=str, default=str(random.randint(20000, 30000)), help="port num") parser.add_argument("--cuda_devices", type=int, nargs='+', default=list(range(torch.cuda.device_count())), help="cuda devices") parser.add_argument("--mode", type=str, choices=["train", "eval"], help="train or eval") parser.add_argument("--num_worker", type=int, default=8, help="number of data loader worker") parser.add_argument("--batch_size", type=int, default=32, help="batch size") parser.add_argument("--epoch", type=int, default=5, help="num epoch") parser.add_argument("--max_norm", type=int, default=30, help="max norm value") return parser.parse_args() def set_manual_seed(seed): np.random.seed(seed) torch.manual_seed(seed) random.seed(seed) cudnn.benchmark = False cudnn.deterministic = True def dist_init(ip, rank, local_rank, world_size, port): """ initialize data distributed """ host_addr_full = 'tcp://' + ip + ':' + str(port) torch.distributed.init_process_group("nccl", init_method=host_addr_full, rank=rank, world_size=world_size) torch.cuda.set_device(local_rank) assert torch.distributed.is_initialized() def init_weights(module): if isinstance(module, nn.Linear): nn.init.xavier_uniform_(module.weight.data) nn.init.constant_(module.bias.data, 0.0) elif isinstance(module, nn.LSTM): nn.init.xavier_uniform_(module.weight_ih_l0.data) nn.init.orthogonal_(module.weight_hh_l0.data) nn.init.constant_(module.bias_ih_l0.data, 0.0) nn.init.constant_(module.bias_hh_l0.data, 0.0) hidden_size = module.bias_hh_l0.data.shape[0] // 4 module.bias_hh_l0.data[hidden_size:(2*hidden_size)] = 1.0 if module.bidirectional: nn.init.xavier_uniform_(module.weight_ih_l0_reverse.data) nn.init.orthogonal_(module.weight_hh_l0_reverse.data) nn.init.constant_(module.bias_ih_l0_reverse.data, 0.0) nn.init.constant_(module.bias_hh_l0_reverse.data, 0.0) module.bias_hh_l0_reverse.data[hidden_size:( 2*hidden_size)] = 1.0 if __name__ == '__main__': args = parameter_parser() if args.mode == "train": trainer()
[ 2, 532, 23, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 198, 11748, 28034, 198, 11748, 28034, 13, 20471, 355, 299, 77, 198, 11748, 28034, 13, 40085, 355, 6436, 198, 11748, 28034, 13, 16680, 541, 305, 919, 278, 355, 29034,...
1.918006
1,866
from django.urls import path from .views import * app_name = 'newsletter' urlpatterns = [ path('pixel/', my_image, name='pixel'), path('click/<str:uuid>/', click_redirect, name='click'), path('notification/', notification, name='notification'), path('sendtest/<str:slug>', sendtest, name='sendtest'), path('stats/<str:slug>', stats, name='stats'), ]
[ 6738, 42625, 14208, 13, 6371, 82, 1330, 3108, 198, 198, 6738, 764, 33571, 1330, 1635, 198, 198, 1324, 62, 3672, 796, 705, 10827, 9291, 6, 198, 198, 6371, 33279, 82, 796, 685, 198, 220, 220, 220, 3108, 10786, 32515, 14, 3256, 616, 62...
2.683453
139
n = int(input()) temp_n = n k=0 while True: a = int(temp_n / 10) b = temp_n % 10 c = (a + b) % 10 new = b*10 + c k += 1 if new == n: break temp_n = new print(k)
[ 77, 796, 493, 7, 15414, 28955, 198, 29510, 62, 77, 796, 299, 198, 74, 28, 15, 198, 4514, 6407, 25, 198, 220, 220, 220, 257, 796, 493, 7, 29510, 62, 77, 1220, 838, 8, 198, 220, 220, 220, 275, 796, 20218, 62, 77, 4064, 838, 198,...
1.807339
109
#!/usr/bin/env python """ cubic spline planner Author: Atsushi Sakai """ import math import numpy as np import bisect from scipy.spatial import distance def calc_spline_course(x, y, ds=0.1): sp = Spline2D(x, y) s = list(np.arange(0, sp.s[-1], ds)) rx, ry, ryaw, rk, rdk = [], [], [], [], [] for i_s in s: ix, iy = sp.calc_position(i_s) rx.append(ix) ry.append(iy) ryaw.append(sp.calc_yaw(i_s)) rk.append(sp.calc_curvature(i_s)) rdk.append(sp.calc_d_curvature(i_s)) return rx, ry, ryaw, rk, rdk, s def main(): print("Spline 2D test") import matplotlib.pyplot as plt import numpy as np manhae1 = np.load(file='/home/menguiin/catkin_ws/src/macaron_2/path/K-CITY-garage-1m.npy') x = manhae1[0:manhae1.shape[0]-1, 0] y = manhae1[0:manhae1.shape[0]-1, 1] rx, ry, ryaw, rk, rdk, s = calc_spline_course(x, y) s = np.array(s) flg, ax = plt.subplots(1) plt.plot(range(-s.shape[0],s.shape[0],2),s, "s", label="s-value") plt.grid(True) plt.axis("equal") plt.xlabel("index") plt.ylabel("sval") plt.legend() flg, ax = plt.subplots(1) plt.plot(x, y, "xb", label="input") plt.plot(rx, ry, "-r", label="spline") plt.grid(True) plt.axis("equal") plt.xlabel("x[m]") plt.ylabel("y[m]") plt.legend() flg, ax = plt.subplots(1) plt.plot(s, [math.degrees(iyaw) for iyaw in ryaw], "or", label="yaw") plt.grid(True) plt.legend() plt.xlabel("line length[m]") plt.ylabel("yaw angle[deg]") flg, ax = plt.subplots(1) plt.plot(s, rk, "-r", label="curvature") plt.grid(True) plt.legend() plt.xlabel("line length[m]") plt.ylabel("curvature [1/m]") plt.show() if __name__ == '__main__': main()
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 37811, 198, 66, 549, 291, 4328, 500, 42351, 198, 198, 13838, 25, 317, 912, 17731, 13231, 1872, 198, 198, 37811, 198, 11748, 10688, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 47457, ...
1.844262
976
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from behave import * from helpers.eventually import eventually
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 198, 6738, 17438, 1330, 1635, 198, 6738, 49385, 13, 15596, 935, 1330, 4191, 628 ]
2.947368
38
from django.conf.urls import url, include from django.contrib import admin from django.contrib.auth.views import login, logout from django.conf import settings from django.views.static import serve from django.views.generic import TemplateView urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'^accounts/login/$', login, {'template_name': 'login_page/login.html'}, name='login'), url(r'^accounts/logout/$', logout, name='logout'), url('', include('social_django.urls', namespace='social')), # . url(r'^ckeditor/', include('ckeditor_uploader.urls')), url(r'^ht/', include('health_check.urls')), url(r'^paypal/', include('paypal.standard.ipn.urls')), url(r'^shop/', include('goods.urls', namespace='shop')), url(r'^$', TemplateView.as_view(template_name='index.html')), ] if settings.DEBUG: import debug_toolbar from django.conf.urls.static import static urlpatterns += [ url(r'^__debug__/', include(debug_toolbar.urls)), url(r'^uploads/(?P<path>.*)$', serve, {'document_root': settings.MEDIA_ROOT}), ] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
[ 6738, 42625, 14208, 13, 10414, 13, 6371, 82, 1330, 19016, 11, 2291, 198, 6738, 42625, 14208, 13, 3642, 822, 1330, 13169, 198, 6738, 42625, 14208, 13, 3642, 822, 13, 18439, 13, 33571, 1330, 17594, 11, 2604, 448, 198, 6738, 42625, 14208, ...
2.40481
499
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import subprocess as sp
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 198, 11748, 850, 14681, 355, 599, 628 ]
2.354839
31
from django.conf.urls import patterns, url from django.contrib import admin from django.contrib.auth.decorators import login_required from django.views.generic import TemplateView admin.autodiscover() from plag import views, const urlpatterns = patterns('', url(r'^$', views.IndexView.as_view(), name='index'), url(r'^index-trial/$', views.IndexTrialView.as_view(), name='index_trial'), url(r'^download/(?P<prot_res_id>\d+)$', views.download_file, name='download'), url(r'^products/$', TemplateView.as_view(template_name='plag/static/products.html'), name='products'), url(r'^features-screenshots/$', TemplateView.as_view(template_name='plag/static/features_and_screenshots.html'), name='features'), url(r'^url-protection/$', TemplateView.as_view(template_name='plag/static/url_protection.html'), name='url_prot'), url(r'^document-protection/$', TemplateView.as_view(template_name='plag/static/doc_protection.html'), name='doc_prot'), url(r'^pricing/$', TemplateView.as_view(template_name='plag/static/pricing.html'), name='pricing'), url(r'^risks-of-plagiarism/$', TemplateView.as_view(template_name='plag/static/risks_of_plagiarism.html'), name='risks_plag'), url(r'^about-us/$', TemplateView.as_view(template_name='plag/static/about.html'), name='about'), url(r'^our-customers/$', TemplateView.as_view(template_name='plag/static/our_customers.html'), name='our_customers'), url(r'^contact-us/$', TemplateView.as_view(template_name='plag/static/contact_us.html'), name='contact'), url(r'^order/$', views.OrderView.as_view(), name='order'), url(r'^ajax/username-check/$', views.username_unique, name='ajax_username_unique'), url(r'^account/$', views.account, name='account'), url(r'^account/profile/$', login_required(views.ProfileView.as_view()), name='profile'), url(r'^account/invoice/(?P<pk>\d+)$', views.invoice, name='invoice'), url(r'^account/invoice/pay/(?P<pk>\d+)$', views.pay_invoice, name='pay_invoice'), url(r'^account/invoice/subscribe/(?P<pk>\d+)$', views.subscribe_invoice, name='subscribe_invoice'), url(r'^ipn-endpoint/$', views.ipn, name='ipn'), url(r'^account/recent-scans/$', views.recent_scans, name='recent_scans_default'), url(r'^account/recent-scans/(?P<num_days>\d+)$', views.recent_scans, name='recent_scans'), url(r'^account/recent-scans/(?P<num_days>\d+)/(?P<hide_zero>hide-zero)$', views.recent_scans, name='recent_scans_hide_zero'), url(r'^account/scan-history/$', views.scan_history, name='scan_history'), url(r'^account/scan-history/(?P<hide_zero>hide-zero)$', views.scan_history, name='scan_history_hide_zero'), url(r'^ajax/plag-results/$', views.plagiarism_results, name='ajax_plag_results_default'), url(r'^ajax/plag-results/(?P<scan_id>\d+)$', views.plagiarism_results, name='plag_results'), url(r'^ajax/sitemap/$', views.sitemap_to_urls, name='ajax_urls'), url(r'^account/protected-resources/$', login_required(views.ProtectedResources.as_view()), name='protected_resources'), url(r'^sitemap/$', TemplateView.as_view(template_name='plag/static/sitemap.html'), name='sitemap'), url(r'^terms-of-service/$', TemplateView.as_view(template_name='plag/static/terms_of_service.html'), name='terms_of_service'), url(r'^privacy-policy/$', TemplateView.as_view(template_name='plag/static/privacy_policy.html'), name='privacy_policy'), # TODO Remove url(r'^data-cleanse/$', views.data_cleanse, name='data_cleanse'), url(r'^copyright/$', TemplateView.as_view(template_name='plag/static/copyright.html'), name='copyright'), url(r'^login/$', 'django.contrib.auth.views.login', {'template_name': 'plag/static/login_error.html'}), url(r'^logout/$', 'django.contrib.auth.views.logout', {'next_page': 'index'}, name='logout'), )
[ 6738, 42625, 14208, 13, 10414, 13, 6371, 82, 1330, 7572, 11, 19016, 198, 198, 6738, 42625, 14208, 13, 3642, 822, 1330, 13169, 198, 6738, 42625, 14208, 13, 3642, 822, 13, 18439, 13, 12501, 273, 2024, 1330, 17594, 62, 35827, 198, 6738, ...
1.843011
2,790
import hmac import hashlib import json import uuid import httplib2 COINUT_URL = 'https://coinut.com/api/'
[ 11748, 289, 20285, 198, 11748, 12234, 8019, 198, 11748, 33918, 198, 11748, 334, 27112, 198, 198, 11748, 1841, 489, 571, 17, 198, 198, 8220, 1268, 3843, 62, 21886, 796, 705, 5450, 1378, 3630, 315, 13, 785, 14, 15042, 14, 6, 198 ]
2.634146
41
from typing import Any, Dict from ordered_set import OrderedSet from neighborly.core.ecs import Component from neighborly.core.engine import AbstractFactory, ComponentDefinition
[ 6738, 19720, 1330, 4377, 11, 360, 713, 198, 198, 6738, 6149, 62, 2617, 1330, 14230, 1068, 7248, 198, 198, 6738, 4780, 306, 13, 7295, 13, 721, 82, 1330, 35100, 198, 6738, 4780, 306, 13, 7295, 13, 18392, 1330, 27741, 22810, 11, 35100, ...
4.044444
45
import threading import time import pandas as pd import numpy as np import matplotlib.cm as cm import matplotlib.pyplot as plt import os import fnmatch import random import re import getpass import sys from rdflib import Graph from synbiohub_adapter.SynBioHubUtil import * from sbol import * """ This class will perform unit testing to query information from SynBioHub's instances. Installation Requirement(s): - This test environment requires two third party packages to display plot: 1. pip install pandas 2. python -mpip install -U matplotlib To run this python file, enter in the following command from the synbiohub_adapter directory: python -m tests.SBHRun_Environment author(s) :Tramy Nguyen """ def get_uniqueID(idPrefix): """Generates a unique id """ t = time.ctime() uid = '_'.join([idPrefix, t]) return re.sub(r'[: ]', '_', uid) def create_sbolDocs(numDocs, idPrefix, sbolFile): """Returns a list of SBOL Documents numDocs: An integer value to indicate how many SBOL documents this method should create idPrefix: A unique id prefix to set each SBOL document sbolFile: the SBOL file to create an SBOL document from """ sbolDoc_List = [] sbolTriples = [] u_counter = 0 for i in range(0, numDocs): uid = get_uniqueID(idPrefix + "_d" + str(i)) trip_obj = SBOLTriple(sbolFile, uid) sbolTriples.append(trip_obj) sbolDoc_List.append(trip_obj.sbolDoc()) print("created doc%s" % i) return sbolDoc_List, sbolTriples def get_randomFile(sbolFiles): """Returns the full path of a randomly selected SBOL file found in the given directory dirLocation: The directory to select a random SBOL file from """ selectedFile = random.choice(sbolFiles) return selectedFile def get_sbolList(dirLocation): """Returns a list of xml file found in the given directory """ for root, dir, files in os.walk(dirLocation): sbolFiles = [os.path.abspath(os.path.join(root, fileName)) for fileName in files] return sbolFiles def push_sbh(sbolDoc, sbh_connector): """Returns the time (seconds) it takes to make a push to a new Collection on SynBioHub sbh_connector: An instance of pySBOL's PartShop needed to perform login for pushing and pulling data to and from SynBioHub sbolURI: The URI of the SynBioHub collection or the specific part to be fetched """ start = time.clock() result = sbh_connector.submit(sbolDoc) end = time.clock() print(result) if result != 'Successfully uploaded': sys.exit() return end - start def pull_sbh(sbh_connector, sbolURI): """Returns the time (seconds) it takes to make a pull from an existing SynBioHub Collection sbh_connector: An instance of pySBOL's PartShop needed to perform login for pushing and pulling data to and from SynBioHub sbolURI: The URI of the SynBioHub collection or the specific part to be fetched """ sbolDoc = Document() setHomespace("https://bbn.com") start = time.clock() sbh_connector.pull(sbolURI, sbolDoc) end = time.clock() if sbolDoc is None: print("Found nothing and caused no error.") else: experimentalData_tl = [] for tl in sbolDoc: if topLevel.type == 'http://sd2e.org#ExperimentalData': experimentalData_tl.append(topLevel) if len(experimentalData_tl) != 74: print("Found the wrong SynBioHub Part with this uri: %s" % sbolURI) return end - start if __name__ == '__main__': server_name = "https://synbiohub.bbn.com" print("Logging into: " + server_name) sbh_connector = PartShop(server_name) sbh_user = input('Enter Username: ') sbh_connector.login(sbh_user, getpass.getpass(prompt='Enter SynBioHub Password: ', stream=sys.stderr)) # Config.setOption("verbose", True) # sbolFiles = get_sbolList("./examples/workingFiles") sbolFiles = ["./examples/c_trips40000.xml"] iterations = 1 sbolDoc_size = 1 br_speed(sbh_connector, sbolDoc_size, sbolFiles) # br_triples(sbh_connector, iterations, sbolFiles) # iterations, set_size=10, t_growthRate=5, sbolDoc_size=100 # TODO: MAKE SURE TO CHANGE COLOR OF BAR GRAPH TO MAKE IT LOOK COOL... # br_setThread(sbh_connector, 3, 5, 3, 50, sbolFiles)
[ 198, 11748, 4704, 278, 198, 11748, 640, 198, 11748, 19798, 292, 355, 279, 67, 198, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 2603, 29487, 8019, 13, 11215, 355, 12067, 198, 11748, 2603, 29487, 8019, 13, 9078, 29487, 355, 458, 83, ...
2.625665
1,691
import os from six import iteritems from setuptools import setup from setuptools.command.develop import develop from setuptools.command.install import install import subprocess PACKAGE_NAME = 'drilsdown' SOURCES = { 'ipython_IDV': 'projects/ipython_IDV', 'idv_teleport': 'projects/IDV_teleport', 'ramadda_publish': 'projects/RAMADDA_publish', } VERSION = '2.4.91' def install_drilsdown_projects(sources, develop=False): """ Use pip to install all drilsdown projects. """ print("installing all drilsdown projects in {} mode".format( "development" if develop else "normal")) wd = os.getcwd() for k, v in iteritems(sources): try: os.chdir(os.path.join(wd, v)) if develop: subprocess.check_call(['pip', 'install', '-e', '.']) # could be pip3 on certain platforms else: subprocess.check_call(['pip', 'install', '.']) # could be pip3 on certain platforms except Exception as e: print("Oops, something went wrong installing", k) print(e) finally: os.chdir(wd) setup( name=PACKAGE_NAME, version=VERSION, author="Drilsdown team", author_email="drilsdown@unidata.ucar.edu", description="A collection of tools for jupyter notebooks", long_description_content_type='text/markdown', long_description=open('README.md').read(), url="https://github.com/Unidata/drilsdown", license="MIT", classifiers=[ 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', ], install_requires=[ 'future', 'six', 'requests', 'ipython', 'ipywidgets>=7.1.0rc', 'jupyter-client', # 'ipython_IDV>=' + VERSION + "'", # cannot be source and a dependency?? 'ipython-IDV', # from pypi 'ramadda_publish', #from pypi 'idv_teleport', #from pypi ], cmdclass={ #'install': InstallCmd, # do not overwrite for now to make # pip install and python setup.py install do same. # note in class pip might be called pip3 on certain platforms 'develop': DevelopCmd, }, extras_require={ 'addons': ['numpy','netcdf4','xarray','metpy'], 'visual': ['pyviz','geoviews'], } )
[ 11748, 28686, 198, 6738, 2237, 1330, 11629, 23814, 198, 6738, 900, 37623, 10141, 1330, 9058, 198, 6738, 900, 37623, 10141, 13, 21812, 13, 16244, 1330, 1205, 198, 6738, 900, 37623, 10141, 13, 21812, 13, 17350, 1330, 2721, 198, 11748, 850, ...
2.272978
1,088
from datetime import datetime
[ 6738, 4818, 8079, 1330, 4818, 8079 ]
4.833333
6
# Generated by Django 3.1.7 on 2021-03-24 07:36 import django.db.models.deletion from django.db import migrations, models
[ 2, 2980, 515, 416, 37770, 513, 13, 16, 13, 22, 319, 33448, 12, 3070, 12, 1731, 8753, 25, 2623, 198, 198, 11748, 42625, 14208, 13, 9945, 13, 27530, 13, 2934, 1616, 295, 198, 6738, 42625, 14208, 13, 9945, 1330, 15720, 602, 11, 4981, ...
2.818182
44
# Copyright 2015 NEC Corporation. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import mock import random import six from tempest.services.baremetal.v1.json import baremetal_client from tempest.services.data_processing.v1_1 import data_processing_client from tempest.services.database.json import flavors_client as db_flavor_client from tempest.services.database.json import versions_client as db_version_client from tempest.services.identity.v2.json import identity_client as \ identity_v2_identity_client from tempest.services.identity.v3.json import credentials_client from tempest.services.identity.v3.json import endpoints_client from tempest.services.identity.v3.json import identity_client as \ identity_v3_identity_client from tempest.services.identity.v3.json import policies_client from tempest.services.identity.v3.json import regions_client from tempest.services.identity.v3.json import services_client from tempest.services.image.v1.json import images_client from tempest.services.image.v2.json import images_client as images_v2_client from tempest.services.messaging.json import messaging_client from tempest.services.network.json import network_client from tempest.services.object_storage import account_client from tempest.services.object_storage import container_client from tempest.services.object_storage import object_client from tempest.services.orchestration.json import orchestration_client from tempest.services.telemetry.json import alarming_client from tempest.services.telemetry.json import telemetry_client from tempest.services.volume.v1.json.admin import hosts_client \ as volume_hosts_client from tempest.services.volume.v1.json.admin import quotas_client \ as volume_quotas_client from tempest.services.volume.v1.json.admin import services_client \ as volume_services_client from tempest.services.volume.v1.json.admin import types_client \ as volume_types_client from tempest.services.volume.v1.json import availability_zone_client \ as volume_az_client from tempest.services.volume.v1.json import backups_client from tempest.services.volume.v1.json import extensions_client \ as volume_extensions_client from tempest.services.volume.v1.json import qos_client from tempest.services.volume.v1.json import snapshots_client from tempest.services.volume.v1.json import volumes_client from tempest.services.volume.v2.json.admin import hosts_client \ as volume_v2_hosts_client from tempest.services.volume.v2.json.admin import quotas_client \ as volume_v2_quotas_client from tempest.services.volume.v2.json.admin import services_client \ as volume_v2_services_client from tempest.services.volume.v2.json.admin import types_client \ as volume_v2_types_client from tempest.services.volume.v2.json import availability_zone_client \ as volume_v2_az_client from tempest.services.volume.v2.json import backups_client \ as volume_v2_backups_client from tempest.services.volume.v2.json import extensions_client \ as volume_v2_extensions_client from tempest.services.volume.v2.json import qos_client as volume_v2_qos_client from tempest.services.volume.v2.json import snapshots_client \ as volume_v2_snapshots_client from tempest.services.volume.v2.json import volumes_client as \ volume_v2_volumes_client from tempest.tests import base
[ 2, 15069, 1853, 41804, 10501, 13, 220, 1439, 2489, 10395, 13, 198, 2, 198, 2, 220, 220, 220, 49962, 739, 262, 24843, 13789, 11, 10628, 362, 13, 15, 357, 1169, 366, 34156, 15341, 345, 743, 198, 2, 220, 220, 220, 407, 779, 428, 2393...
3.300681
1,174
from __future__ import annotations from itertools import product from typing import Iterator day_num = 17 Range = tuple[int, int] XStepRange = tuple[int, int | None] YStepRange = tuple[int, int] Pos = tuple[int, int]
[ 6738, 11593, 37443, 834, 1330, 37647, 198, 198, 6738, 340, 861, 10141, 1330, 1720, 198, 6738, 19720, 1330, 40806, 1352, 198, 198, 820, 62, 22510, 796, 1596, 628, 628, 198, 17257, 796, 46545, 58, 600, 11, 493, 60, 198, 55, 8600, 17257,...
3.111111
72